import { Entity, EntityConstructor } from '../entity'; import { ConnectOptions } from '../../core'; import { DbContextMetadata } from '../metadata'; import { DbContextConstructor } from '../db-context'; import 'reflect-metadata'; import { UuidConstructor } from '../../core/sql'; /** * 上下文选项 */ export declare type DbContextOptions = Partial> & { globalKeyName?: string; globalKeyType?: StringConstructor | NumberConstructor | UuidConstructor | BigIntConstructor; }; /** * 为Entity绑定DbContext */ export declare function context(getter: () => DbContextConstructor): (target: EntityConstructor) => void; export declare function getContextOptions(target: DbContextConstructor): DbContextOptions | undefined; export declare function getDecorateContexts(): DbContextConstructor[] | undefined; export declare function getConnectionOptions(target: DbContextConstructor): ConnectOptions | undefined; export declare function connection(connectionString: string): (constructor: DbContextConstructor) => void; export declare function connection(config: ConnectOptions): (constructor: DbContextConstructor) => void; export declare function database(name: string): (constructor: DbContextConstructor) => void; /** * 声明全局主键 */ export declare function globalKey(name: string, type: StringConstructor | NumberConstructor | UuidConstructor | BigIntConstructor): (constructor: DbContextConstructor) => void;