import type { Aggregate, AggregateExtract, CallbackError, Document, DocumentOrQueryMiddleware, ErrorHandlingMiddlewareFunction, HydratedDocument, Model, MongooseDocumentMiddleware, MongooseQueryMiddleware, PostMiddlewareFunction, PreMiddlewareFunction, PreSaveMiddlewareFunction, Query, SchemaPostOptions, SchemaPreOptions } from 'mongoose'; import type { AnyParamConstructor, DocumentType, ReturnModelType } from './types'; /** Type copied from mongoose, because it is not exported but used in hooks */ type QueryResultType = T extends Query ? ResultType : never; export declare const pre: { ? S : HydratedDocument, any, {}>>(method: DocumentOrQueryMiddleware | DocumentOrQueryMiddleware[], fn: PreMiddlewareFunction, options: SchemaPreOptions & { document: true; query: false; }): ClassDecorator; , T_1 = S_1 extends Query ? S_1 : Query, DocumentType, {}, DocumentType>>(method: DocumentOrQueryMiddleware | DocumentOrQueryMiddleware[], fn: PreMiddlewareFunction, options: SchemaPreOptions & { document: false; query: true; }): ClassDecorator; ? S_2 : HydratedDocument, any, {}>>(method: 'save', fn: PreSaveMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator; , T_3 = S_3 extends Query ? S_3 : Query, DocumentType, {}, DocumentType>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator; ? S_4 : HydratedDocument, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator; >(method: 'aggregate' | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator; | AnyParamConstructor, T_6 = S_5 extends Model ? S_5 : ReturnModelType>(method: 'insertMany' | RegExp, fn: (this: T_6, next: (err?: CallbackError) => void, docs: any | Array) => void | Promise, options?: SchemaPreOptions): ClassDecorator; }; export declare const post: { , T = S extends Query ? S : Query, DocumentType, {}, DocumentType>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction, options: SchemaPostOptions & { errorHandler: true; }): ClassDecorator; ? S_1 : HydratedDocument, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction, options: SchemaPostOptions & { errorHandler: true; }): ClassDecorator; >(method: 'aggregate' | RegExp, fn: ErrorHandlingMiddlewareFunction, options: SchemaPostOptions & { errorHandler: true; }): ClassDecorator; | AnyParamConstructor, T_3 = S_2 extends Model ? S_2 : ReturnModelType>(method: 'insertMany' | RegExp, fn: ErrorHandlingMiddlewareFunction, options: SchemaPostOptions & { errorHandler: true; }): ClassDecorator; , T_4 = S_3 extends Query ? S_3 : Query, DocumentType, {}, DocumentType>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: PostMiddlewareFunction>, options?: SchemaPostOptions): ClassDecorator; ? S_4 : HydratedDocument, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator; >(method: 'aggregate' | RegExp, fn: PostMiddlewareFunction[]>, options?: SchemaPostOptions): ClassDecorator; | AnyParamConstructor, T_7 = S_5 extends Model ? S_5 : ReturnModelType>(method: 'insertMany' | RegExp, fn: PostMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator; , T_8 = S_6 extends Query ? S_6 : Query, DocumentType, {}, DocumentType>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator; ? S_7 : HydratedDocument, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator; >(method: 'aggregate' | RegExp, fn: ErrorHandlingMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator; | AnyParamConstructor, T_11 = S_8 extends Model ? S_8 : ReturnModelType>(method: 'insertMany' | RegExp, fn: ErrorHandlingMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator; }; export declare const Pre: { ? S : HydratedDocument, any, {}>>(method: DocumentOrQueryMiddleware | DocumentOrQueryMiddleware[], fn: PreMiddlewareFunction, options: SchemaPreOptions & { document: true; query: false; }): ClassDecorator; , T_1 = S_1 extends Query ? S_1 : Query, DocumentType, {}, DocumentType>>(method: DocumentOrQueryMiddleware | DocumentOrQueryMiddleware[], fn: PreMiddlewareFunction, options: SchemaPreOptions & { document: false; query: true; }): ClassDecorator; ? S_2 : HydratedDocument, any, {}>>(method: 'save', fn: PreSaveMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator; , T_3 = S_3 extends Query ? S_3 : Query, DocumentType, {}, DocumentType>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator; ? S_4 : HydratedDocument, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator; >(method: 'aggregate' | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator; | AnyParamConstructor, T_6 = S_5 extends Model ? S_5 : ReturnModelType>(method: 'insertMany' | RegExp, fn: (this: T_6, next: (err?: CallbackError) => void, docs: any | Array) => void | Promise, options?: SchemaPreOptions): ClassDecorator; }; export declare const Post: { , T = S extends Query ? S : Query, DocumentType, {}, DocumentType>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction, options: SchemaPostOptions & { errorHandler: true; }): ClassDecorator; ? S_1 : HydratedDocument, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction, options: SchemaPostOptions & { errorHandler: true; }): ClassDecorator; >(method: 'aggregate' | RegExp, fn: ErrorHandlingMiddlewareFunction, options: SchemaPostOptions & { errorHandler: true; }): ClassDecorator; | AnyParamConstructor, T_3 = S_2 extends Model ? S_2 : ReturnModelType>(method: 'insertMany' | RegExp, fn: ErrorHandlingMiddlewareFunction, options: SchemaPostOptions & { errorHandler: true; }): ClassDecorator; , T_4 = S_3 extends Query ? S_3 : Query, DocumentType, {}, DocumentType>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: PostMiddlewareFunction>, options?: SchemaPostOptions): ClassDecorator; ? S_4 : HydratedDocument, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator; >(method: 'aggregate' | RegExp, fn: PostMiddlewareFunction[]>, options?: SchemaPostOptions): ClassDecorator; | AnyParamConstructor, T_7 = S_5 extends Model ? S_5 : ReturnModelType>(method: 'insertMany' | RegExp, fn: PostMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator; , T_8 = S_6 extends Query ? S_6 : Query, DocumentType, {}, DocumentType>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator; ? S_7 : HydratedDocument, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator; >(method: 'aggregate' | RegExp, fn: ErrorHandlingMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator; | AnyParamConstructor, T_11 = S_8 extends Model ? S_8 : ReturnModelType>(method: 'insertMany' | RegExp, fn: ErrorHandlingMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator; }; export {};