@mathjax/src
    Preparing search index...

    Interface LazyMathDocument<N, T, D>

    The properties added to MathDocument for lazy typesetting

    interface LazyMathDocument<N, T, D> {
        _actionPromises: Promise<void>[];
        _readyPromise: Promise<any>;
        adaptor: DOMAdaptor<N, T, D>;
        document: D;
        domStrings: HTMLDomStrings<N, T, D>;
        inputJax: InputJax<N, T, D>[];
        lazyAlwaysContainers: N[];
        lazyList: LazyList<N, T, D>;
        lazyObserver: IntersectionObserver;
        math: MathList<N, T, D>;
        mmlFactory: MmlFactory;
        options: OptionList;
        outputJax: OutputJax<N, T, D>;
        processed: BitField;
        renderActions: RenderList<N, T, D>;
        styles: StyleJson[];
        get kind(): string;
        actionPromises(): Promise<void[]>;
        addPageElements(): void;
        addRenderAction(id: string, ...action: any[]): void;
        addStyles(styles: StyleJson): void;
        addStyleSheet(): void;
        clear(): LazyMathDocument<N, T, D>;
        clearMathItemsWithin(containers: ContainerList<N>): MathItem<N, T, D>[];
        clearPromises(): void;
        compile(): LazyMathDocument<N, T, D>;
        compileError(math: MathItem<N, T, D>, err: Error): void;
        compileMath(math: MathItem<N, T, D>): void;
        concat(list: MathList<N, T, D>): LazyMathDocument<N, T, D>;
        convert(math: string, options?: OptionList): any;
        convertPromise(math: string, options?: OptionList): Promise<any>;
        documentPageElements(): N;
        documentStyleSheet(): N;
        done(): Promise<void>;
        findMath(options: OptionList): LazyMathDocument<N, T, D>;
        findMathFromDOM(
            jax: InputJax<N, T, D>,
            containers: N[],
        ): HTMLMathList<N, T, D>;
        findMathFromStrings(
            jax: InputJax<N, T, D>,
            containers: N[],
        ): HTMLMathList<N, T, D>;
        findPosition(
            N: number,
            index: number,
            delim: string,
            nodes: HTMLNodeArray<N, T>,
        ): Location<N, T>;
        findSheet(head: N, id: string): N;
        getMathItemsWithin(elements: ContainerList<N>): MathItem<N, T, D>[];
        getMetrics(): LazyMathDocument<N, T, D>;
        getStyles(): StyleJson[];
        lazyAlways(): void;
        lazyTypesetAll(): Promise<void>;
        mathItem(
            item: ProtoItem<N, T>,
            jax: InputJax<N, T, D>,
            nodes: HTMLNodeArray<N, T>,
        ): HTMLMathItem<N, T, D>;
        removeFromDocument(restore?: boolean): LazyMathDocument<N, T, D>;
        removeRenderAction(id: string): void;
        render(): LazyMathDocument<N, T, D>;
        renderPromise(): Promise<any>;
        rerender(start?: number): LazyMathDocument<N, T, D>;
        rerenderPromise(start?: number): Promise<any>;
        reset(options?: ResetList): LazyMathDocument<N, T, D>;
        savePromise(promise: Promise<any>): void;
        state(state: number, restore?: boolean): LazyMathDocument<N, T, D>;
        typeset(): LazyMathDocument<N, T, D>;
        typesetError(math: MathItem<N, T, D>, err: Error): void;
        updateDocument(): LazyMathDocument<N, T, D>;
        whenReady(action: () => any): Promise<any>;
    }

    Type Parameters

    • N

      The HTMLElement node class

    • T

      The Text node class

    • D

      The Document class

    Hierarchy (View Summary)

    Index

    Properties

    _actionPromises: Promise<void>[]

    The render action promise list

    _readyPromise: Promise<any>

    Promise for the current typeset or conversion action (used to chain the promise-based calls so they don't overlap).

    adaptor: DOMAdaptor<N, T, D>

    The DOM adaptor for the document

    document: D

    The document managed by this MathDocument

    domStrings: HTMLDomStrings<N, T, D>

    The DomString parser for locating the text in DOM trees

    inputJax: InputJax<N, T, D>[]

    The list of input jax for the document

    lazyAlwaysContainers: N[]

    The containers whose contents should always be typeset

    lazyList: LazyList<N, T, D>

    The mapping of markers to MathItems

    lazyObserver: IntersectionObserver

    The Intersection Observer used to track the appearance of the expression markers

    math: MathList<N, T, D>

    The list of MathItems for this document

    mmlFactory: MmlFactory

    The MathML node factory for the internal MathML representation

    options: OptionList

    The actual options for this document (with user-supplied ones merged in)

    outputJax: OutputJax<N, T, D>

    The output jax for the document

    processed: BitField

    The bit-field used to tell what steps have been taken on the document (for retries)

    renderActions: RenderList<N, T, D>

    The list of render actions

    styles: StyleJson[]

    Extra styles to be included in the document's stylesheet (added by extensions)

    Accessors

    Methods

    • Find math within the document: Get the list of containers (default is document.body), and for each: For each input jax: Make a new MathList to store the located math If the input jax processes strings: If we haven't already made the string array and corresponding node list, do so Ask the jax to find the math in the string array, and for each one, push it onto the math list Otherwise (the jax processes DOM nodes): Ask the jax to find the math in the container, and for each one, make the result into a MathItem, and push it on the list Merge the new math list into the document's math list (we use merge to maintain a sorted list of MathItems)

      Parameters

      Returns LazyMathDocument<N, T, D>

    • Creates a Location object for a delimiter at the position given by index in the N's string of the array of strings searched for math, recovering the original DOM node where the delimiter was found.

      Parameters

      • N: number

        The index of the string in the string array

      • index: number

        The position within the N's string that needs to be found

      • delim: string

        The delimiter for this position

      • nodes: HTMLNodeArray<N, T>

        The list of node lists representing the string array

      Returns Location<N, T>

      The Location object for the position of the delimiter in the document

    • A function that will typeset all the remaining expressions (e.g., for printing)

      Returns Promise<void>