UNPKG

2.13 kBPlain TextView Raw
1export type RedirectEvent = {
2 url: string;
3};
4
5export type WebBrowserWindowFeatures = Record<string, number | boolean | string>;
6
7export type WebBrowserOpenOptions = {
8 /**
9 * Color of the toolbar in either #AARRGGBB or #RRGGBB format.
10 */
11 toolbarColor?: string;
12 browserPackage?: string;
13 /**
14 * Whether the toolbar should be hiding when a user scrolls the website.
15 */
16 enableBarCollapsing?: boolean;
17
18 /** Android only */
19
20 /**
21 * Color of the secondary toolbar in either #AARRGGBB or #RRGGBB format.
22 */
23 secondaryToolbarColor?: string;
24 /**
25 * Whether the browser should show the title of website on the toolbar.
26 */
27 showTitle?: boolean;
28 enableDefaultShareMenuItem?: boolean;
29 /**
30 * Whether browsed website should be shown as separate entry in Android recents/multitasking view.
31 * Default: `false`
32 */
33 showInRecents?: boolean;
34
35 /** iOS only */
36 controlsColor?: string;
37 dismissButtonStyle?: 'done' | 'close' | 'cancel';
38 readerMode?: boolean;
39
40 /**
41 * **Web:** name to assign to the popup window.
42 */
43 windowName?: string;
44 /**
45 * **Web:** features to use with `window.open()`
46 */
47 windowFeatures?: string | WebBrowserWindowFeatures;
48};
49
50export type WebBrowserAuthSessionResult = WebBrowserRedirectResult | WebBrowserResult;
51
52export type WebBrowserCustomTabsResults = {
53 defaultBrowserPackage?: string;
54 preferredBrowserPackage?: string;
55 browserPackages: string[];
56 servicePackages: string[];
57};
58
59export enum WebBrowserResultType {
60 /**
61 * iOS only
62 */
63 CANCEL = 'cancel',
64 /**
65 * iOS only
66 */
67 DISMISS = 'dismiss',
68 /**
69 * Android only
70 */
71 OPENED = 'opened',
72 LOCKED = 'locked',
73}
74
75export type WebBrowserResult = {
76 // cancel and dismiss are iOS only, opened is Android only
77 type: WebBrowserResultType;
78};
79
80export type WebBrowserRedirectResult = {
81 type: 'success';
82 url: string;
83};
84
85export type ServiceActionResult = {
86 servicePackage?: string;
87};
88
89export type WebBrowserMayInitWithUrlResult = ServiceActionResult;
90export type WebBrowserWarmUpResult = ServiceActionResult;
91export type WebBrowserCoolDownResult = ServiceActionResult;