1 | import type { Aggregate, AggregateExtract, CallbackError, Document, DocumentOrQueryMiddleware, ErrorHandlingMiddlewareFunction, HydratedDocument, Model, MongooseDocumentMiddleware, MongooseQueryMiddleware, PostMiddlewareFunction, PreMiddlewareFunction, PreSaveMiddlewareFunction, Query, SchemaPostOptions, SchemaPreOptions } from 'mongoose';
|
2 | import type { AnyParamConstructor, DocumentType, ReturnModelType } from './types';
|
3 |
|
4 | type QueryResultType<T> = T extends Query<infer ResultType, any> ? ResultType : never;
|
5 | export declare const pre: {
|
6 | <S extends unknown, T = S extends Document<any, any, any> ? S : HydratedDocument<DocumentType<S, import("./types").BeAnObject>, any, {}>>(method: DocumentOrQueryMiddleware | DocumentOrQueryMiddleware[], fn: PreMiddlewareFunction<T>, options: SchemaPreOptions & {
|
7 | document: true;
|
8 | query: false;
|
9 | }): ClassDecorator;
|
10 | <S_1 extends object | Query<any, any, {}, any>, T_1 = S_1 extends Query<any, any, {}, any> ? S_1 : Query<DocumentType<S_1, import("./types").BeAnObject>, DocumentType<S_1, import("./types").BeAnObject>, {}, DocumentType<S_1, import("./types").BeAnObject>>>(method: DocumentOrQueryMiddleware | DocumentOrQueryMiddleware[], fn: PreMiddlewareFunction<T_1>, options: SchemaPreOptions & {
|
11 | document: false;
|
12 | query: true;
|
13 | }): ClassDecorator;
|
14 | <S_2 extends unknown, T_2 = S_2 extends Document<any, any, any> ? S_2 : HydratedDocument<DocumentType<S_2, import("./types").BeAnObject>, any, {}>>(method: 'save', fn: PreSaveMiddlewareFunction<T_2>, options?: SchemaPreOptions): ClassDecorator;
|
15 | <S_3 extends object | Query<any, any, {}, any>, T_3 = S_3 extends Query<any, any, {}, any> ? S_3 : Query<DocumentType<S_3, import("./types").BeAnObject>, DocumentType<S_3, import("./types").BeAnObject>, {}, DocumentType<S_3, import("./types").BeAnObject>>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_3>, options?: SchemaPreOptions): ClassDecorator;
|
16 | <S_4 extends unknown, T_4 = S_4 extends Document<any, any, any> ? S_4 : HydratedDocument<DocumentType<S_4, import("./types").BeAnObject>, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_4>, options?: SchemaPreOptions): ClassDecorator;
|
17 | <T_5 extends Aggregate<any>>(method: 'aggregate' | RegExp, fn: PreMiddlewareFunction<T_5>, options?: SchemaPreOptions): ClassDecorator;
|
18 | <S_5 extends Model<any, {}, {}, {}, any> | AnyParamConstructor<any>, T_6 = S_5 extends Model<any, {}, {}, {}, any> ? S_5 : ReturnModelType<S_5, import("./types").BeAnObject>>(method: 'insertMany' | RegExp, fn: (this: T_6, next: (err?: CallbackError) => void, docs: any | Array<any>) => void | Promise<void>, options?: SchemaPreOptions): ClassDecorator;
|
19 | };
|
20 | export declare const post: {
|
21 | <S extends object | Query<any, any, {}, any>, T = S extends Query<any, any, {}, any> ? S : Query<DocumentType<S, import("./types").BeAnObject>, DocumentType<S, import("./types").BeAnObject>, {}, DocumentType<S, import("./types").BeAnObject>>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T, any>, options: SchemaPostOptions & {
|
22 | errorHandler: true;
|
23 | }): ClassDecorator;
|
24 | <S_1 extends unknown, T_1 = S_1 extends Document<any, any, any> ? S_1 : HydratedDocument<DocumentType<S_1, import("./types").BeAnObject>, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_1, any>, options: SchemaPostOptions & {
|
25 | errorHandler: true;
|
26 | }): ClassDecorator;
|
27 | <T_2 extends Aggregate<any>>(method: 'aggregate' | RegExp, fn: ErrorHandlingMiddlewareFunction<T_2, any[]>, options: SchemaPostOptions & {
|
28 | errorHandler: true;
|
29 | }): ClassDecorator;
|
30 | <S_2 extends Model<any, {}, {}, {}, any> | AnyParamConstructor<any>, T_3 = S_2 extends Model<any, {}, {}, {}, any> ? S_2 : ReturnModelType<S_2, import("./types").BeAnObject>>(method: 'insertMany' | RegExp, fn: ErrorHandlingMiddlewareFunction<T_3, any>, options: SchemaPostOptions & {
|
31 | errorHandler: true;
|
32 | }): ClassDecorator;
|
33 | <S_3 extends object | Query<any, any, {}, any>, T_4 = S_3 extends Query<any, any, {}, any> ? S_3 : Query<DocumentType<S_3, import("./types").BeAnObject>, DocumentType<S_3, import("./types").BeAnObject>, {}, DocumentType<S_3, import("./types").BeAnObject>>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_4, QueryResultType<T_4>>, options?: SchemaPostOptions): ClassDecorator;
|
34 | <S_4 extends unknown, T_5 = S_4 extends Document<any, any, any> ? S_4 : HydratedDocument<DocumentType<S_4, import("./types").BeAnObject>, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_5, T_5>, options?: SchemaPostOptions): ClassDecorator;
|
35 | <T_6 extends Aggregate<any>>(method: 'aggregate' | RegExp, fn: PostMiddlewareFunction<T_6, AggregateExtract<T_6>[]>, options?: SchemaPostOptions): ClassDecorator;
|
36 | <S_5 extends Model<any, {}, {}, {}, any> | AnyParamConstructor<any>, T_7 = S_5 extends Model<any, {}, {}, {}, any> ? S_5 : ReturnModelType<S_5, import("./types").BeAnObject>>(method: 'insertMany' | RegExp, fn: PostMiddlewareFunction<T_7, T_7>, options?: SchemaPostOptions): ClassDecorator;
|
37 | <S_6 extends object | Query<any, any, {}, any>, T_8 = S_6 extends Query<any, any, {}, any> ? S_6 : Query<DocumentType<S_6, import("./types").BeAnObject>, DocumentType<S_6, import("./types").BeAnObject>, {}, DocumentType<S_6, import("./types").BeAnObject>>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_8, any>, options?: SchemaPostOptions): ClassDecorator;
|
38 | <S_7 extends unknown, T_9 = S_7 extends Document<any, any, any> ? S_7 : HydratedDocument<DocumentType<S_7, import("./types").BeAnObject>, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_9, any>, options?: SchemaPostOptions): ClassDecorator;
|
39 | <T_10 extends Aggregate<any>>(method: 'aggregate' | RegExp, fn: ErrorHandlingMiddlewareFunction<T_10, any[]>, options?: SchemaPostOptions): ClassDecorator;
|
40 | <S_8 extends Model<any, {}, {}, {}, any> | AnyParamConstructor<any>, T_11 = S_8 extends Model<any, {}, {}, {}, any> ? S_8 : ReturnModelType<S_8, import("./types").BeAnObject>>(method: 'insertMany' | RegExp, fn: ErrorHandlingMiddlewareFunction<T_11, any>, options?: SchemaPostOptions): ClassDecorator;
|
41 | };
|
42 | export declare const Pre: {
|
43 | <S extends unknown, T = S extends Document<any, any, any> ? S : HydratedDocument<DocumentType<S, import("./types").BeAnObject>, any, {}>>(method: DocumentOrQueryMiddleware | DocumentOrQueryMiddleware[], fn: PreMiddlewareFunction<T>, options: SchemaPreOptions & {
|
44 | document: true;
|
45 | query: false;
|
46 | }): ClassDecorator;
|
47 | <S_1 extends object | Query<any, any, {}, any>, T_1 = S_1 extends Query<any, any, {}, any> ? S_1 : Query<DocumentType<S_1, import("./types").BeAnObject>, DocumentType<S_1, import("./types").BeAnObject>, {}, DocumentType<S_1, import("./types").BeAnObject>>>(method: DocumentOrQueryMiddleware | DocumentOrQueryMiddleware[], fn: PreMiddlewareFunction<T_1>, options: SchemaPreOptions & {
|
48 | document: false;
|
49 | query: true;
|
50 | }): ClassDecorator;
|
51 | <S_2 extends unknown, T_2 = S_2 extends Document<any, any, any> ? S_2 : HydratedDocument<DocumentType<S_2, import("./types").BeAnObject>, any, {}>>(method: 'save', fn: PreSaveMiddlewareFunction<T_2>, options?: SchemaPreOptions): ClassDecorator;
|
52 | <S_3 extends object | Query<any, any, {}, any>, T_3 = S_3 extends Query<any, any, {}, any> ? S_3 : Query<DocumentType<S_3, import("./types").BeAnObject>, DocumentType<S_3, import("./types").BeAnObject>, {}, DocumentType<S_3, import("./types").BeAnObject>>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_3>, options?: SchemaPreOptions): ClassDecorator;
|
53 | <S_4 extends unknown, T_4 = S_4 extends Document<any, any, any> ? S_4 : HydratedDocument<DocumentType<S_4, import("./types").BeAnObject>, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T_4>, options?: SchemaPreOptions): ClassDecorator;
|
54 | <T_5 extends Aggregate<any>>(method: 'aggregate' | RegExp, fn: PreMiddlewareFunction<T_5>, options?: SchemaPreOptions): ClassDecorator;
|
55 | <S_5 extends Model<any, {}, {}, {}, any> | AnyParamConstructor<any>, T_6 = S_5 extends Model<any, {}, {}, {}, any> ? S_5 : ReturnModelType<S_5, import("./types").BeAnObject>>(method: 'insertMany' | RegExp, fn: (this: T_6, next: (err?: CallbackError) => void, docs: any | Array<any>) => void | Promise<void>, options?: SchemaPreOptions): ClassDecorator;
|
56 | };
|
57 | export declare const Post: {
|
58 | <S extends object | Query<any, any, {}, any>, T = S extends Query<any, any, {}, any> ? S : Query<DocumentType<S, import("./types").BeAnObject>, DocumentType<S, import("./types").BeAnObject>, {}, DocumentType<S, import("./types").BeAnObject>>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T, any>, options: SchemaPostOptions & {
|
59 | errorHandler: true;
|
60 | }): ClassDecorator;
|
61 | <S_1 extends unknown, T_1 = S_1 extends Document<any, any, any> ? S_1 : HydratedDocument<DocumentType<S_1, import("./types").BeAnObject>, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_1, any>, options: SchemaPostOptions & {
|
62 | errorHandler: true;
|
63 | }): ClassDecorator;
|
64 | <T_2 extends Aggregate<any>>(method: 'aggregate' | RegExp, fn: ErrorHandlingMiddlewareFunction<T_2, any[]>, options: SchemaPostOptions & {
|
65 | errorHandler: true;
|
66 | }): ClassDecorator;
|
67 | <S_2 extends Model<any, {}, {}, {}, any> | AnyParamConstructor<any>, T_3 = S_2 extends Model<any, {}, {}, {}, any> ? S_2 : ReturnModelType<S_2, import("./types").BeAnObject>>(method: 'insertMany' | RegExp, fn: ErrorHandlingMiddlewareFunction<T_3, any>, options: SchemaPostOptions & {
|
68 | errorHandler: true;
|
69 | }): ClassDecorator;
|
70 | <S_3 extends object | Query<any, any, {}, any>, T_4 = S_3 extends Query<any, any, {}, any> ? S_3 : Query<DocumentType<S_3, import("./types").BeAnObject>, DocumentType<S_3, import("./types").BeAnObject>, {}, DocumentType<S_3, import("./types").BeAnObject>>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_4, QueryResultType<T_4>>, options?: SchemaPostOptions): ClassDecorator;
|
71 | <S_4 extends unknown, T_5 = S_4 extends Document<any, any, any> ? S_4 : HydratedDocument<DocumentType<S_4, import("./types").BeAnObject>, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction<T_5, T_5>, options?: SchemaPostOptions): ClassDecorator;
|
72 | <T_6 extends Aggregate<any>>(method: 'aggregate' | RegExp, fn: PostMiddlewareFunction<T_6, AggregateExtract<T_6>[]>, options?: SchemaPostOptions): ClassDecorator;
|
73 | <S_5 extends Model<any, {}, {}, {}, any> | AnyParamConstructor<any>, T_7 = S_5 extends Model<any, {}, {}, {}, any> ? S_5 : ReturnModelType<S_5, import("./types").BeAnObject>>(method: 'insertMany' | RegExp, fn: PostMiddlewareFunction<T_7, T_7>, options?: SchemaPostOptions): ClassDecorator;
|
74 | <S_6 extends object | Query<any, any, {}, any>, T_8 = S_6 extends Query<any, any, {}, any> ? S_6 : Query<DocumentType<S_6, import("./types").BeAnObject>, DocumentType<S_6, import("./types").BeAnObject>, {}, DocumentType<S_6, import("./types").BeAnObject>>>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_8, any>, options?: SchemaPostOptions): ClassDecorator;
|
75 | <S_7 extends unknown, T_9 = S_7 extends Document<any, any, any> ? S_7 : HydratedDocument<DocumentType<S_7, import("./types").BeAnObject>, any, {}>>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction<T_9, any>, options?: SchemaPostOptions): ClassDecorator;
|
76 | <T_10 extends Aggregate<any>>(method: 'aggregate' | RegExp, fn: ErrorHandlingMiddlewareFunction<T_10, any[]>, options?: SchemaPostOptions): ClassDecorator;
|
77 | <S_8 extends Model<any, {}, {}, {}, any> | AnyParamConstructor<any>, T_11 = S_8 extends Model<any, {}, {}, {}, any> ? S_8 : ReturnModelType<S_8, import("./types").BeAnObject>>(method: 'insertMany' | RegExp, fn: ErrorHandlingMiddlewareFunction<T_11, any>, options?: SchemaPostOptions): ClassDecorator;
|
78 | };
|
79 | export {};
|
80 |
|
\ | No newline at end of file |