1 | import type { Types } from 'mongoose';
|
2 | import type { AnyParamConstructor, DocumentType, RefType } from './types';
|
3 | export declare abstract class TimeStamps {
|
4 | createdAt?: Date;
|
5 | updatedAt?: Date;
|
6 | }
|
7 |
|
8 |
|
9 |
|
10 | export interface Base<IDType extends RefType = Types.ObjectId> {
|
11 | _id: IDType;
|
12 | |
13 |
|
14 |
|
15 | id: string;
|
16 | }
|
17 | export interface FindOrCreateResult<T> {
|
18 | created: boolean;
|
19 | doc: DocumentType<T>;
|
20 | }
|
21 |
|
22 |
|
23 |
|
24 | export declare abstract class FindOrCreate {
|
25 | static findOrCreate: <T extends FindOrCreate>(this: AnyParamConstructor<T>, condition: any, createWith?: any) => Promise<FindOrCreateResult<T>>;
|
26 | }
|