///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
import type { Aggregate, AggregateExtract, CallbackError, Document, MongooseQueryOrDocumentMiddleware, ErrorHandlingMiddlewareFunction, HydratedDocument, Model, MongooseDocumentMiddleware, MongooseQueryMiddleware, PostMiddlewareFunction, PreMiddlewareFunction, PreSaveMiddlewareFunction, Query, SchemaPostOptions, SchemaPreOptions, MongooseDistinctDocumentMiddleware, MongooseDefaultQueryMiddleware, MongooseDistinctQueryMiddleware, MongooseQueryAndDocumentMiddleware, InsertManyOptions } 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: {
(method: 'save', fn: PreSaveMiddlewareFunction, options?: SchemaPreOptions & {
document: false;
query: boolean;
}): ClassDecorator;
(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: false;
query: false;
}): ClassDecorator;
(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: boolean;
query: false;
}): ClassDecorator;
(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: false;
query: boolean;
}): ClassDecorator;
> ? S_4 : S_4 extends Document ? S_4 : HydratedDocument, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: true;
query: true;
}): ClassDecorator;
? S_5 : HydratedDocument, any>>(method: 'save', fn: PreSaveMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator;
? S_6 : HydratedDocument, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PreMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator;
? S_7 : HydratedDocument, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: true;
}): ClassDecorator;
? S_8 : HydratedDocument, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: true;
query: false;
}): ClassDecorator;
>, T_9 = S_9 extends Query> ? S_9 : Query, DocumentType, {}, unknown, "find", Record>>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PreMiddlewareFunction): ClassDecorator;
>, T_10 = S_10 extends Query> ? S_10 : Query, DocumentType, {}, unknown, "find", Record>>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PreMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator;
>, T_11 = S_11 extends Query> ? S_11 : Query, DocumentType, {}, unknown, "find", Record>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: false;
query: true;
}): ClassDecorator;
> ? S_12 : S_12 extends Document ? S_12 : HydratedDocument, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: true;
query: true;
}): ClassDecorator;
>(method: 'aggregate' | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator;
| AnyParamConstructor, T_14 = S_13 extends Model ? S_13 : ReturnModelType>(method: 'insertMany' | RegExp, fn: (this: T_14, next: (err?: CallbackError) => void, docs: any | Array, options?: InsertManyOptions & {
lean?: boolean;
}) => void | Promise, options?: SchemaPreOptions): ClassDecorator;
};
export declare const post: {
>, T = S extends Query> ? S : Query, DocumentType, {}, unknown, "find", Record>>(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;
(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction, options?: SchemaPostOptions & {
document: false;
query: false;
}): ClassDecorator;
(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PostMiddlewareFunction, options?: SchemaPostOptions & {
document: boolean;
query: false;
}): ClassDecorator;
(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PostMiddlewareFunction, options?: SchemaPostOptions & {
document: false;
query: true;
}): ClassDecorator;
? S_6 : HydratedDocument, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PostMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator;
? S_7 : HydratedDocument, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction, options?: SchemaPostOptions & {
document: true;
query: false;
}): ClassDecorator;
>, T_9 = S_8 extends Query> ? S_8 : Query, DocumentType, {}, unknown, "find", Record>>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PostMiddlewareFunction>): ClassDecorator;
>, T_10 = S_9 extends Query> ? S_9 : Query, DocumentType, {}, unknown, "find", Record>>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PostMiddlewareFunction>, options?: SchemaPostOptions): ClassDecorator;
>, T_11 = S_10 extends Query> ? S_10 : Query, DocumentType, {}, unknown, "find", Record>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction>, options?: SchemaPostOptions & {
document: false;
query: true;
}): ClassDecorator;
> ? S_11 : S_11 extends Document ? S_11 : HydratedDocument, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction, options?: SchemaPostOptions & {
document: true;
query: true;
}): ClassDecorator;
>(method: 'aggregate' | RegExp, fn: PostMiddlewareFunction[]>, options?: SchemaPostOptions): ClassDecorator;
| AnyParamConstructor, T_14 = S_12 extends Model ? S_12 : ReturnModelType>(method: 'insertMany' | RegExp, fn: PostMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator;
};
export declare const Pre: {
(method: 'save', fn: PreSaveMiddlewareFunction, options?: SchemaPreOptions & {
document: false;
query: boolean;
}): ClassDecorator;
(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: false;
query: false;
}): ClassDecorator;
(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: boolean;
query: false;
}): ClassDecorator;
(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: false;
query: boolean;
}): ClassDecorator;
> ? S_4 : S_4 extends Document ? S_4 : HydratedDocument, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: true;
query: true;
}): ClassDecorator;
? S_5 : HydratedDocument, any>>(method: 'save', fn: PreSaveMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator;
? S_6 : HydratedDocument, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PreMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator;
? S_7 : HydratedDocument, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: true;
}): ClassDecorator;
? S_8 : HydratedDocument, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: true;
query: false;
}): ClassDecorator;
>, T_9 = S_9 extends Query> ? S_9 : Query, DocumentType, {}, unknown, "find", Record>>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PreMiddlewareFunction): ClassDecorator;
>, T_10 = S_10 extends Query> ? S_10 : Query, DocumentType, {}, unknown, "find", Record>>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PreMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator;
>, T_11 = S_11 extends Query> ? S_11 : Query, DocumentType, {}, unknown, "find", Record>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: false;
query: true;
}): ClassDecorator;
> ? S_12 : S_12 extends Document ? S_12 : HydratedDocument, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions & {
document: true;
query: true;
}): ClassDecorator;
>(method: 'aggregate' | RegExp, fn: PreMiddlewareFunction, options?: SchemaPreOptions): ClassDecorator;
| AnyParamConstructor, T_14 = S_13 extends Model ? S_13 : ReturnModelType>(method: 'insertMany' | RegExp, fn: (this: T_14, next: (err?: CallbackError) => void, docs: any | Array, options?: InsertManyOptions & {
lean?: boolean;
}) => void | Promise, options?: SchemaPreOptions): ClassDecorator;
};
export declare const Post: {
>, T = S extends Query> ? S : Query, DocumentType, {}, unknown, "find", Record>>(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;
(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction, options?: SchemaPostOptions & {
document: false;
query: false;
}): ClassDecorator;
(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PostMiddlewareFunction, options?: SchemaPostOptions & {
document: boolean;
query: false;
}): ClassDecorator;
(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PostMiddlewareFunction, options?: SchemaPostOptions & {
document: false;
query: true;
}): ClassDecorator;
? S_6 : HydratedDocument, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PostMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator;
? S_7 : HydratedDocument, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction, options?: SchemaPostOptions & {
document: true;
query: false;
}): ClassDecorator;
>, T_9 = S_8 extends Query> ? S_8 : Query, DocumentType, {}, unknown, "find", Record>>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PostMiddlewareFunction>): ClassDecorator;
>, T_10 = S_9 extends Query> ? S_9 : Query, DocumentType, {}, unknown, "find", Record>>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PostMiddlewareFunction>, options?: SchemaPostOptions): ClassDecorator;
>, T_11 = S_10 extends Query> ? S_10 : Query, DocumentType, {}, unknown, "find", Record>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction>, options?: SchemaPostOptions & {
document: false;
query: true;
}): ClassDecorator;
> ? S_11 : S_11 extends Document ? S_11 : HydratedDocument, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction, options?: SchemaPostOptions & {
document: true;
query: true;
}): ClassDecorator;
>(method: 'aggregate' | RegExp, fn: PostMiddlewareFunction[]>, options?: SchemaPostOptions): ClassDecorator;
| AnyParamConstructor, T_14 = S_12 extends Model ? S_12 : ReturnModelType>(method: 'insertMany' | RegExp, fn: PostMiddlewareFunction, options?: SchemaPostOptions): ClassDecorator;
};
export {};