@blockchaincommons/dcbor - v1.0.0-beta.1
    Preparing search index...

    Type Alias Visitor<State>

    Visitor: (
        element: WalkElement,
        level: number,
        edge: EdgeTypeVariant,
        state: State,
    ) => [State, boolean]

    Visitor function type.

    Type Parameters

    • State

      The type of state passed into each visit

    Type Declaration

      • (
            element: WalkElement,
            level: number,
            edge: EdgeTypeVariant,
            state: State,
        ): [State, boolean]
      • Parameters

        • element: WalkElement

          The element being visited

        • level: number

          The depth level in the tree (0 = root)

        • edge: EdgeTypeVariant

          Information about the edge leading to this element

        • state: State

          The state value cloned from the parent visit

        Returns [State, boolean]

        Tuple of [newState, stopDescent] where:

        • newState: The state to pass into descendants of this element. Each descendant receives an independent clone of newState; sibling subtrees do not see each other's mutations.
        • stopDescent: If true, do not descend into children of this element.