import { ReferenceField } from './fields'; import { BaseRelationField } from './fields/base_relation'; export interface ModelMeta { [key: string]: any; } export interface InstanceMeta { collectionsAttached: boolean; [key: string]: any; } export type AnyObject = { [key: string]: any; }; export type AnyModel = Model; export type ModelDataType = T extends Model ? U & { id: number; } : never; export declare const ModelMetaSym: unique symbol; export declare class Model { static model_name: string; constructor(data?: T, meta?: Partial); readonly _meta: InstanceMeta; private _parentCollection; get parentCollection(): any; private fieldDescriptions; private collectionDescs; attachToCollections(force?: boolean): void; detachFromCollections(): void; allowCollectionAttachment(collection?: BaseRelationField): boolean; protected attachmentChanged(collName: string, collDesc: ReferenceField, oldCollection: any): void; protected _savedState: any; get savedState(): Partial; serialize(): {}; deserialize(data: T): void; /** * Generates a snapshot of this object. * Default implementation is an alias to serialize() */ protected generateSnapshot(): {}; /** * Restores this object to a previous state. * Default implementation is an alias to deserialize() */ protected restoreSnapshot(initialState: any): void; protected withTransaction(func: () => any): Promise; get _model(): typeof Model; static get _fields(): unknown; static get _meta(): unknown; static getField(name: string): any; }