@mathjax/src
    Preparing search index...

    Interface MinHTMLAdaptor<N, T, D>

    The minimum needed for an HTML Adaptor

    interface MinHTMLAdaptor<N, T, D> {
        canMeasureNodes: boolean;
        document: D;
        addClass(node: N, name: string): void;
        allAttributes(node: N): AttributeData[];
        allClasses(node: N): string[];
        allStyles(node: N): string;
        append(node: N, child: N | T): N | T;
        body(doc?: D): N;
        childNode(node: N, i: number): N | T;
        childNodes(node: N): (N | T)[];
        clone(node: N, deep?: boolean): N;
        contains(container: N, node: N | T): boolean;
        createWorker(
            listener: (event: any) => void,
            options: OptionList,
        ): Promise<minWorker>;
        cssText(node: N): string;
        doctype(doc?: D): string;
        firstChild(node: N): N | T;
        fontFamily(node: N): string;
        fontSize(node: N): number;
        getAttribute(node: N, name: string): string;
        getElement(selector: string, node?: N | D): N;
        getElements(nodes: (string | N | N[])[], document: D): N[];
        getProperty(node: N, name: string): any;
        getStyle(node: N, name: string): string;
        hasAttribute(node: N, name: string): boolean;
        hasClass(node: N, name: string): boolean;
        head(doc?: D): N;
        innerHTML(node: N): string;
        insert(nchild: N | T, ochild: N | T): void;
        insertRules(node: N, rules: string[]): void;
        kind(node: N | T): string;
        lastChild(node: N): N | T;
        next(node: N | T): N | T;
        node(kind: string, def?: OptionList, children?: (N | T)[], ns?: string): N;
        nodeBBox(node: N): PageBBox;
        nodeSize(node: N, em?: number, local?: boolean): [number, number];
        outerHTML(node: N): string;
        parent(node: N | T): N;
        parse(text: string, format?: string): D;
        previous(node: N | T): N | T;
        remove(child: N | T): N | T;
        removeAttribute(node: N, name: string): void;
        removeClass(node: N, name: string): void;
        replace(nnode: N | T, onode: N | T): N | T;
        root(doc?: D): N;
        serializeXML(node: N): string;
        setAttribute(
            node: N,
            name: string,
            value: string | number,
            ns?: string,
        ): void;
        setAttributes(node: N, def: OptionList): void;
        setProperty(node: N, name: string, value: any): void;
        setStyle(node: N, name: string, value: string): void;
        split(node: T, n: number): T;
        tags(node: N, name: string, ns?: string): N[];
        text(text: string): T;
        textContent(node: N): string;
        value(node: N | T): string;
    }

    Type Parameters

    • N

      The HTMLElement node class

    • T

      The Text node class

    • D

      The Document class

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    canMeasureNodes: boolean

    True when the adaptor can measure DOM node sizes

    document: D

    Document in which the nodes are to be created

    Methods

    • Parameters

      • node: N

        The HTML node whose child is to be obtained

      • i: number

        The index of the child to return

      Returns N | T

      The i-th child node of the given node (or null)

    • Parameters

      • node: N

        The HTML node to be cloned

      • Optionaldeep: boolean

        True if children should be cloned

      Returns N

      The copied node

    • Determine if a container node contains a given node somewhere in its DOM tree

      Parameters

      • container: N

        The container to search

      • node: N | T

        The node to look for

      Returns boolean

      True if the node is in the container's DOM tree

    • Parameters

      • node: N

        The HTML node whose attribute is to be obtained

      • name: string

        The name of the attribute to get

      Returns string

      The value of the given attribute of the given node

    • Get an element specified by CSS selector.

      Parameters

      • selector: string

        The selector to locate

      • Optionalnode: N | D

        The document or element in which to search

      Returns N

      The first matching element

    • Get a list of containers (to be searched for math). These can be specified by CSS selector, or as actual DOM elements or arrays of such.

      Parameters

      • nodes: (string | N | N[])[]

        The array of items to make into a container list

      • document: D

        The document in which to search

      Returns N[]

      The array of containers to search

    • Parameters

      • node: N

        The HTML node whose property is to be retrieved

      • name: string

        The property to get

      Returns any

      The property's value

    • Parameters

      • node: N

        The HTML node whose style is to be obtained

      • name: string

        The style to be obtained

      Returns string

      The value of the style

    • Parameters

      • node: N

        The HTML node whose attribute is to be tested

      • name: string

        The name of the attribute to test

      Returns boolean

      True of the node has the given attribute defined

    • Parameters

      • node: N

        The HTML node whose class is to be tested

      • name: string

        The class to test

      Returns boolean

      True if the node has the given class

    • Parameters

      • nchild: N | T

        The node or text to be inserted

      • ochild: N | T

        The node or text where the new child is to be added before it

      Returns void

    • Parameters

      • node: N

        The stylesheet node where the rule will be added

      • rules: string[]

        The rule to add at the beginning of the stylesheet

      Returns void

    • Parameters

      • node: N | T

        The HTML node whose tag or node name is to be obtained

      Returns string

      The tag or node name of the given node

    • Parameters

      • kind: string

        The tag name of the HTML node to be created

      • Optionaldef: OptionList

        The properties to set for the created node

      • Optionalchildren: (N | T)[]

        The child nodes for the created HTML node

      • Optionalns: string

        The namespace in which to create the node

      Returns N

      The generated HTML tree

    • Parameters

      • node: N

        The HTML node whose dimensions are to be determined

      • Optionalem: number

        The number of pixels in an em

      • Optionallocal: boolean

        True if local coordinates are to be used in SVG elements

      Returns [number, number]

      The width and height (in ems) of the element

    • Parameters

      • text: string

        The serialized document to be parsed

      • Optionalformat: string

        The format (e.g., 'text/html' or 'text/xhtml')

      Returns D

      The parsed document

    • Parameters

      • node: N

        The HTML node whose attribute is to be set

      • name: string

        The name of the attribute to set

      • value: string | number

        The new value of the attribute

      • Optionalns: string

        The namespace to use for the attribute

      Returns void

    • Parameters

      • node: N

        The HTML node whose property is to be set

      • name: string

        The property to set

      • value: any

        The property's new value

      Returns void

    • Parameters

      • node: N

        The HTML node whose style is to be changed

      • name: string

        The style to be set

      • value: string

        The new value of the style

      Returns void

    • Parameters

      • node: N

        The node to search for tags

      • name: string

        The name of the tag to search for

      • Optionalns: string

        The namespace to search in (or null for no namespace)

      Returns N[]

      The list of tags found

    • Parameters

      • text: string

        The text from which to create an HTML text node

      Returns T

      The generated text node with the given text