JsonEntityStore
@tsed/schema
Usage
typescript
import { JsonEntityStore } from "@tsed/schema";
See /packages/specs/schema/src/types/domain/JsonEntityStore.ts.
Overview
ts
abstract class JsonEntityStore implements JsonEntityStoreOptions {
readonly propertyKey: string | symbol;
readonly propertyName: string;
readonly index: number;
readonly descriptor: PropertyDescriptor;
readonly decoratorType: DecoratorTypes;
collectionType: Type<any>;
token: Type<any>;
readonly store: Store;
readonly isStore = true;
readonly parent: JsonEntityStore;
readonly target: Type<any>;
protected _type: Type<any>;
protected _schema: JsonSchema;
[key: string]: any;
constructor(options: JsonEntityStoreOptions);
get targetName(): string;
get isCollection(): boolean;
get isArray(): boolean;
get discriminatorAncestor(): JsonEntityStore | undefined;
get isPrimitive(): boolean;
get isDate(): boolean;
get isObject(): boolean;
get isClass(): boolean;
get schema(): JsonSchema;
get nestedGenerics(): Type<any>[][];
set nestedGenerics(nestedGenerics: Type<any>[][]);
get type(): Type<any> | any;
set type(value: Type<any> | any);
get computedType(): any;
get itemSchema(): JsonSchema;
get parentSchema(): JsonSchema;
get isDiscriminatorChild(): boolean;
static from<T extends JsonClassStore = JsonClassStore>(target: Type<any>): T;
static from<T extends JsonPropertyStore = JsonPropertyStore>(target: Type<any> | any, propertyKey: string | symbol): T;
static from<T extends JsonParameterStore = JsonParameterStore>(target: Type<any> | any, propertyKey: string | symbol, index: number): T;
static from<T extends JsonMethodStore = JsonMethodStore>(target: Type<any> | any, propertyKey: string | symbol, descriptor: PropertyDescriptor): T;
static from<T extends JsonEntityStore = JsonEntityStore>(...args: any[]): T;
static fromMethod<T extends JsonMethodStore = JsonMethodStore>(target: any, propertyKey: string | symbol): T;
static get(target: Type<any>, propertyKey: string | symbol, descriptor?: any): JsonEntityStore;
isGetterOnly(): boolean | undefined;
get<T = any>(key: string, defaultValue?: any): T;
set(key: string, value?: any): Store;
toString(): string;
protected abstract build(): void;
protected buildType(type: any): void;
getBestType(): any;
}
readonly propertyKey
ts
readonly propertyKey: string | symbol;
Original property key decorated by the decorator
readonly propertyName
ts
readonly propertyName: string;
Alias of the property
readonly index
ts
readonly index: number;
Parameter index
readonly descriptor
ts
readonly descriptor: PropertyDescriptor;
Method's descriptor
readonly decoratorType
ts
readonly decoratorType: DecoratorTypes;
Decorator type used to the JsonSchemaStore.
collectionType
ts
collectionType: Type<any>;
Type of the collection (Array, Map, Set, etc...)
token
ts
token: Type<any>;
readonly store
ts
readonly store: Store;
readonly isStore
ts
readonly isStore = true;
readonly parent
ts
readonly parent: JsonEntityStore;
readonly target
ts
readonly target: Type<any>;
protected _type
ts
protected _type: Type<any>;
protected _schema
ts
protected _schema: JsonSchema;
Ref to JsonSchema
[key: string]
ts
[key: string]: any;
get targetName
ts
get targetName(): string;
Return the class name of the entity.
get isCollection
ts
get isCollection(): boolean;
get isArray
ts
get isArray(): boolean;
get discriminatorAncestor
ts
get discriminatorAncestor(): JsonEntityStore | undefined;
get isPrimitive
ts
get isPrimitive(): boolean;
get isDate
ts
get isDate(): boolean;
get isObject
ts
get isObject(): boolean;
get isClass
ts
get isClass(): boolean;
get schema
ts
get schema(): JsonSchema;
Return the JsonSchema
get nestedGenerics
ts
get nestedGenerics(): Type<any>[][];
set nestedGenerics
ts
set nestedGenerics(nestedGenerics: Type<any>[][]);
get type
ts
get type(): Type<any> | any;
set type
ts
set type(value: Type<any> | any);
Get original type without transformation
get computedType
ts
get computedType(): any;
Return the itemSchema computed type. if the type is a function used for recursive model, the function will be called to get the right type.
get itemSchema
ts
get itemSchema(): JsonSchema;
get parentSchema
ts
get parentSchema(): JsonSchema;
get isDiscriminatorChild
ts
get isDiscriminatorChild(): boolean;
static from
ts
static from<T extends JsonClassStore = JsonClassStore>(target: Type<any>): T;
static from
ts
static from<T extends JsonPropertyStore = JsonPropertyStore>(target: Type<any> | any, propertyKey: string | symbol): T;
static from
ts
static from<T extends JsonParameterStore = JsonParameterStore>(target: Type<any> | any, propertyKey: string | symbol, index: number): T;
static from
ts
static from<T extends JsonMethodStore = JsonMethodStore>(target: Type<any> | any, propertyKey: string | symbol, descriptor: PropertyDescriptor): T;
static from
ts
static from<T extends JsonEntityStore = JsonEntityStore>(...args: any[]): T;
static fromMethod
ts
static fromMethod<T extends JsonMethodStore = JsonMethodStore>(target: any, propertyKey: string | symbol): T;
static get
ts
static get(target: Type<any>, propertyKey: string | symbol, descriptor?: any): JsonEntityStore;
isGetterOnly
ts
isGetterOnly(): boolean | undefined;
get
ts
get<T = any>(key: string, defaultValue?: any): T;
set
ts
set(key: string, value?: any): Store;
toString
ts
toString(): string;
protected abstract build
ts
protected abstract build(): void;
protected buildType
ts
protected buildType(type: any): void;
getBestType
ts
getBestType(): any;