import type { Aggregate, Query } from 'mongoose'; import { mongoose } from './typegoose'; import type { DocumentType, EmptyVoidFn } from './types'; declare type NumberOrDocumentOrDocumentArray = number | DocumentType | DocumentType[]; declare type ReturnVoid = void | Promise; declare type HookNextErrorFn = (err?: Error) => ReturnVoid; declare type PreFnWithAggregate = (this: Aggregate, next: (error?: Error) => ReturnVoid) => ReturnVoid; declare type PreFnWithDocumentType = (this: DocumentType, next: HookNextErrorFn) => ReturnVoid; declare type PreFnWithQuery = (this: Query>, next: (error?: Error) => ReturnVoid) => ReturnVoid; declare type ModelPostFn = (result: any, next: EmptyVoidFn) => ReturnVoid; declare type PostNumberResponse = (result: number, next: EmptyVoidFn) => ReturnVoid; declare type PostSingleResponse = (result: DocumentType, next: EmptyVoidFn) => ReturnVoid; declare type PostMultipleResponse = (result: DocumentType[], next: EmptyVoidFn) => ReturnVoid; declare type PostRegExpResponse = (result: NumberOrDocumentOrDocumentArray, next: EmptyVoidFn) => ReturnVoid; declare type PostArrayResponse = (result: NumberOrDocumentOrDocumentArray, next: EmptyVoidFn) => ReturnVoid; declare type PostQueryArrayResponse = (this: Query>, result: NumberOrDocumentOrDocumentArray, next: EmptyVoidFn) => ReturnVoid; declare type PostNumberWithError = (error: Error, result: number, next: HookNextErrorFn) => ReturnVoid; declare type PostSingleWithError = (error: Error, result: DocumentType, next: HookNextErrorFn) => ReturnVoid; declare type PostMultipleWithError = (error: Error, result: DocumentType[], next: HookNextErrorFn) => ReturnVoid; declare type PostRegExpWithError = (error: Error, result: NumberOrDocumentOrDocumentArray, next: HookNextErrorFn) => ReturnVoid; declare type PostArrayWithError = (error: Error, result: NumberOrDocumentOrDocumentArray, next: EmptyVoidFn) => ReturnVoid; declare type PostQueryArrayWithError = (this: Query>, error: Error, result: NumberOrDocumentOrDocumentArray, next: EmptyVoidFn) => ReturnVoid; declare type AggregateMethod = 'aggregate'; declare type DocumentMethod = 'init' | 'validate' | 'save' | 'remove'; declare type NumberMethod = 'count'; declare type SingleMethod = 'findOne' | 'findOneAndRemove' | 'findOneAndUpdate' | 'findOneAndDelete' | 'deleteOne' | DocumentMethod; declare type MultipleMethod = 'find' | 'update' | 'deleteMany' | 'aggregate'; declare type QueryMethod = 'count' | 'countDocuments' | 'estimatedDocumentCount' | 'find' | 'findOne' | 'findOneAndRemove' | 'findOneAndUpdate' | 'update' | 'updateOne' | 'updateMany' | 'findOneAndDelete' | 'deleteOne' | 'deleteMany'; declare type ModelMethod = 'insertMany'; declare type QMR = QueryMethod | ModelMethod | RegExp; declare type DR = DocumentMethod | RegExp; export declare const pre: { (method: AggregateMethod, fn: PreFnWithAggregate, options?: mongoose.SchemaPreOptions): ClassDecorator; (method: DR | DR[], fn: PreFnWithDocumentType, options?: mongoose.SchemaPreOptions): ClassDecorator; (method: QMR | QMR[], fn: PreFnWithQuery, options?: mongoose.SchemaPreOptions): ClassDecorator; }; export declare const post: { (method: RegExp, fn: PostRegExpResponse, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: RegExp, fn: PostRegExpWithError, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: NumberMethod, fn: PostNumberResponse, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: NumberMethod, fn: PostNumberWithError, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: SingleMethod, fn: PostSingleResponse, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: SingleMethod, fn: PostSingleWithError, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: MultipleMethod, fn: PostMultipleResponse, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: MultipleMethod, fn: PostMultipleWithError, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: ModelMethod, fn: ModelPostFn | PostMultipleResponse, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: DocumentMethod | DocumentMethod[], fn: PostArrayResponse, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: DocumentMethod | DocumentMethod[], fn: PostArrayWithError, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: QMR | QMR[], fn: PostQueryArrayResponse, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: QMR | QMR[], fn: PostQueryArrayWithError, options?: mongoose.SchemaPostOptions): ClassDecorator; }; export declare const Pre: { (method: AggregateMethod, fn: PreFnWithAggregate, options?: mongoose.SchemaPreOptions): ClassDecorator; (method: DR | DR[], fn: PreFnWithDocumentType, options?: mongoose.SchemaPreOptions): ClassDecorator; (method: QMR | QMR[], fn: PreFnWithQuery, options?: mongoose.SchemaPreOptions): ClassDecorator; }; export declare const Post: { (method: RegExp, fn: PostRegExpResponse, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: RegExp, fn: PostRegExpWithError, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: NumberMethod, fn: PostNumberResponse, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: NumberMethod, fn: PostNumberWithError, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: SingleMethod, fn: PostSingleResponse, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: SingleMethod, fn: PostSingleWithError, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: MultipleMethod, fn: PostMultipleResponse, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: MultipleMethod, fn: PostMultipleWithError, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: ModelMethod, fn: ModelPostFn | PostMultipleResponse, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: DocumentMethod | DocumentMethod[], fn: PostArrayResponse, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: DocumentMethod | DocumentMethod[], fn: PostArrayWithError, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: QMR | QMR[], fn: PostQueryArrayResponse, options?: mongoose.SchemaPostOptions): ClassDecorator; (method: QMR | QMR[], fn: PostQueryArrayWithError, options?: mongoose.SchemaPostOptions): ClassDecorator; }; export {};