# Entity Class
Module | import { Entity } from "@tsed/core" |
---|---|
Source | /packages/core/src/class/Entity.ts |
# Overview
abstract class Entity {
/**
* Original property key decorated by the decorator
*/
readonly propertyKey: string | symbol;
/**
* Alias of the property
*/
readonly propertyName: string;
/**
* Parameter index
*/
readonly index: number;
/**
* Method's descriptor
*/
readonly descriptor: number;
/**
* Decorator type used to the JsonSchemaStore.
*/
readonly decoratorType: DecoratorTypes;
/**
* Type of the collection (Array, Map, Set, etc...)
*/
collectionType: Type<any>;
token: Type<any>;
/**
*
*/
protected _type: Type<any>;
protected _target: Type<any>;
protected constructor({ target, propertyKey, descriptor, index }: EntityOptions);
/**
* Reference to the class
*/
get target(): Type<any>;
/**
* Return the class name of the entity.
* @returns {string}
*/
get targetName(): string;
/**
* Return the collection name
* @returns {string}
* @todo should not be use in final API
*/
get collectionName(): string;
/**
*
* @returns {Type<any>}
*/
get type(): Type<any> | any;
/**
* Get original type without transformation
* @param value
*/
set type(value: Type<any> | any);
/**
* Return target type name
* @returns {string}
* @todo should not be use in final API
*/
get typeName(): string;
/**
* Return the itemSchema target type. if the type is a function used for recursive model, the function will be called to
* get the right type.
*/
get computedType(): Type<any>;
/**
*
* @returns {boolean}
*/
get isCollection(): boolean;
/**
*
* @returns {boolean}
*/
get isArray(): boolean;
/**
*
* @returns {boolean}
*/
get isPrimitive(): boolean;
/**
*
* @returns {boolean}
*/
get isDate(): boolean;
/**
*
* @returns {boolean}
*/
get isObject(): boolean;
/**
*
*/
get isClass(): boolean;
}
# Members
readonly propertyKey: string | symbol;
Original property key decorated by the decorator
readonly propertyName: string;
Alias of the property
readonly index: number;
Parameter index
readonly descriptor: number;
Method's descriptor
readonly decoratorType: DecoratorTypes;
Decorator type used to the JsonSchemaStore.
collectionType: Type<any>;
Type of the collection (Array, Map, Set, etc...)
token: Type<any>;
protected _type: Type<any>;
protected _target: Type<any>;
get target(): Type<any>;
Reference to the class
get targetName(): string;
Return the class name of the entity.
get collectionName(): string;
Return the collection name
get type(): Type<any> | any;
set type(value: Type<any> | any);
Get original type without transformation
get typeName(): string;
Return target type name
get computedType(): Type<any>;
Return the itemSchema target type. if the type is a function used for recursive model, the function will be called to get the right type.
get isCollection(): boolean;
get isArray(): boolean;
get isPrimitive(): boolean;
get isDate(): boolean;
get isObject(): boolean;
get isClass(): boolean;
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Jest
- Seq
- Controllers
- Providers
- Model
- Converters
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing