@mathjax/src
    Preparing search index...

    Interface NodeFactory<N, C>

    The NodeFactory interface

    interface NodeFactory<N extends Node<N, C>, C extends FactoryNodeClass<N>> {
        create(kind: string, properties?: PropertyList, children?: N[]): N;
        deleteNodeClass(kind: string): void;
        getKinds(): string[];
        getNodeClass(kind: string): C;
        nodeIsKind(node: N, kind: string): boolean;
        setNodeClass(kind: string, nodeClass: C): void;
    }

    Type Parameters

    • N extends Node<N, C>

      The node type created by the factory

    • C extends FactoryNodeClass<N>

      The class of the node being constructed (for access to static properties)

    Hierarchy (View Summary)

    Index

    Methods

    • Parameters

      • kind: string

        The kind of node to create

      • Optionalproperties: PropertyList

        The list of initial properties for the node (if any)

      • Optionalchildren: N[]

        The array of initial child nodes (if any)

      Returns N

      The newly created node of the given kind

    • Parameters

      • node: N

        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: C

        The class for the given kind

      Returns void