Class UcdCompiler<TModels>

Compiler of schema deserializers.

Type Parameters

Hierarchy

Implements

Constructors

Accessors

  • get currentEntry(): undefined | string
  • Currently processed schema entry. This may be e.g. a serializer or deserializer name.

    undefined when processing nested schema. This happens e.g. when model processed explicitly rather automatically.

    Returns undefined | string

Methods

  • Generates serialization code and evaluates it.

    Parameters

    • options: EsEvaluationOptions = {}

      Code evaluation options.

    • Rest ...snippets: EsSnippet[]

      Additional code snippets.

      Rest

    Returns Promise<UcdExports<TModels>>

    Promise resolved to deserializers exported from generated module.

  • Generates deserialization code.

    Parameters

    • options: EsGenerationOptions = {}

      Code generation options.

    • Rest ...snippets: EsSnippet[]

      Additional code snippets.

      Rest

    Returns Promise<string>

    Promise resolved to deserializer module text.

  • Requests the given attribute value to be parsed with the given schema.

    Type Parameters

    Parameters

    • attribute: string

      Target attribute.

    • schema: TSchema

      Attribute value schema.

    • set: ((this, args, context) => EsSnippet) = ...

      Emits code for attribute value assignment.

      By default, attribute will be added to metadata.

        • (this, args, context): EsSnippet
        • Parameters

          • this: void
          • args: {
                cx: EsSnippet;
                rx: EsSnippet;
                value: EsSnippet;
            }
            • Readonly cx: EsSnippet
            • Readonly rx: EsSnippet
            • Readonly value: EsSnippet
          • context: EsDeclarationContext

          Returns EsSnippet

    Returns UcdCompiler<TModels>

    this instance.

Generated using TypeDoc