import { ColumnInfo } from './column'; import { Hooks } from './hooks'; import { RelationshipInfo } from './relationships'; export declare const modelInfoKey: unique symbol; export interface ModelCtor { new (): T; } export interface IndexInfo { name: string; keys: string[]; options?: { multi?: boolean; geo?: boolean; }; } export interface ModelInfo { database: string; table: string; columns: ColumnInfo[]; indexes: IndexInfo[]; primaryKey: string; tags: Map>; relationships: RelationshipInfo[]; } export declare function createModelInfo(target: ModelCtor, ...objs: Partial[]): ModelInfo; /** * Model decorator */ export declare function Model(info: Partial): ClassDecorator; export declare namespace Model { function construct(ctor: ModelCtor, data: Partial): M; function assign(model: M, ...sources: Partial[]): M; function pickAssign(model: M, tagsOrKeys: string[] | string, ...sources: Partial[]): M; function pick(model: M, ...tagsOrKeys: string[]): Partial; function without(model: M, ...tagsOrKeys: string[]): Partial; function getInfo(ctor: ModelCtor): ModelInfo; function notify(model: any, hook: Hooks, ...args: any[]): any; }