import { Db, Collection, CollectionCreateOptions } from "mongodb"; import { MongoCollection } from "./MongoCollection"; export declare enum ERelationType { None = 0, SingleObjectId = 1, ArrayObjectId = 2 } export interface IFieldOptions { required?: boolean; unique?: boolean; hidden?: boolean; foreignField?: string; autoPopulate?: boolean; relationType?: ERelationType; override?: Function; type?: any; index?: -1 | 0 | 1; } export interface IFieldIndex { specification: object; unique: boolean; } export interface IDocumentOptions { indexes?: IFieldIndex[]; inherits?: any[]; } export declare class MongoSchemaField { private fieldName; private fieldTypeFn; private fieldOptions; constructor(fieldName: any, fieldTypeFn: Function, fieldOptions: IFieldOptions); readonly name: string; readonly options: IFieldOptions; readonly type: any; getName(): string; getType(): any; getOptions(): IFieldOptions; getReferencedCollection(): any; getForeignFieldName(): string; } export declare class MongoSchema { CollectionSpec: any; name: string; indexes: IFieldIndex[]; fields: MongoSchemaField[]; protected DB: Db; createOptions: CollectionCreateOptions; hooks: any; inherits: typeof MongoCollection[]; constructor(CollectionSpec: any); addField(fieldName: string, fieldType: any, fieldOptions: IFieldOptions): void; getHiddenFields(): any; getVisibleFields(): any; getAutoPopulateFields(): any; getAutoPopulateFieldNamesRecursive(): any; addIndex(index: IFieldIndex): void; setConnection(db: Db): void; getField(name: string): MongoSchemaField; prepare(): void; collection(): Collection; createCollection(): Promise; registerHook(hookName: string, callback: any): void; callHook(hookName: string, input?: any): any; validate(document: object): Error; }