Class TemplateRegistry

Hierarchy

  • TemplateRegistry

Constructors

Properties

classTemplates: Map<ClassType<any>, Template<any>[]> = ...
decorator: TemplateDecorator[] = []
id: number = ...
postHooks: TemplateHook[] = []
preHooks: TemplateHook[] = []
serializer: Serializer = ...
templates: {
    0: undefined | Template<any>[];
    1: undefined | Template<any>[];
    10: undefined | Template<any>[];
    11: undefined | Template<any>[];
    12: undefined | Template<any>[];
    13: undefined | Template<any>[];
    14: undefined | Template<any>[];
    15: undefined | Template<any>[];
    16: undefined | Template<any>[];
    17: undefined | Template<any>[];
    18: undefined | Template<any>[];
    19: undefined | Template<any>[];
    2: undefined | Template<any>[];
    20: undefined | Template<any>[];
    21: undefined | Template<any>[];
    22: undefined | Template<any>[];
    23: undefined | Template<any>[];
    24: undefined | Template<any>[];
    25: undefined | Template<any>[];
    26: undefined | Template<any>[];
    27: undefined | Template<any>[];
    28: undefined | Template<any>[];
    29: undefined | Template<any>[];
    3: undefined | Template<any>[];
    30: undefined | Template<any>[];
    31: undefined | Template<any>[];
    32: undefined | Template<any>[];
    33: undefined | Template<any>[];
    34: undefined | Template<any>[];
    4: undefined | Template<any>[];
    5: undefined | Template<any>[];
    6: undefined | Template<any>[];
    7: undefined | Template<any>[];
    8: undefined | Template<any>[];
    9: undefined | Template<any>[];
} = {}

Type declaration

ids: number = 0

Methods

  • Registers additional templates that handle type decorators/annotations. The templates can safely assume that the given type in state.accessor is already type-checked to be T.

    Decorator templates run last (after normal templates and postHook).

    This split between register and registerForDecorator is made to have a distinction between native type templates and additional user-made templates. This allows to fetch only decorator templates and decide upon the result whether additional code is necessary or not. (this would not be possible if everything is added to the register call that does always the basic checks).

    Parameters

    • predicate: ((type: Type) => boolean)
        • (type: Type): boolean
        • Parameters

          Returns boolean

    • template: Template<Type>

    Returns void

  • Registers a template for a given class type.

    As soon as a single template has registered for the given classType the template registry only returns templates for this particular classType and omits all general purpose ReflectionKind.class templates for this particular classType.

    Parameters

    Returns void

Generated using TypeDoc