SPeCS Packages Documentation
    Preparing search index...

    Interface Builder<D2, S2, D1, S1>

    Represents a builder class instance for a node type. For example, an instance of BaseNode.Builder is a Node.Builder.

    The builder class may have a constructor and methods to customize the information that is stored in the node.

    interface Builder<
        D2 extends BaseNode.Data,
        S2 extends BaseNode.ScratchData,
        D1 extends BaseNode.Data = BaseNode.Data,
        S1 extends BaseNode.ScratchData = BaseNode.ScratchData,
    > {
        buildData: (data: D1) => D2;
        buildScratchData: (scratchData: S1) => S2;
    }

    Type Parameters

    Implemented by

    Index

    Properties

    buildData: (data: D1) => D2

    Adds data to the data object of the node.

    Type Declaration

      • (data: D1): D2
      • Parameters

        • data: D1

          The current data object of the node.

        Returns D2

        The data object to be stored in the node.

    buildScratchData: (scratchData: S1) => S2

    Adds data to the scratch data object of the node.

    Type Declaration

      • (scratchData: S1): S2
      • Parameters

        • scratchData: S1

          The current scratch data object of the node.

        Returns S2

        The scratch data object to be stored in the node.