Class TemplateState

Hierarchy

  • TemplateState

Constructors

Properties

accessor: string | ContainerAccessor = ''
allSpecificalities?: TypeGuardRegistry

When this is set all specificalities are used (used in union type guards to detect which member to pick).

compilerContext: CompilerContext
ended: boolean = false
handledAnnotations: AnnotationDefinition<true>[] = []
jitStack: JitStack = ...
namingStrategy: NamingStrategy = ...
originalAccessor: string | ContainerAccessor
originalSetter: string | ContainerAccessor
path: (string | RuntimeCode)[] = []
propertyName?: string | RuntimeCode
setter: string | ContainerAccessor = ''
setterDisabled: boolean = false
target: "serialize" | "deserialize" = 'serialize'
template: string = ''

Before and after template content is rendered before/after all other templates. When a template is put into its own function, before/after templates are run outside of this function.

validation?: "strict" | "loose"

Strict means only use type guards of specificality of 1 (used for is()/validation()). For deserialization loose is used.

Accessors

Methods

  • Adds template code for setting the this.setter variable manually, so use ${state.setter} = value. this.accessor will point now to this.setter.

    Parameters

    • code: string

    Returns void

  • Adds template code for setting the this.setter variable. The expression evaluated in code is assigned to this.setter. this.accessor will point now to this.setter.

    Parameters

    • code: string | {
          toString: any;
      }

    Returns void

  • Parameters

    • errorCode: string
    • message: string
    • code: string

    Returns void

  • Can be used to track which annotation was already handled. Necessary to use with isAnnotationHandled to avoid infinite recursive loops when a serializer template issues sub calls depending on annotation data.

    Parameters

    Returns void

  • Parameters

    • values: {
          [name: string]: any;
      }
      • [name: string]: any

    Returns void

Generated using TypeDoc