UNPKG

21.8 kBTypeScriptView Raw
1/// <reference types="mongoose/types/aggregate" />
2/// <reference types="mongoose/types/callback" />
3/// <reference types="mongoose/types/collection" />
4/// <reference types="mongoose/types/connection" />
5/// <reference types="mongoose/types/cursor" />
6/// <reference types="mongoose/types/document" />
7/// <reference types="mongoose/types/error" />
8/// <reference types="mongoose/types/expressions" />
9/// <reference types="mongoose/types/helpers" />
10/// <reference types="mongoose/types/middlewares" />
11/// <reference types="mongoose/types/indexes" />
12/// <reference types="mongoose/types/models" />
13/// <reference types="mongoose/types/mongooseoptions" />
14/// <reference types="mongoose/types/pipelinestage" />
15/// <reference types="mongoose/types/populate" />
16/// <reference types="mongoose/types/query" />
17/// <reference types="mongoose/types/schemaoptions" />
18/// <reference types="mongoose/types/schematypes" />
19/// <reference types="mongoose/types/session" />
20/// <reference types="mongoose/types/types" />
21/// <reference types="mongoose/types/utility" />
22/// <reference types="mongoose/types/validation" />
23/// <reference types="mongoose/types/virtuals" />
24/// <reference types="mongoose/types/inferschematype" />
25/// <reference types="mongoose/types/inferrawdoctype" />
26import type { Aggregate, AggregateExtract, CallbackError, Document, MongooseQueryOrDocumentMiddleware, ErrorHandlingMiddlewareFunction, HydratedDocument, Model, MongooseDocumentMiddleware, MongooseQueryMiddleware, PostMiddlewareFunction, PreMiddlewareFunction, PreSaveMiddlewareFunction, Query, SchemaPostOptions, SchemaPreOptions, MongooseDistinctDocumentMiddleware, MongooseDefaultQueryMiddleware, MongooseDistinctQueryMiddleware, MongooseQueryAndDocumentMiddleware, InsertManyOptions } from 'mongoose';
27import type { AnyParamConstructor, DocumentType, ReturnModelType } from './types';
28/** Type copied from mongoose, because it is not exported but used in hooks */
29type QueryResultType<T> = T extends Query<infer ResultType, any> ? ResultType : never;
30export declare const pre: {
31 <S extends never, T = S>(method: 'save', fn: PreSaveMiddlewareFunction<T>, options?: SchemaPreOptions & {
32 document: false;
33 query: boolean;
34 }): ClassDecorator;
35 <S_1 extends never, T_1 = S_1>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_1>, options?: SchemaPreOptions & {
36 document: false;
37 query: false;
38 }): ClassDecorator;
39 <S_2 extends never, T_2 = S_2>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PreMiddlewareFunction<T_2>, options?: SchemaPreOptions & {
40 document: boolean;
41 query: false;
42 }): ClassDecorator;
43 <S_3 extends never, T_3 = S_3>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_3>, options?: SchemaPreOptions & {
44 document: false;
45 query: boolean;
46 }): ClassDecorator;
47 <S_4 extends unknown, T_4 = S_4 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_4 : S_4 extends Document<unknown, any, any> ? S_4 : HydratedDocument<DocumentType<S_4>, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_4>, options?: SchemaPreOptions & {
48 document: true;
49 query: true;
50 }): ClassDecorator;
51 <S_5 extends unknown, T_5 = S_5 extends Document<unknown, any, any> ? S_5 : HydratedDocument<DocumentType<S_5>, any>>(method: 'save', fn: PreSaveMiddlewareFunction<T_5>, options?: SchemaPreOptions): ClassDecorator;
52 <S_6 extends unknown, T_6 = S_6 extends Document<unknown, any, any> ? S_6 : HydratedDocument<DocumentType<S_6>, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PreMiddlewareFunction<T_6>, options?: SchemaPreOptions): ClassDecorator;
53 <S_7 extends unknown, T_7 = S_7 extends Document<unknown, any, any> ? S_7 : HydratedDocument<DocumentType<S_7>, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_7>, options?: SchemaPreOptions & {
54 document: true;
55 }): ClassDecorator;
56 <S_8 extends unknown, T_8 = S_8 extends Document<unknown, any, any> ? S_8 : HydratedDocument<DocumentType<S_8>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_8>, options?: SchemaPreOptions & {
57 document: true;
58 query: false;
59 }): ClassDecorator;
60 <S_9 extends object | Query<any, any, {}, unknown, "find", Record<string, never>>, T_9 = S_9 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_9 : Query<DocumentType<S_9>, DocumentType<S_9>, {}, unknown, "find", Record<string, never>>>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PreMiddlewareFunction<T_9>): ClassDecorator;
61 <S_10 extends object | Query<any, any, {}, unknown, "find", Record<string, never>>, T_10 = S_10 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_10 : Query<DocumentType<S_10>, DocumentType<S_10>, {}, unknown, "find", Record<string, never>>>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PreMiddlewareFunction<T_10>, options?: SchemaPreOptions): ClassDecorator;
62 <S_11 extends object | Query<any, any, {}, unknown, "find", Record<string, never>>, T_11 = S_11 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_11 : Query<DocumentType<S_11>, DocumentType<S_11>, {}, unknown, "find", Record<string, never>>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_11>, options?: SchemaPreOptions & {
63 document: false;
64 query: true;
65 }): ClassDecorator;
66 <S_12 extends unknown, T_12 = S_12 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_12 : S_12 extends Document<unknown, any, any> ? S_12 : HydratedDocument<DocumentType<S_12>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_12>, options?: SchemaPreOptions & {
67 document: true;
68 query: true;
69 }): ClassDecorator;
70 <T_13 extends Aggregate<any>>(method: 'aggregate' | RegExp, fn: PreMiddlewareFunction<T_13>, options?: SchemaPreOptions): ClassDecorator;
71 <S_13 extends Model<any, {}, {}, {}, any, any> | AnyParamConstructor<any>, T_14 = S_13 extends Model<any, {}, {}, {}, any, any> ? S_13 : ReturnModelType<S_13>>(method: 'insertMany' | RegExp, fn: (this: T_14, next: (err?: CallbackError) => void, docs: any | Array<any>, options?: InsertManyOptions & {
72 lean?: boolean;
73 }) => void | Promise<void>, options?: SchemaPreOptions): ClassDecorator;
74};
75export declare const post: {
76 <S extends object | Query<any, any, {}, unknown, "find", Record<string, never>>, T = S extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S : Query<DocumentType<S>, DocumentType<S>, {}, unknown, "find", Record<string, never>>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T>, options: SchemaPostOptions & {
77 errorHandler: true;
78 }): ClassDecorator;
79 <S_1 extends unknown, T_1 = S_1 extends Document<unknown, any, any> ? S_1 : HydratedDocument<DocumentType<S_1>, any>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_1>, options: SchemaPostOptions & {
80 errorHandler: true;
81 }): ClassDecorator;
82 <T_2 extends Aggregate<any>>(method: 'aggregate' | RegExp, fn: ErrorHandlingMiddlewareFunction<T_2, any[]>, options: SchemaPostOptions & {
83 errorHandler: true;
84 }): ClassDecorator;
85 <S_2 extends Model<any, {}, {}, {}, any, any> | AnyParamConstructor<any>, T_3 = S_2 extends Model<any, {}, {}, {}, any, any> ? S_2 : ReturnModelType<S_2>>(method: 'insertMany' | RegExp, fn: ErrorHandlingMiddlewareFunction<T_3>, options: SchemaPostOptions & {
86 errorHandler: true;
87 }): ClassDecorator;
88 <S_3 extends never, T_4 = S_3>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_4, T_4>, options?: SchemaPostOptions & {
89 document: false;
90 query: false;
91 }): ClassDecorator;
92 <S_4 extends never, T_5 = S_4>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PostMiddlewareFunction<T_5, T_5>, options?: SchemaPostOptions & {
93 document: boolean;
94 query: false;
95 }): ClassDecorator;
96 <S_5 extends never, T_6 = S_5>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PostMiddlewareFunction<T_6, T_6>, options?: SchemaPostOptions & {
97 document: false;
98 query: true;
99 }): ClassDecorator;
100 <S_6 extends unknown, T_7 = S_6 extends Document<unknown, any, any> ? S_6 : HydratedDocument<DocumentType<S_6>, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PostMiddlewareFunction<T_7, T_7>, options?: SchemaPostOptions): ClassDecorator;
101 <S_7 extends unknown, T_8 = S_7 extends Document<unknown, any, any> ? S_7 : HydratedDocument<DocumentType<S_7>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_8, T_8>, options?: SchemaPostOptions & {
102 document: true;
103 query: false;
104 }): ClassDecorator;
105 <S_8 extends object | Query<any, any, {}, unknown, "find", Record<string, never>>, T_9 = S_8 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_8 : Query<DocumentType<S_8>, DocumentType<S_8>, {}, unknown, "find", Record<string, never>>>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PostMiddlewareFunction<T_9, QueryResultType<T_9>>): ClassDecorator;
106 <S_9 extends object | Query<any, any, {}, unknown, "find", Record<string, never>>, T_10 = S_9 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_9 : Query<DocumentType<S_9>, DocumentType<S_9>, {}, unknown, "find", Record<string, never>>>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PostMiddlewareFunction<T_10, QueryResultType<T_10>>, options?: SchemaPostOptions): ClassDecorator;
107 <S_10 extends object | Query<any, any, {}, unknown, "find", Record<string, never>>, T_11 = S_10 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_10 : Query<DocumentType<S_10>, DocumentType<S_10>, {}, unknown, "find", Record<string, never>>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_11, QueryResultType<T_11>>, options?: SchemaPostOptions & {
108 document: false;
109 query: true;
110 }): ClassDecorator;
111 <S_11 extends unknown, T_12 = S_11 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_11 : S_11 extends Document<unknown, any, any> ? S_11 : HydratedDocument<DocumentType<S_11>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_12>, options?: SchemaPostOptions & {
112 document: true;
113 query: true;
114 }): ClassDecorator;
115 <T_13 extends Aggregate<any>>(method: 'aggregate' | RegExp, fn: PostMiddlewareFunction<T_13, AggregateExtract<T_13>[]>, options?: SchemaPostOptions): ClassDecorator;
116 <S_12 extends Model<any, {}, {}, {}, any, any> | AnyParamConstructor<any>, T_14 = S_12 extends Model<any, {}, {}, {}, any, any> ? S_12 : ReturnModelType<S_12>>(method: 'insertMany' | RegExp, fn: PostMiddlewareFunction<T_14, T_14>, options?: SchemaPostOptions): ClassDecorator;
117};
118export declare const Pre: {
119 <S extends never, T = S>(method: 'save', fn: PreSaveMiddlewareFunction<T>, options?: SchemaPreOptions & {
120 document: false;
121 query: boolean;
122 }): ClassDecorator;
123 <S_1 extends never, T_1 = S_1>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_1>, options?: SchemaPreOptions & {
124 document: false;
125 query: false;
126 }): ClassDecorator;
127 <S_2 extends never, T_2 = S_2>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PreMiddlewareFunction<T_2>, options?: SchemaPreOptions & {
128 document: boolean;
129 query: false;
130 }): ClassDecorator;
131 <S_3 extends never, T_3 = S_3>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_3>, options?: SchemaPreOptions & {
132 document: false;
133 query: boolean;
134 }): ClassDecorator;
135 <S_4 extends unknown, T_4 = S_4 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_4 : S_4 extends Document<unknown, any, any> ? S_4 : HydratedDocument<DocumentType<S_4>, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_4>, options?: SchemaPreOptions & {
136 document: true;
137 query: true;
138 }): ClassDecorator;
139 <S_5 extends unknown, T_5 = S_5 extends Document<unknown, any, any> ? S_5 : HydratedDocument<DocumentType<S_5>, any>>(method: 'save', fn: PreSaveMiddlewareFunction<T_5>, options?: SchemaPreOptions): ClassDecorator;
140 <S_6 extends unknown, T_6 = S_6 extends Document<unknown, any, any> ? S_6 : HydratedDocument<DocumentType<S_6>, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PreMiddlewareFunction<T_6>, options?: SchemaPreOptions): ClassDecorator;
141 <S_7 extends unknown, T_7 = S_7 extends Document<unknown, any, any> ? S_7 : HydratedDocument<DocumentType<S_7>, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_7>, options?: SchemaPreOptions & {
142 document: true;
143 }): ClassDecorator;
144 <S_8 extends unknown, T_8 = S_8 extends Document<unknown, any, any> ? S_8 : HydratedDocument<DocumentType<S_8>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_8>, options?: SchemaPreOptions & {
145 document: true;
146 query: false;
147 }): ClassDecorator;
148 <S_9 extends object | Query<any, any, {}, unknown, "find", Record<string, never>>, T_9 = S_9 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_9 : Query<DocumentType<S_9>, DocumentType<S_9>, {}, unknown, "find", Record<string, never>>>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PreMiddlewareFunction<T_9>): ClassDecorator;
149 <S_10 extends object | Query<any, any, {}, unknown, "find", Record<string, never>>, T_10 = S_10 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_10 : Query<DocumentType<S_10>, DocumentType<S_10>, {}, unknown, "find", Record<string, never>>>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PreMiddlewareFunction<T_10>, options?: SchemaPreOptions): ClassDecorator;
150 <S_11 extends object | Query<any, any, {}, unknown, "find", Record<string, never>>, T_11 = S_11 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_11 : Query<DocumentType<S_11>, DocumentType<S_11>, {}, unknown, "find", Record<string, never>>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_11>, options?: SchemaPreOptions & {
151 document: false;
152 query: true;
153 }): ClassDecorator;
154 <S_12 extends unknown, T_12 = S_12 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_12 : S_12 extends Document<unknown, any, any> ? S_12 : HydratedDocument<DocumentType<S_12>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_12>, options?: SchemaPreOptions & {
155 document: true;
156 query: true;
157 }): ClassDecorator;
158 <T_13 extends Aggregate<any>>(method: 'aggregate' | RegExp, fn: PreMiddlewareFunction<T_13>, options?: SchemaPreOptions): ClassDecorator;
159 <S_13 extends Model<any, {}, {}, {}, any, any> | AnyParamConstructor<any>, T_14 = S_13 extends Model<any, {}, {}, {}, any, any> ? S_13 : ReturnModelType<S_13>>(method: 'insertMany' | RegExp, fn: (this: T_14, next: (err?: CallbackError) => void, docs: any | Array<any>, options?: InsertManyOptions & {
160 lean?: boolean;
161 }) => void | Promise<void>, options?: SchemaPreOptions): ClassDecorator;
162};
163export declare const Post: {
164 <S extends object | Query<any, any, {}, unknown, "find", Record<string, never>>, T = S extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S : Query<DocumentType<S>, DocumentType<S>, {}, unknown, "find", Record<string, never>>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T>, options: SchemaPostOptions & {
165 errorHandler: true;
166 }): ClassDecorator;
167 <S_1 extends unknown, T_1 = S_1 extends Document<unknown, any, any> ? S_1 : HydratedDocument<DocumentType<S_1>, any>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_1>, options: SchemaPostOptions & {
168 errorHandler: true;
169 }): ClassDecorator;
170 <T_2 extends Aggregate<any>>(method: 'aggregate' | RegExp, fn: ErrorHandlingMiddlewareFunction<T_2, any[]>, options: SchemaPostOptions & {
171 errorHandler: true;
172 }): ClassDecorator;
173 <S_2 extends Model<any, {}, {}, {}, any, any> | AnyParamConstructor<any>, T_3 = S_2 extends Model<any, {}, {}, {}, any, any> ? S_2 : ReturnModelType<S_2>>(method: 'insertMany' | RegExp, fn: ErrorHandlingMiddlewareFunction<T_3>, options: SchemaPostOptions & {
174 errorHandler: true;
175 }): ClassDecorator;
176 <S_3 extends never, T_4 = S_3>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_4, T_4>, options?: SchemaPostOptions & {
177 document: false;
178 query: false;
179 }): ClassDecorator;
180 <S_4 extends never, T_5 = S_4>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PostMiddlewareFunction<T_5, T_5>, options?: SchemaPostOptions & {
181 document: boolean;
182 query: false;
183 }): ClassDecorator;
184 <S_5 extends never, T_6 = S_5>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PostMiddlewareFunction<T_6, T_6>, options?: SchemaPostOptions & {
185 document: false;
186 query: true;
187 }): ClassDecorator;
188 <S_6 extends unknown, T_7 = S_6 extends Document<unknown, any, any> ? S_6 : HydratedDocument<DocumentType<S_6>, any>>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PostMiddlewareFunction<T_7, T_7>, options?: SchemaPostOptions): ClassDecorator;
189 <S_7 extends unknown, T_8 = S_7 extends Document<unknown, any, any> ? S_7 : HydratedDocument<DocumentType<S_7>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_8, T_8>, options?: SchemaPostOptions & {
190 document: true;
191 query: false;
192 }): ClassDecorator;
193 <S_8 extends object | Query<any, any, {}, unknown, "find", Record<string, never>>, T_9 = S_8 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_8 : Query<DocumentType<S_8>, DocumentType<S_8>, {}, unknown, "find", Record<string, never>>>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PostMiddlewareFunction<T_9, QueryResultType<T_9>>): ClassDecorator;
194 <S_9 extends object | Query<any, any, {}, unknown, "find", Record<string, never>>, T_10 = S_9 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_9 : Query<DocumentType<S_9>, DocumentType<S_9>, {}, unknown, "find", Record<string, never>>>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[], fn: PostMiddlewareFunction<T_10, QueryResultType<T_10>>, options?: SchemaPostOptions): ClassDecorator;
195 <S_10 extends object | Query<any, any, {}, unknown, "find", Record<string, never>>, T_11 = S_10 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_10 : Query<DocumentType<S_10>, DocumentType<S_10>, {}, unknown, "find", Record<string, never>>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_11, QueryResultType<T_11>>, options?: SchemaPostOptions & {
196 document: false;
197 query: true;
198 }): ClassDecorator;
199 <S_11 extends unknown, T_12 = S_11 extends Query<any, any, {}, unknown, "find", Record<string, never>> ? S_11 : S_11 extends Document<unknown, any, any> ? S_11 : HydratedDocument<DocumentType<S_11>, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_12>, options?: SchemaPostOptions & {
200 document: true;
201 query: true;
202 }): ClassDecorator;
203 <T_13 extends Aggregate<any>>(method: 'aggregate' | RegExp, fn: PostMiddlewareFunction<T_13, AggregateExtract<T_13>[]>, options?: SchemaPostOptions): ClassDecorator;
204 <S_12 extends Model<any, {}, {}, {}, any, any> | AnyParamConstructor<any>, T_14 = S_12 extends Model<any, {}, {}, {}, any, any> ? S_12 : ReturnModelType<S_12>>(method: 'insertMany' | RegExp, fn: PostMiddlewareFunction<T_14, T_14>, options?: SchemaPostOptions): ClassDecorator;
205};
206export {};
207
\No newline at end of file