-
Notifications
You must be signed in to change notification settings - Fork 6
/
types.ts
96 lines (92 loc) · 3.34 KB
/
types.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
85
86
87
88
89
90
91
92
93
94
95
96
interface WebkitMessageHandlers {
privacyDashboardShowNativeFeedback?: any;
privacyDashboardTelemetrySpan?: any;
privacyDashboardShowAlertForMissingDescription?: any;
privacyDashboardSubmitBrokenSiteReport?: any;
privacyDashboardOpenUrlInNewTab?: any;
privacyDashboardSetSize?: any;
privacyDashboardShowReportBrokenSite?: any;
privacyDashboardClose?: any;
privacyDashboardSetProtection?: {
postMessage: (params: import('./schema/__generated__/schema.types').SetProtectionParams) => void;
};
privacyDashboardOpenSettings?: any;
privacyDashboardSetPermission?: any;
privacyDashboardGetToggleReportOptions?: {
postMessage: (params: any) => void;
};
privacyDashboardRejectToggleReport?: {
postMessage: (params: any) => Promise<void>;
};
privacyDashboardSendToggleReport?: {
postMessage: (params: any) => Promise<void>;
};
privacyDashboardSeeWhatIsSent?: {
postMessage: (params: any) => Promise<void>;
};
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Window {
__DDG_TEST_DATA: any;
DDG: any;
onChangeConsentManaged: (payload: import('./schema/__generated__/schema.types').CookiePromptManagementStatus) => void;
onChangeParentEntity: any;
/**
* @deprecated use window.onChangeRequestData
*/
onChangeTrackerBlockingData: any;
onChangeTheme: any;
onChangeRequestData: (url: string, rawRequestData: import('./schema/__generated__/schema.types').RequestData) => void;
onChangeLocale: (payload: import('./schema/__generated__/schema.types').LocaleSettings) => void;
onChangeFeatureSettings: (remoteFeatureSettings: import('./schema/__generated__/schema.types').RemoteFeatureSettings) => void;
onChangeAllowedPermissions: any;
onChangeUpgradedHttps: any;
onChangeProtectionStatus: (protections: import('./shared/js/browser/utils/protections.mjs').Protections) => void;
onChangePhishingStatus?: any;
onChangeCertificateData: any;
onIsPendingUpdates: any;
__ddg_did_load?: string[];
/**
* Android's Window API
* TODO: type these methods
*/
PrivacyDashboard: {
toggleAllowlist: (payload: string) => void;
close: (...args: any[]) => any;
showBreakageForm: (...args: any[]) => any;
openInNewTab: (payload: string) => void;
openSettings: (payload: string) => void;
submitBrokenSiteReport: (payload: string) => void;
};
/**
* This is set in Playwright tests
*/
__ddg_integration_test?: boolean;
__playwright: {
listeners?: any[];
calls: any[];
messages: any;
responses: any;
mocks: {
outgoing: any[];
incoming: any[];
};
handler?: (message: Record<string, any>) => void;
onDisconnect?: () => void;
};
webkit?: {
messageHandlers?: WebkitMessageHandlers;
};
onGetToggleReportOptionsResponse?: (data: import('./schema/__generated__/schema.types').ToggleReportScreen) => void;
chrome: {
webview?: {
postMessage?: Window['postMessage'];
addEventListener?: Window['addEventListener'];
removeEventListener?: Window['removeEventListener'];
};
};
}
declare module '*.css' {
const classMap: Record<string, any>;
export default classMap;
}