This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
generated from kernel-addons/PluginTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.d.ts
84 lines (84 loc) · 2.78 KB
/
types.d.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
declare type SearchFilter = (m: any, index?: number) => boolean | void;
declare const Filters: {
byProps(...props: string[]): SearchFilter;
byDisplayName(displayName: string, defaultExports?: boolean): SearchFilter;
byPrototypes(...protos: string[]): SearchFilter;
byFunctionStrings(...strings: string[]): SearchFilter;
};
interface DefaultOptions {
all?: boolean;
force?: boolean;
default?: boolean;
}
interface ConditionalDefault extends DefaultOptions {
wait?: false;
}
interface WaitForOptions {
all?: boolean;
delay?: number;
retries?: number;
forever?: boolean;
}
interface ConditionalWaitFor extends WaitForOptions {
wait: true;
}
declare type BulkOptions = (ConditionalDefault | ConditionalWaitFor) & {
wrap?: boolean;
};
declare type ConditionalBulk = [...(string | string[])[], {
bulk: true;
} & ExtendedOptions];
declare type ExtendedOptions = (ConditionalDefault | ConditionalWaitFor);
declare const Webpack: {
bulk: (...options: [...filters: SearchFilter[], options: BulkOptions] | SearchFilter[]) => any[];
Events: EventTarget;
waitFor: (filter: SearchFilter, { retries, all, forever, delay }?: {
retries?: number;
all?: boolean;
forever?: boolean;
delay?: number;
}) => Promise<any>;
require: () => any;
atIndex: (index: number) => any;
Filters: {
byProps(...props: string[]): SearchFilter;
byDisplayName(displayName: string, defaultExports?: boolean): SearchFilter;
byPrototypes(...protos: string[]): SearchFilter;
byFunctionStrings(...strings: string[]): SearchFilter;
};
findIndex: (filter: (m: any) => boolean | void) => number;
whenReady: Promise<void>;
findModule: (filter: SearchFilter, { all, force, default: defaultExports }?: {
all?: boolean;
force?: boolean;
default?: boolean;
}) => any;
findByProps: (...options: string[] | ConditionalBulk | [...string[], ExtendedOptions]) => any;
findModules: (filter: SearchFilter, options?: {
force?: boolean;
default?: boolean;
}) => any;
globalPromise: Promise<void>;
findByDisplayName: (...options: string[] | [...string[], ExtendedOptions]) => any;
getByIndex: (index: number) => any;
getIndex: (filter: (m: any) => boolean | void) => number;
getModule: (filter: SearchFilter, { all, force, default: defaultExports }?: {
all?: boolean;
force?: boolean;
default?: boolean;
}) => any;
getByProps: (...options: string[] | ConditionalBulk | [...string[], ExtendedOptions]) => any;
getModules: (filter: SearchFilter, options?: {
force?: boolean;
default?: boolean;
}) => any;
getByDisplayName: (...options: string[] | [...string[], ExtendedOptions]) => any;
get ready(): boolean;
get common(): {
get Dispatcher(): any;
get Constants(): any;
get Flux(): any;
get React(): any;
get ReactDOM(): any;
};
};