@openhps/core
    Preparing search index...

    Variable TypedJSONConst

    TypedJSON: {
        MapShape: any;
        JsonObjectMetadata: any;
        TypedJSON: any;
        AnyT: ConcreteTypeDescriptor;
        options: { mergeOptions: any };
        typeDescriptor: {
            ArrayTypeDescriptor: any;
            ensureTypeDescriptor: any;
            MapTypeDescriptor: any;
            SetTypeDescriptor: any;
        };
        utils: {
            isInstanceOf: any;
            isSubtypeOf: any;
            isValueDefined: any;
            nameof: any;
        };
        ArrayT(elementType: Typelike): ArrayTypeDescriptor;
        defaultTypeEmitter(
            targetObject: IndexedObject,
            sourceObject: IndexedObject,
            expectedSourceType: Function,
            sourceTypeMetadata?: JsonObjectMetadata,
        ): void;
        defaultTypeResolver(
            sourceObject: IndexedObject,
            knownTypes: Map<string, Function>,
        ): Function;
        jsonArrayMember(
            maybeTypeThunk: MaybeTypeThunk,
            options?: IJsonArrayMemberOptions,
        ): (target: Object, propKey: string | symbol) => void;
        jsonMapMember(
            maybeKeyThunk: MaybeTypeThunk,
            maybeValueThunk: MaybeTypeThunk,
            options?: IJsonMapMemberOptions,
        ): (target: Object, propKey: string | symbol) => void;
        jsonMember<T extends Function>(
            prototype: IndexedObject,
            propertyKey: string | symbol,
        ): void;
        jsonMember(options: IJsonMemberOptions): PropertyDecorator;
        jsonMember(
            type: MaybeTypeThunk,
            options?: IJsonMemberOptions,
        ): PropertyDecorator;
        jsonObject<T>(
            options?: IJsonObjectOptionsWithInitializer<T>,
        ): (target: Serializable<T>) => void;
        jsonObject<T>(
            options?: IJsonObjectOptions<T>,
        ): (target: Serializable<T>) => void;
        jsonObject<T>(target: Serializable<T>): void;
        jsonSetMember(
            maybeTypeThunk: MaybeTypeThunk,
            options?: IJsonSetMemberOptions,
        ): (target: Object, propKey: string | symbol) => void;
        MapT(
            keyType: Typelike,
            valueType: Typelike,
            options?: Partial<MapOptions>,
        ): MapTypeDescriptor;
        SetT(elementType: Typelike): SetTypeDescriptor;
        toJson<T extends Object>(target: Function): void;
        toJson<T extends Object>(
            options: IToJsonOptions,
        ): (target: Function) => void;
        ArrayTypeDescriptor: any;
        MapTypeDescriptor: any;
        SetTypeDescriptor: any;
    } = ...

    Type Declaration

    • AnyT: ConcreteTypeDescriptor
    • options: { mergeOptions: any }
    • typeDescriptor: {
          ArrayTypeDescriptor: any;
          ensureTypeDescriptor: any;
          MapTypeDescriptor: any;
          SetTypeDescriptor: any;
      }
    • utils: { isInstanceOf: any; isSubtypeOf: any; isValueDefined: any; nameof: any }
    • ArrayT: function
    • defaultTypeEmitter: function
    • defaultTypeResolver: function
      • Parameters

        Returns Function

    • jsonArrayMember: function
      • Specifies that a property, of type array, is part of an object when serializing.

        Parameters

        • maybeTypeThunk: MaybeTypeThunk

          Constructor of array elements (e.g. 'Number' for 'number[]', or 'Date' for 'Date[]').

        • Optionaloptions: IJsonArrayMemberOptions

          Additional options.

        Returns (target: Object, propKey: string | symbol) => void

    • jsonMapMember: function
      • Specifies that the property is part of the object when serializing. Use this decorator on properties of type Map<K, V>.

        Parameters

        • maybeKeyThunk: MaybeTypeThunk

          Constructor of map keys (e.g. 'Number' for 'Map<number, Date>').

        • maybeValueThunk: MaybeTypeThunk

          Constructor of map values (e.g. 'Date' for 'Map<number, Date>').

        • Optionaloptions: IJsonMapMemberOptions

          Additional options.

        Returns (target: Object, propKey: string | symbol) => void

    • jsonMember: function
      • Specifies that a property is part of the object when serializing. Requires ReflectDecorators.

        Type Parameters

        • T extends Function

        Parameters

        Returns void

      • Specifies that a property is part of the object when serializing, with additional options. Requires ReflectDecorators.

        Parameters

        • options: IJsonMemberOptions

        Returns PropertyDecorator

      • Specifies that a property is part of the object when serializing, with a defined type and extra options.

        Parameters

        • type: MaybeTypeThunk
        • Optionaloptions: IJsonMemberOptions

        Returns PropertyDecorator

    • jsonObject: function
      • Marks that a class with a parameterized constructor is serializable using TypedJSON, with additional settings. The 'initializer' setting must be specified.

        Type Parameters

        • T

        Parameters

        • Optionaloptions: IJsonObjectOptionsWithInitializer<T>

          Configuration settings.

        Returns (target: Serializable<T>) => void

      • Marks that a class is serializable using TypedJSON, with additional settings.

        Type Parameters

        • T

        Parameters

        • Optionaloptions: IJsonObjectOptions<T>

          Configuration settings.

        Returns (target: Serializable<T>) => void

      • Marks that a class with a parameterless constructor is serializable using TypedJSON.

        Type Parameters

        • T

        Parameters

        Returns void

    • jsonSetMember: function
      • Specifies that the property is part of the object when serializing. Use this decorator on properties of type Set.

        Parameters

        • maybeTypeThunk: MaybeTypeThunk

          Constructor of set elements (e.g. 'Number' for Set or 'Date' for Set).

        • Optionaloptions: IJsonSetMemberOptions

          Additional options.

        Returns (target: Object, propKey: string | symbol) => void

    • MapT: function
      • Parameters

        • keyType: Typelike
        • valueType: Typelike
        • Optionaloptions: Partial<MapOptions>

        Returns MapTypeDescriptor

    • SetT: function
      • Parameters

        • elementType: Typelike

        Returns SetTypeDescriptor

    • toJson: function
      • Decorator that will generate toJSON function on the class prototype that allows JSON.stringify to be used instead of TypedJSON.stringify. Under the hood it will simply delegate to TypedJSON. By default it will throw if the prototype already has a toJSON function defined.

        Type Parameters

        • T extends Object

        Parameters

        • target: Function

          the class which prototype should be modified.

        Returns void

      • Decorator factory that accepts the options interface.

        Type Parameters

        • T extends Object

        Parameters

        • options: IToJsonOptions

          for configuring the toJSON creation.

        Returns (target: Function) => void