LazyHandler.d.ts 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. import { MathDocumentConstructor } from '../../core/MathDocument.js';
  2. import { MathItem } from '../../core/MathItem.js';
  3. import { HTMLMathItem } from '../../handlers/html/HTMLMathItem.js';
  4. import { HTMLDocument } from '../../handlers/html/HTMLDocument.js';
  5. import { HTMLHandler } from '../../handlers/html/HTMLHandler.js';
  6. export declare type Constructor<T> = new (...args: any[]) => T;
  7. export declare type LazySet = Set<string>;
  8. export declare class LazyList<N, T, D> {
  9. protected id: number;
  10. protected items: Map<string, LazyMathItem<N, T, D>>;
  11. add(math: LazyMathItem<N, T, D>): string;
  12. get(id: string): LazyMathItem<N, T, D>;
  13. delete(id: string): boolean;
  14. }
  15. export declare const LAZYID = "data-mjx-lazy";
  16. export interface LazyMathItem<N, T, D> extends MathItem<N, T, D> {
  17. lazyCompile: boolean;
  18. lazyTypeset: boolean;
  19. lazyMarker: N;
  20. lazyTex: boolean;
  21. }
  22. export declare function LazyMathItemMixin<N, T, D, B extends Constructor<HTMLMathItem<N, T, D>>>(BaseMathItem: B): Constructor<LazyMathItem<N, T, D>> & B;
  23. export interface LazyMathDocument<N, T, D> extends HTMLDocument<N, T, D> {
  24. lazyObserver: IntersectionObserver;
  25. lazyList: LazyList<N, T, D>;
  26. lazyAlwaysContainers: N[];
  27. lazyTypesetAll(): Promise<void>;
  28. lazyAlways(): void;
  29. }
  30. export declare function LazyMathDocumentMixin<N, T, D, B extends MathDocumentConstructor<HTMLDocument<N, T, D>>>(BaseDocument: B): MathDocumentConstructor<HTMLDocument<N, T, D>> & B;
  31. export declare function LazyHandler<N, T, D>(handler: HTMLHandler<N, T, D>): HTMLHandler<N, T, D>;