|
5 | 5 | */ |
6 | 6 |
|
7 | 7 | declare module 'expo-web-browser' { |
8 | | - import type { |
9 | | - WebBrowserAuthSessionResult, |
10 | | - WebBrowserCoolDownResult, |
11 | | - WebBrowserCustomTabsResults, |
12 | | - WebBrowserMayInitWithUrlResult, |
13 | | - WebBrowserOpenOptions, |
14 | | - WebBrowserRedirectResult, |
15 | | - WebBrowserResult, |
16 | | - WebBrowserWarmUpResult, |
17 | | - WebBrowserWindowFeatures, |
18 | | - } from 'expo-web-browser/build/WebBrowser.types'; |
| 8 | +import type { |
| 9 | + WebBrowserAuthSessionResult, |
| 10 | + WebBrowserCoolDownResult, |
| 11 | + WebBrowserCustomTabsResults, |
| 12 | + WebBrowserMayInitWithUrlResult, |
| 13 | + WebBrowserOpenOptions, |
| 14 | + WebBrowserRedirectResult, |
| 15 | + WebBrowserResult, |
| 16 | + WebBrowserWarmUpResult, |
| 17 | + WebBrowserWindowFeatures, |
| 18 | +} from 'expo-web-browser/build/WebBrowser.types'; |
19 | 19 |
|
20 | | - declare export * from 'expo-web-browser/build/WebBrowser.types' |
21 | | - declare export function getCustomTabsSupportingBrowsersAsync(): Promise<WebBrowserCustomTabsResults>; |
22 | | - declare export function warmUpAsync(browserPackage?: string): Promise<WebBrowserWarmUpResult>; |
23 | | - declare export function mayInitWithUrlAsync( |
24 | | - url: string, |
25 | | - browserPackage?: string, |
26 | | - ): Promise<WebBrowserMayInitWithUrlResult>; |
27 | | - declare export function coolDownAsync(browserPackage?: string): Promise<WebBrowserCoolDownResult>; |
28 | | - declare export function openBrowserAsync( |
29 | | - url: string, |
30 | | - browserParams?: WebBrowserOpenOptions, |
31 | | - ): Promise<WebBrowserResult>; |
32 | | - declare export function dismissBrowser(): void; |
33 | | - declare export function openAuthSessionAsync( |
34 | | - url: string, |
35 | | - redirectUrl: string, |
36 | | - browserParams?: WebBrowserOpenOptions, |
37 | | - ): Promise<WebBrowserAuthSessionResult>; |
38 | | - declare export function dismissAuthSession(): void; |
| 20 | +declare export * from 'expo-web-browser/build/WebBrowser.types' |
| 21 | +declare export function getCustomTabsSupportingBrowsersAsync(): Promise<WebBrowserCustomTabsResults>; |
| 22 | +declare export function warmUpAsync(browserPackage?: string): Promise<WebBrowserWarmUpResult>; |
| 23 | +declare export function mayInitWithUrlAsync( |
| 24 | + url: string, |
| 25 | + browserPackage?: string, |
| 26 | +): Promise<WebBrowserMayInitWithUrlResult>; |
| 27 | +declare export function coolDownAsync(browserPackage?: string): Promise<WebBrowserCoolDownResult>; |
| 28 | +declare export function openBrowserAsync( |
| 29 | + url: string, |
| 30 | + browserParams?: WebBrowserOpenOptions, |
| 31 | +): Promise<WebBrowserResult>; |
| 32 | +declare export function dismissBrowser(): void; |
| 33 | +declare export function openAuthSessionAsync( |
| 34 | + url: string, |
| 35 | + redirectUrl: string, |
| 36 | + browserParams?: WebBrowserOpenOptions, |
| 37 | +): Promise<WebBrowserAuthSessionResult>; |
| 38 | +declare export function dismissAuthSession(): void; |
39 | 39 |
|
40 | | - /** |
41 | | - * Attempts to complete an auth session in the browser. |
42 | | - * @param options |
43 | | - */ |
44 | | - declare export function maybeCompleteAuthSession(options?: { |
45 | | - skipRedirectCheck?: boolean, |
46 | | - ... |
47 | | - }): { |
48 | | - type: 'success' | 'failed', |
49 | | - message: string, |
50 | | - ... |
51 | | - }; |
| 40 | +/** |
| 41 | + * Attempts to complete an auth session in the browser. |
| 42 | + * @param options |
| 43 | + */ |
| 44 | +declare export function maybeCompleteAuthSession(options?: { |
| 45 | + skipRedirectCheck?: boolean, |
| 46 | + ... |
| 47 | +}): { |
| 48 | + type: 'success' | 'failed', |
| 49 | + message: string, |
| 50 | + ... |
| 51 | +}; |
52 | 52 | } |
53 | 53 |
|
54 | 54 | declare module 'expo-web-browser/build/WebBrowser.types' { |
55 | | - declare export type RedirectEvent = { |
56 | | - url: string, |
57 | | - ... |
58 | | - }; |
59 | | - declare export type WebBrowserWindowFeatures = { |
60 | | - [key: string]: number | boolean | string, |
61 | | - ..., |
62 | | - }; |
63 | | - declare export type WebBrowserOpenOptions = { |
64 | | - /** |
65 | | - * Color of the toolbar in either #AARRGGBB or #RRGGBB format. |
66 | | - */ |
67 | | - toolbarColor?: string, |
68 | | - browserPackage?: string, |
| 55 | +declare export type RedirectEvent = { |
| 56 | + url: string, |
| 57 | + ... |
| 58 | +}; |
| 59 | +declare export type WebBrowserWindowFeatures = { |
| 60 | + [key: string]: number | boolean | string, |
| 61 | + ..., |
| 62 | +}; |
| 63 | +declare export type WebBrowserOpenOptions = { |
| 64 | + /** |
| 65 | + * Color of the toolbar in either #AARRGGBB or #RRGGBB format. |
| 66 | + */ |
| 67 | + toolbarColor?: string, |
| 68 | + browserPackage?: string, |
69 | 69 |
|
70 | | - /** |
71 | | - * Whether the toolbar should be hiding when a user scrolls the website. |
72 | | - */ |
73 | | - enableBarCollapsing?: boolean, |
| 70 | + /** |
| 71 | + * Whether the toolbar should be hiding when a user scrolls the website. |
| 72 | + */ |
| 73 | + enableBarCollapsing?: boolean, |
74 | 74 |
|
75 | | - /** |
76 | | - * Android only |
77 | | - */ |
78 | | - /** |
79 | | - * Color of the secondary toolbar in either #AARRGGBB or #RRGGBB format. |
80 | | - */ |
81 | | - secondaryToolbarColor?: string, |
| 75 | + /** |
| 76 | + * Android only |
| 77 | + */ |
| 78 | + /** |
| 79 | + * Color of the secondary toolbar in either #AARRGGBB or #RRGGBB format. |
| 80 | + */ |
| 81 | + secondaryToolbarColor?: string, |
82 | 82 |
|
83 | | - /** |
84 | | - * Whether the browser should show the title of website on the toolbar. |
85 | | - */ |
86 | | - showTitle?: boolean, |
87 | | - enableDefaultShareMenuItem?: boolean, |
| 83 | + /** |
| 84 | + * Whether the browser should show the title of website on the toolbar. |
| 85 | + */ |
| 86 | + showTitle?: boolean, |
| 87 | + enableDefaultShareMenuItem?: boolean, |
88 | 88 |
|
89 | | - /** |
90 | | - * Whether browsed website should be shown as separate entry in Android recents/multitasking view. |
91 | | - * Default: `false` |
92 | | - */ |
93 | | - showInRecents?: boolean, |
| 89 | + /** |
| 90 | + * Whether browsed website should be shown as separate entry in Android recents/multitasking view. |
| 91 | + * Default: `false` |
| 92 | + */ |
| 93 | + showInRecents?: boolean, |
94 | 94 |
|
95 | | - /** |
96 | | - * iOS only |
97 | | - */ |
98 | | - controlsColor?: string, |
99 | | - dismissButtonStyle?: 'done' | 'close' | 'cancel', |
100 | | - readerMode?: boolean, |
| 95 | + /** |
| 96 | + * iOS only |
| 97 | + */ |
| 98 | + controlsColor?: string, |
| 99 | + dismissButtonStyle?: 'done' | 'close' | 'cancel', |
| 100 | + readerMode?: boolean, |
101 | 101 |
|
102 | | - /** |
103 | | - * **Web:** name to assign to the popup window. |
104 | | - */ |
105 | | - windowName?: string, |
| 102 | + /** |
| 103 | + * **Web:** name to assign to the popup window. |
| 104 | + */ |
| 105 | + windowName?: string, |
106 | 106 |
|
107 | | - /** |
108 | | - * **Web:** features to use with `window.open()` |
109 | | - */ |
110 | | - windowFeatures?: string | WebBrowserWindowFeatures, |
111 | | - ... |
112 | | - }; |
113 | | - declare export type WebBrowserAuthSessionResult = WebBrowserRedirectResult | WebBrowserResult; |
114 | | - declare export type WebBrowserCustomTabsResults = { |
115 | | - defaultBrowserPackage?: string, |
116 | | - preferredBrowserPackage?: string, |
117 | | - browserPackages: string[], |
118 | | - servicePackages: string[], |
119 | | - ... |
120 | | - }; |
121 | | - declare export var WebBrowserResultType: {| |
122 | | - +CANCEL: 'cancel', // "cancel" |
123 | | - +DISMISS: 'dismiss', // "dismiss" |
124 | | - +OPENED: 'opened', // "opened" |
125 | | - +LOCKED: 'locked', // "locked" |
126 | | - |}; |
127 | | - declare export type WebBrowserResult = { |
128 | | - type: $Values<typeof WebBrowserResultType>, |
129 | | - ... |
130 | | - }; |
131 | | - declare export type WebBrowserRedirectResult = { |
132 | | - type: 'success', |
133 | | - url: string, |
134 | | - ... |
135 | | - }; |
136 | | - declare export type ServiceActionResult = { |
137 | | - servicePackage?: string, |
138 | | - ... |
139 | | - }; |
140 | | - declare export type WebBrowserMayInitWithUrlResult = ServiceActionResult; |
141 | | - declare export type WebBrowserWarmUpResult = ServiceActionResult; |
142 | | - declare export type WebBrowserCoolDownResult = ServiceActionResult; |
| 107 | + /** |
| 108 | + * **Web:** features to use with `window.open()` |
| 109 | + */ |
| 110 | + windowFeatures?: string | WebBrowserWindowFeatures, |
| 111 | + ... |
| 112 | +}; |
| 113 | +declare export type WebBrowserAuthSessionResult = WebBrowserRedirectResult | WebBrowserResult; |
| 114 | +declare export type WebBrowserCustomTabsResults = { |
| 115 | + defaultBrowserPackage?: string, |
| 116 | + preferredBrowserPackage?: string, |
| 117 | + browserPackages: string[], |
| 118 | + servicePackages: string[], |
| 119 | + ... |
| 120 | +}; |
| 121 | +declare export var WebBrowserResultType: {| |
| 122 | + +CANCEL: 'cancel', // "cancel" |
| 123 | + +DISMISS: 'dismiss', // "dismiss" |
| 124 | + +OPENED: 'opened', // "opened" |
| 125 | + +LOCKED: 'locked', // "locked" |
| 126 | +|}; |
| 127 | +declare export type WebBrowserResult = { |
| 128 | + type: $Values<typeof WebBrowserResultType>, |
| 129 | + ... |
| 130 | +}; |
| 131 | +declare export type WebBrowserRedirectResult = { |
| 132 | + type: 'success', |
| 133 | + url: string, |
| 134 | + ... |
| 135 | +}; |
| 136 | +declare export type ServiceActionResult = { |
| 137 | + servicePackage?: string, |
| 138 | + ... |
| 139 | +}; |
| 140 | +declare export type WebBrowserMayInitWithUrlResult = ServiceActionResult; |
| 141 | +declare export type WebBrowserWarmUpResult = ServiceActionResult; |
| 142 | +declare export type WebBrowserCoolDownResult = ServiceActionResult; |
143 | 143 | } |
0 commit comments