-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
61 lines (52 loc) · 1.43 KB
/
index.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
type DevToolDetectListener = (isDevtoolOpen: boolean) => void;
type DetectorType =
| "debugger"
| "console-elem"
| "console-date"
| "console-reg";
interface _DetectorSetting {
nextScopeInterval: number;
}
interface DebugDetectorSetting extends _DetectorSetting {
scopeDebugCount: number;
waitScopeTime: number;
}
interface ConsoleDetectorSetting extends _DetectorSetting {
waitConsole: number;
clearConsole: boolean;
}
interface _Detector {
type: DetectorType;
setting: _DetectorSetting;
readonly isDevtoolOpen: boolean;
enable: boolean;
setEnable: (enable: boolean) => void;
}
interface DebugDetector extends _Detector {
setting: DebugDetectorSetting;
}
interface ConsoleDetector extends _Detector {
setting: ConsoleDetectorSetting;
}
interface BrowserDetectorConfig {
chrome: DetectorType;
safari: DetectorType;
firefox: DetectorType;
ie: DetectorType;
edgeLegacy: DetectorType;
default: DetectorType;
}
export {
DevToolDetectListener,
DetectorType,
DebugDetector,
ConsoleDetector,
DebugDetectorSetting,
ConsoleDetectorSetting,
BrowserDetectorConfig,
}; // type export
export declare const BrowserDetector: BrowserDetectorConfig;
export const getDetector: () => DebugDetector | ConsoleDetector;
export const addDetectListener: (listener: DevToolDetectListener) => void;
export const removeDetectListener: (listener: DevToolDetectListener) => void;
export const removeAllDetectListener: () => void;