Hyperlinkv0.8.0-beta.28

SchemaAST

SchemaAST.Linkclasseffect/SchemaAST.ts:402
Link

Represents a single step in an Encoding chain.

Details

A link pairs a target AST with a Transformation or Middleware that converts values between the current node and the target.

  • to — the AST node on the other side of this transformation step.
  • transformation — the bidirectional conversion logic (decode/encode).

Links are composed into a non-empty array (Encoding) attached to AST nodes that have a different encoded representation.

export class Link {
  readonly to: AST
  readonly transformation:
    | SchemaTransformation.Transformation<any, any, any, any>
    | SchemaTransformation.Middleware<any, any, any, any, any, any>

  constructor(
    to: AST,
    transformation:
      | SchemaTransformation.Transformation<any, any, any, any>
      | SchemaTransformation.Middleware<any, any, any, any, any, any>
  ) {
    this.to = to
    this.transformation = transformation
  }
}
Referenced by 6 symbols