- Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathplugin.ts
More file actions
Latest commit
52 lines (40 loc) · 1.33 KB
/
Copy pathplugin.ts
File metadata and controls
52 lines (40 loc) · 1.33 KB
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
import*aspuppeteerfrom"puppeteer";
import{Instagram,TFullApiPost,TPost,TSearchResult,TSinglePost}from"..";
exporttypeDType=TPost|TSinglePost|TFullApiPost|TSearchResult;
exportinterfaceIPluginContext<Plugin,PostType>{
plugin: Plugin;
state: Instagram<PostType>;
}
exportinterfaceIPlugin<PostType>{
constructionEvent?(this: IPluginContext<IPlugin<PostType>,PostType>): void;
requestEvent?(
this: IPluginContext<IPlugin<PostType>,PostType>,
req: puppeteer.Request,
overrides: puppeteer.Overrides,
): Promise<void>;
responseEvent?(
this: IPluginContext<IPlugin<PostType>,PostType>,
res: puppeteer.Response,
data: {[key: string]: any},
): Promise<void>;
postPageEvent?(
this: IPluginContext<IPlugin<PostType>,PostType>,
data: PostType,
): Promise<void>;
graftingEvent?(
this: IPluginContext<IPlugin<PostType>,PostType>,
): Promise<void>;
}
exportenumAsyncPluginEvents{
browser,
grafting,
postPage,
request,
response,
}
exporttypeAsyncPluginEventsType=keyoftypeofAsyncPluginEvents;
exportenumSyncPluginEvents{
construction,
}
exporttypeSyncPluginEventsType=keyoftypeofSyncPluginEvents;
exporttypePluginEventsType=SyncPluginEventsType|AsyncPluginEventsType;