Class ModelVariantTraversal<S>Abstract

Visits multiple model hierarchies simultaneously and builds state.

Type Parameters

  • S = void

Constructors

  • Create a new visitor. Must list the valid names of sources. The order of this list implies the priority used for choosing a name when multiple model variants have different names.

    Type Parameters

    • S = void

    Parameters

    • revision: `${number}.${number}`
    • sourceNames: string[]

    Returns ModelVariantTraversal<S>

Properties

clusterState: undefined | ClusterState

Methods

  • Determine if we are entering a cluster and install cluster state if so.

    Parameters

    Returns boolean

  • Get the canonical name for a model. Within cluster scope alternate names may be selected, otherwise the name of the model is returned.

    Parameters

    Returns string

  • Initiate traversal. The class is stateful so this call should not be invoked while traversal is ongoing.

    Parameters

    Returns S

  • This is the primary callback. It is invoked for every set of variants during traversal. It may optionally return state that is returned from traverse().

    Parameters

    • variants: VariantDetail

      the set of equivalent models

    • recurse: (() => S[])

      call this function to recurse into variant children

        • (): S[]
        • Returns S[]

    Returns S