-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
model-hooks-single.ts
146 lines (122 loc) · 7.05 KB
/
model-hooks-single.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import type { HookOptions, HookDecoratorArgs } from './hook-decorators.js';
import { implementHookDecorator } from './hook-decorators.js';
export function BeforeAssociate(target: Object, propertyName: string): void;
export function BeforeAssociate(options: HookOptions): MethodDecorator;
export function BeforeAssociate(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('beforeAssociate', args);
}
export function AfterAssociate(target: Object, propertyName: string): void;
export function AfterAssociate(options: HookOptions): MethodDecorator;
export function AfterAssociate(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('afterAssociate', args);
}
export function BeforeCount(target: Object, propertyName: string): void;
export function BeforeCount(options: HookOptions): MethodDecorator;
export function BeforeCount(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('beforeCount', args);
}
export function BeforeCreate(target: Object, propertyName: string): void;
export function BeforeCreate(options: HookOptions): MethodDecorator;
export function BeforeCreate(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('beforeCreate', args);
}
export function AfterCreate(target: Object, propertyName: string): void;
export function AfterCreate(options: HookOptions): MethodDecorator;
export function AfterCreate(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('afterCreate', args);
}
export function BeforeDestroy(target: Object, propertyName: string): void;
export function BeforeDestroy(options: HookOptions): MethodDecorator;
export function BeforeDestroy(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('beforeDestroy', args);
}
export function AfterDestroy(target: Object, propertyName: string): void;
export function AfterDestroy(options: HookOptions): MethodDecorator;
export function AfterDestroy(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('afterDestroy', args);
}
export function BeforeFind(target: Object, propertyName: string): void;
export function BeforeFind(options: HookOptions): MethodDecorator;
export function BeforeFind(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('beforeFind', args);
}
export function BeforeFindAfterExpandIncludeAll(target: Object, propertyName: string): void;
export function BeforeFindAfterExpandIncludeAll(options: HookOptions): MethodDecorator;
export function BeforeFindAfterExpandIncludeAll(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('beforeFindAfterExpandIncludeAll', args);
}
export function BeforeFindAfterOptions(target: Object, propertyName: string): void;
export function BeforeFindAfterOptions(options: HookOptions): MethodDecorator;
export function BeforeFindAfterOptions(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('beforeFindAfterOptions', args);
}
export function AfterFind(target: Object, propertyName: string): void;
export function AfterFind(options: HookOptions): MethodDecorator;
export function AfterFind(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('afterFind', args);
}
export function BeforeRestore(target: Object, propertyName: string): void;
export function BeforeRestore(options: HookOptions): MethodDecorator;
export function BeforeRestore(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('beforeRestore' as any, args);
}
export function AfterRestore(target: Object, propertyName: string): void;
export function AfterRestore(options: HookOptions): MethodDecorator;
export function AfterRestore(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('afterRestore' as any, args);
}
export function BeforeSave(target: Object, propertyName: string): void;
export function BeforeSave(options: HookOptions): MethodDecorator;
export function BeforeSave(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('beforeSave' as any, args);
}
export function AfterSave(target: Object, propertyName: string): void;
export function AfterSave(options: HookOptions): MethodDecorator;
export function AfterSave(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('afterSave' as any, args);
}
export function BeforeSync(target: Object, propertyName: string): void;
export function BeforeSync(options: HookOptions): MethodDecorator;
export function BeforeSync(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('beforeSync', args);
}
export function AfterSync(target: Object, propertyName: string): void;
export function AfterSync(options: HookOptions): MethodDecorator;
export function AfterSync(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('afterSync', args);
}
export function BeforeUpdate(target: Object, propertyName: string): void;
export function BeforeUpdate(options: HookOptions): MethodDecorator;
export function BeforeUpdate(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('beforeUpdate', args);
}
export function AfterUpdate(target: Object, propertyName: string): void;
export function AfterUpdate(options: HookOptions): MethodDecorator;
export function AfterUpdate(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('afterUpdate', args);
}
export function BeforeUpsert(target: Object, propertyName: string): void;
export function BeforeUpsert(options: HookOptions): MethodDecorator;
export function BeforeUpsert(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('beforeUpsert' as any, args);
}
export function AfterUpsert(target: Object, propertyName: string): void;
export function AfterUpsert(options: HookOptions): MethodDecorator;
export function AfterUpsert(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('afterUpsert' as any, args);
}
export function BeforeValidate(target: Object, propertyName: string): void;
export function BeforeValidate(options: HookOptions): MethodDecorator;
export function BeforeValidate(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('beforeValidate', args);
}
export function ValidationFailed(target: Object, propertyName: string): void;
export function ValidationFailed(options: HookOptions): MethodDecorator;
export function ValidationFailed(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('validationFailed' as any, args);
}
export function AfterValidate(target: Object, propertyName: string): void;
export function AfterValidate(options: HookOptions): MethodDecorator;
export function AfterValidate(...args: HookDecoratorArgs): undefined | MethodDecorator {
return implementHookDecorator('afterValidate', args);
}