Skip to main content

MatchingAnchor <S>

An anchor found by schema, paired with the translation needed to read it as that schema.

AModel.getAnchorsMatchingSchema returns these rather than raw anchors: the anchor you matched may have been declared against a different version of the schema, and this is what keeps that difference out of your module. Read it with getSchemaInstance().

@group

Types

Index

Constructors

constructor

  • Type parameters

    Parameters

    • actual: AAnchor<S, any>

      The anchor that was matched.

    • optionalschemaTranslator: (synth: any) => S

      Reads actual as the matched schema, when the two differ.

      Returns MatchingAnchor<S>

    Methods

    getActual

    • getActual(): AAnchor<Omit<S, properties> & { properties: Record<never, never> }, any>

    getSchemaInstance

    • getSchemaInstance(): S
    • The anchor read as the schema you matched on.


      Returns S

    hasSchemaTranslator

    • hasSchemaTranslator(): boolean
    • Whether the match went through a schema translation.


      Returns boolean