lakutata
Version:
An IoC-based universal application framework.
158 lines (146 loc) • 8.46 kB
TypeScript
import { SimpleColumnType, SpatialColumnType, WithLengthColumnType, WithWidthColumnType, WithPrecisionColumnType, ColumnType } from './TypeDef.internal.44.js';
import { ColumnOptions, ColumnCommonOptions, SpatialColumnOptions, ColumnWithLengthOptions, ColumnWithWidthOptions, ColumnNumericOptions, ColumnEnumOptions, ColumnHstoreOptions, ColumnEmbeddedOptions, PrimaryGeneratedColumnNumericOptions, PrimaryGeneratedColumnUUIDOptions, PrimaryGeneratedColumnIdentityOptions, VirtualColumnOptions, ViewColumnOptions } from './TypeDef.internal.68.js';
/**
* Column decorator is used to mark a specific class property as a table column. Only properties decorated with this
* decorator will be persisted to the database when entity be saved.
*/
declare function Column(): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
*/
declare function Column(options: ColumnOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
*/
declare function Column(type: SimpleColumnType, options?: ColumnCommonOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
*/
declare function Column(type: SpatialColumnType, options?: ColumnCommonOptions & SpatialColumnOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
*/
declare function Column(type: WithLengthColumnType, options?: ColumnCommonOptions & ColumnWithLengthOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
*/
declare function Column(type: WithWidthColumnType, options?: ColumnCommonOptions & ColumnWithWidthOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
*/
declare function Column(type: WithPrecisionColumnType, options?: ColumnCommonOptions & ColumnNumericOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
*/
declare function Column(type: "enum", options?: ColumnCommonOptions & ColumnEnumOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
*/
declare function Column(type: "simple-enum", options?: ColumnCommonOptions & ColumnEnumOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
*/
declare function Column(type: "set", options?: ColumnCommonOptions & ColumnEnumOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
*/
declare function Column(type: "hstore", options?: ColumnCommonOptions & ColumnHstoreOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
*
* Property in entity can be marked as Embedded, and on persist all columns from the embedded are mapped to the
* single table of the entity where Embedded is used. And on hydration all columns which supposed to be in the
* embedded will be mapped to it from the single table.
*/
declare function Column(type: (type?: any) => Function, options?: ColumnEmbeddedOptions): PropertyDecorator;
/**
* This column will store a creation date of the inserted object.
* Creation date is generated and inserted only once,
* at the first time when you create an object, the value is inserted into the table, and is never touched again.
*/
declare function CreateDateColumn(options?: ColumnOptions): PropertyDecorator;
/**
* This column will store a delete date of the soft-deleted object.
* This date is being updated each time you soft-delete the object.
*/
declare function DeleteDateColumn(options?: ColumnOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
*/
declare function PrimaryGeneratedColumn(): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
*/
declare function PrimaryGeneratedColumn(options: PrimaryGeneratedColumnNumericOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
*/
declare function PrimaryGeneratedColumn(strategy: "increment", options?: PrimaryGeneratedColumnNumericOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
*/
declare function PrimaryGeneratedColumn(strategy: "uuid", options?: PrimaryGeneratedColumnUUIDOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
*/
declare function PrimaryGeneratedColumn(strategy: "rowid", options?: PrimaryGeneratedColumnUUIDOptions): PropertyDecorator;
declare function PrimaryGeneratedColumn(strategy: "identity", options?: PrimaryGeneratedColumnIdentityOptions): PropertyDecorator;
/**
* Describes all primary key column's options.
* If specified, the nullable field must be set to false.
*/
type PrimaryColumnOptions = ColumnOptions & {
nullable?: false;
};
/**
* Column decorator is used to mark a specific class property as a table column.
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
* Primary columns also creates a PRIMARY KEY for this column in a db.
*/
declare function PrimaryColumn(options?: PrimaryColumnOptions): PropertyDecorator;
/**
* Column decorator is used to mark a specific class property as a table column.
* Only properties decorated with this decorator will be persisted to the database when entity be saved.
* Primary columns also creates a PRIMARY KEY for this column in a db.
*/
declare function PrimaryColumn(type?: ColumnType, options?: PrimaryColumnOptions): PropertyDecorator;
/**
* This column will store an update date of the updated object.
* This date is being updated each time you persist the object.
*/
declare function UpdateDateColumn(options?: ColumnOptions): PropertyDecorator;
/**
* This column will store a number - version of the entity.
* Every time your entity will be persisted, this number will be increased by one -
* so you can organize visioning and update strategies of your entity.
*/
declare function VersionColumn(options?: ColumnOptions): PropertyDecorator;
/**
* VirtualColumn decorator is used to mark a specific class property as a Virtual column.
*/
declare function VirtualColumn(options: VirtualColumnOptions): PropertyDecorator;
/**
* VirtualColumn decorator is used to mark a specific class property as a Virtual column.
*/
declare function VirtualColumn(typeOrOptions: ColumnType, options: VirtualColumnOptions): PropertyDecorator;
/**
* ViewColumn decorator is used to mark a specific class property as a view column.
*/
declare function ViewColumn(options?: ViewColumnOptions): PropertyDecorator;
/**
* Special type of column that is available only for MongoDB database.
* Marks your entity's column to be an object id.
*/
declare function ObjectIdColumn(options?: ColumnOptions): PropertyDecorator;
export { Column, CreateDateColumn, DeleteDateColumn, ObjectIdColumn, PrimaryColumn, PrimaryGeneratedColumn, UpdateDateColumn, VersionColumn, ViewColumn, VirtualColumn };