/
file.lifecycle.ts
53 lines (44 loc) · 1.6 KB
/
file.lifecycle.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
import { Topic } from "@webiny/pubsub/types";
import { File } from "./file";
export interface OnFileBeforeCreateTopicParams<TFile extends File = File> {
file: TFile;
meta?: Record<string, any>;
}
export interface OnFileAfterCreateTopicParams<TFile extends File = File> {
file: TFile;
meta?: Record<string, any>;
}
export interface OnFileBeforeBatchCreateTopicParams<TFile extends File = File> {
files: TFile[];
meta?: Record<string, any>;
}
export interface OnFileAfterBatchCreateTopicParams<TFile extends File = File> {
files: TFile[];
meta?: Record<string, any>;
}
export interface OnFileBeforeUpdateTopicParams<TFile extends File = File> {
original: TFile;
file: TFile;
input: Record<string, any>;
}
export interface OnFileAfterUpdateTopicParams<TFile extends File = File> {
original: TFile;
file: TFile;
input: Record<string, any>;
}
export interface OnFileBeforeDeleteTopicParams<TFile extends File = File> {
file: TFile;
}
export interface OnFileAfterDeleteTopicParams<TFile extends File = File> {
file: TFile;
}
export interface FileLifecycleEvents {
onFileBeforeCreate: Topic<OnFileBeforeCreateTopicParams>;
onFileAfterCreate: Topic<OnFileAfterCreateTopicParams>;
onFileBeforeBatchCreate: Topic<OnFileBeforeBatchCreateTopicParams>;
onFileAfterBatchCreate: Topic<OnFileAfterBatchCreateTopicParams>;
onFileBeforeUpdate: Topic<OnFileBeforeUpdateTopicParams>;
onFileAfterUpdate: Topic<OnFileAfterUpdateTopicParams>;
onFileBeforeDelete: Topic<OnFileBeforeDeleteTopicParams>;
onFileAfterDelete: Topic<OnFileAfterDeleteTopicParams>;
}