-
Notifications
You must be signed in to change notification settings - Fork 11
/
types.d.ts
83 lines (71 loc) · 2.43 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
// These are new additions to the API, only available in Chrome: https://web.dev/intersectionobserver-v2/.
interface IntersectionObserverEntry {
isVisible?: boolean;
}
interface IntersectionObserverInit {
trackVisibility?: boolean;
delay?: number;
}
interface WindowsMessageFormat {
Feature: 'Autofill';
Name: string;
Data: any;
}
interface WindowsResponseFormat {
type: string;
[index: string]: any;
}
declare const windowsInteropPostMessage: (message: WindowsMessageFormat | WindowsResponseFormat, origin?: string) => void;
declare const windowsInteropAddEventListener: Window['addEventListener'];
declare const windowsInteropRemoveEventListener: Window['removeEventListener'];
interface Window {
// Used in the Android app
EmailInterface: {
isSignedIn(): string;
getUserData(): string;
storeCredentials(token: string, username: string, cohort: string): string;
showTooltip();
getDeviceCapabilities(): string;
removeCredentials();
};
// Used in the Android app
BrowserAutofill: {
getAutofillData(data: string): void;
storeFormData(data: string): void;
getIncontextSignupDismissedAt(data: string): void;
setIncontextSignupPermanentlyDismissedAt(data: string): void;
showInContextEmailProtectionSignupPrompt(data: string): void;
startEmailProtectionSignup(data: string): void;
closeEmailProtectionTab(data: string): void;
};
// Used in Apple apps
webkit: {
messageHandlers: Record<
string,
{
postMessage?(data: any): Promise<any>;
}
>;
};
chrome: {
webview: {
postMessage: (message: WindowsMessageFormat | WindowsResponseFormat, origin?: string) => void;
addEventListener: Window['addEventListener'];
removeEventListener: Window['removeEventListener'];
};
};
providerStatusUpdated: (data: ProviderStatusUpdated) => void;
__playwright_autofill: {
mocks: {
calls: MockCall[];
};
};
/**
* This adds type support for the custom message that native sides may
* send to indicate where a mouseMove event occurred
*/
addEventListener(type: 'mouseMove', listener: (this: Document, ev: CustomEvent<{ x: number; y: number }>) => void): void;
}
type ToBoolean<T extends Record<string, any>> = {
[K in keyof T]: boolean;
};