-
Notifications
You must be signed in to change notification settings - Fork 1
/
messages.d.ts
80 lines (67 loc) · 1.43 KB
/
messages.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
declare namespace Shared {
export type TrackData = {
timestamp: string;
title: string;
host: string;
url: string;
userAgent: string;
};
export type Tag = {
enabled: boolean;
text: string;
};
export type RedactionRule = {
enabled: boolean;
replace: string;
with: string;
description: string;
};
}
declare namespace MessageToBackground {
export type Log = {
action: "log";
data: string;
};
export type Track = {
action: "track";
data: Shared.TrackData;
};
export type EnableTracking = {
action: "enable_tracking";
};
export type DisableTracking = {
action: "disable_tracking";
};
export type PopupNeedsInit = {
action: "popup_needs_init";
};
export type SetTags = {
action: "set_tags";
tags: Shared.Tag[];
};
export type SetRedactionRules = {
action: "set_redaction_rules";
redaction_rules: Shared.RedactionRule[];
};
export type Any =
| Log
| Track
| EnableTracking
| DisableTracking
| PopupNeedsInit
| SetTags
| SetRedactionRules;
}
declare namespace MessageToPopup {
export type EnabledTracking = {
action: "tracking_is_enabled";
url: string;
tags: Shared.Tag[];
redaction_rules: Shared.RedactionRule[];
};
export type DisabledTracking = {
action: "tracking_is_disabled";
error: string | undefined;
};
export type Any = DisabledTracking | EnabledTracking;
}