forked from ciampo/offbeat-appetite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.d.ts
32 lines (28 loc) · 855 Bytes
/
global.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
type RecaptchaConfig = {
sitekey: string;
theme?: string;
size?: string;
badge?: string;
tabindex?: number;
callback?: (token: string) => void;
'expired-callback'?: () => void;
'error-callback'?: (errorMessage: string) => void;
isolated?: boolean;
hl?: string;
};
interface Window {
IS_GA_INIT?: boolean;
navigator?: { share?: (data?: ShareData) => Promise<void> };
grecaptcha?: {
ready: (callback: () => void) => Promise<void>;
render: (container?: HTMLElement, config: RecaptchaConfig) => number;
execute: (id?: number) => void;
reset: (id?: number) => void;
getResponse: (id?: number) => string;
};
}
type ShareOptions = { title: string; text: string; url: string };
type NavigatorShare = (options: ShareOptions) => Promise<Record<string, unknown>>;
interface Navigator {
share?: NavigatorShare;
}