import Collection from './Collection'; /** * An index on a given field. */ export interface Index { fieldName: string; unique: boolean; sparse: boolean; } /** * The model for a given collection. */ export default interface Model { /** * Indices to be built for this data model. */ indices: Index[]; /** * Called each time the database is started. */ init(): Promise; } /** * The model type, i.e. Model constructor. */ export declare type ModelType = new (db: Collection) => Model; /** * A list of the models used with this database. */ export interface ModelList { [key: string]: Model; } /** * A list of the models type used with this database. */ export declare type ModelTypeList = { [K in keyof T]: ModelType; };