import { AnyDataModel } from '../dataModel/BaseDataModel'; import { AnyModel } from '../model/BaseModel'; import { modelTypeKey } from '../model/metadata'; import { Flatten, IsNeverType } from '../utils/types'; import { ModelPropsToSnapshotCreationData, ModelPropsToSnapshotData, ModelPropsToTransformedCreationData, ModelPropsToTransformedData, ModelPropsToUntransformedCreationData } from './prop'; /** * @ignore */ export declare const propsTypeSymbol: unique symbol; /** * @ignore */ export declare const fromSnapshotOverrideTypeSymbol: unique symbol; /** * @ignore */ export declare const toSnapshotOverrideTypeSymbol: unique symbol; /** * Extracts the instance type of a model class. */ export interface ModelClass { new (initialData: any): M; fromSnapshotProcessor?: (sn: any) => any; toSnapshotProcessor?: (sn: any, modelInstance: any) => any; } /** * Extracts the instance type of an abstract model class. */ export type AbstractModelClass = abstract new (initialData: any) => M; /** * The props of a model. */ export type ModelPropsOf = M[typeof propsTypeSymbol]; /** * The data type of a model, without transformations applied. */ export type ModelUntransformedData = Flatten; /** * The creation data type of a model, without transformations applied. */ export type ModelUntransformedCreationData = ModelPropsToUntransformedCreationData>; /** * The data type of a model, with transformations applied. */ export type ModelData = ModelPropsToTransformedData>; /** * The creation data type of a model, with transformations applied. */ export type ModelCreationData = ModelPropsToTransformedCreationData>; /** * The from snapshot type of a model. * * @deprecated Use SnapshotInOf instead. */ export type ModelFromSnapshot = IsNeverType>, M[typeof fromSnapshotOverrideTypeSymbol]> & { [modelTypeKey]?: string; }; /** * The to snapshot type of a model. * * @deprecated Use SnapshotOutOf instead. */ export type ModelToSnapshot = IsNeverType>, M[typeof toSnapshotOverrideTypeSymbol]> & { [modelTypeKey]?: string; }; /** * Tricks TypeScript into accepting a particular kind of generic class as a parameter for `ExtendedModel`. * Does nothing in runtime. * * @template T Generic model class type. * @param type Generic model class. * @returns */ export declare function modelClass(type: { prototype: T; }): ModelClass;