@mathjax/src
    Preparing search index...

    Interface WrapperFactory<N, C, WW, WC>

    The generic WrapperFactory class

    interface WrapperFactory<
        N extends Node<N, C>,
        C extends NodeClass<N, C>,
        WW extends Wrapper<N, C, WW>,
        WC extends WrapperClass<N, C, WW>,
    > {
        create(kind: string): WW;
        deleteNodeClass(kind: string): void;
        getKinds(): string[];
        getNodeClass(kind: string): WC;
        nodeIsKind(node: WW, kind: string): boolean;
        setNodeClass(kind: string, nodeClass: WC): void;
        wrap<TT extends Wrapper<N, C, WW> = WW>(node: N, ...args: any[]): TT;
    }

    Type Parameters

    • N extends Node<N, C>

      The Node type being created by the factory

    • C extends NodeClass<N, C>

      The NodeClass for the nodes being created

    • WW extends Wrapper<N, C, WW>

      The Wrapper type being produced (instance type)

    • WC extends WrapperClass<N, C, WW>

      The Wrapper class (for static values)

    Hierarchy (View Summary)

    Implemented by

    Index

    Methods

    • Parameters

      • node: WW

        The node to test if it is of a given kind

      • kind: string

        The kind to test for

      Returns boolean

      True if the node is of the given kind, false otherwise

    • Defines a class for a given node kind

      Parameters

      • kind: string

        The kind whose class is being defined

      • nodeClass: WC

        The class for the given kind

      Returns void

    • Type Parameters

      • TT extends Wrapper<N, C, WW> = WW

        The type to use for the wrappedd node

      Parameters

      • node: N

        The node to be wrapped

      • ...args: any[]

        Any additional arguments needed when wrapping the node

      Returns TT

      The newly wrapped node