|
1 | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2 | 2 | From: Chris Bobbe < [email protected]>
|
3 |
| -Date: Mon, 26 Sep 2022 16:57:08 +0800 |
4 |
| -Subject: [tsflower] expo-web-browser: Translate TS enum WebBrowserResultType |
| 3 | +Date: Mon, 25 Jul 2022 13:35:00 -0700 |
| 4 | +Subject: [tsflower] expo-web-browser: Translate TS enum |
| 5 | + WebBrowserPresentationStyle |
5 | 6 |
|
6 | 7 | Read more about our approach in the recent patch that translated a
|
7 | 8 | TS enum in expo-application.
|
8 | 9 | ---
|
9 |
| - .../expo-web-browser/build/WebBrowser.js.flow | 3 +- |
10 |
| - .../build/WebBrowser.types.js.flow | 35 +++++++++---------- |
11 |
| - 2 files changed, 19 insertions(+), 19 deletions(-) |
| 10 | + .../expo-web-browser/build/WebBrowser.js.flow | 2 +- |
| 11 | + .../build/WebBrowser.types.js.flow | 43 +++++++++---------- |
| 12 | + 2 files changed, 22 insertions(+), 23 deletions(-) |
12 | 13 |
|
13 | 14 | diff --git types/expo-web-browser/build/WebBrowser.js.flow types/expo-web-browser/build/WebBrowser.js.flow
|
14 |
| -index eb36ffcd8..4e4aaf9d4 100644 |
| 15 | +index 4e4aaf9d4..97be5b587 100644 |
15 | 16 | --- types/expo-web-browser/build/WebBrowser.js.flow
|
16 | 17 | +++ types/expo-web-browser/build/WebBrowser.js.flow
|
17 |
| -@@ -12,13 +12,14 @@ import { |
18 |
| - type WebBrowserRedirectResult, |
19 |
| - type WebBrowserResult, |
20 |
| - WebBrowserResultType, |
21 |
| -+ type WebBrowserResultTypeT, |
22 |
| - type WebBrowserWarmUpResult, |
23 |
| - type WebBrowserWindowFeatures, |
24 |
| - WebBrowserPresentationStyle, |
| 18 | +@@ -19,7 +19,7 @@ import { |
25 | 19 | type AuthSessionOpenOptions,
|
26 | 20 | } from "./WebBrowser.types";
|
27 | 21 |
|
28 |
| --export { WebBrowserAuthSessionResult, WebBrowserCompleteAuthSessionOptions, WebBrowserCompleteAuthSessionResult, WebBrowserCoolDownResult, WebBrowserCustomTabsResults, WebBrowserMayInitWithUrlResult, WebBrowserOpenOptions, WebBrowserRedirectResult, WebBrowserResult, WebBrowserResultType, WebBrowserWarmUpResult, WebBrowserWindowFeatures, WebBrowserPresentationStyle, AuthSessionOpenOptions }; |
29 |
| -+export { WebBrowserAuthSessionResult, WebBrowserCompleteAuthSessionOptions, WebBrowserCompleteAuthSessionResult, WebBrowserCoolDownResult, WebBrowserCustomTabsResults, WebBrowserMayInitWithUrlResult, WebBrowserOpenOptions, WebBrowserRedirectResult, WebBrowserResult, WebBrowserResultType, WebBrowserResultTypeT, WebBrowserWarmUpResult, WebBrowserWindowFeatures, WebBrowserPresentationStyle, AuthSessionOpenOptions }; |
| 22 | +-export { WebBrowserAuthSessionResult, WebBrowserCompleteAuthSessionOptions, WebBrowserCompleteAuthSessionResult, WebBrowserCoolDownResult, WebBrowserCustomTabsResults, WebBrowserMayInitWithUrlResult, WebBrowserOpenOptions, WebBrowserRedirectResult, WebBrowserResult, WebBrowserResultType, WebBrowserResultTypeT, WebBrowserWarmUpResult, WebBrowserWindowFeatures, WebBrowserPresentationStyle, AuthSessionOpenOptions }; |
| 23 | ++export { WebBrowserAuthSessionResult, WebBrowserCompleteAuthSessionOptions, WebBrowserCompleteAuthSessionResult, WebBrowserCoolDownResult, WebBrowserCustomTabsResults, WebBrowserMayInitWithUrlResult, WebBrowserOpenOptions, WebBrowserRedirectResult, WebBrowserResult, WebBrowserResultType, WebBrowserResultTypeT, WebBrowserWarmUpResult, WebBrowserWindowFeatures, WebBrowserPresentationStyle, WebBrowserPresentationStyleT, AuthSessionOpenOptions }; |
30 | 24 | declare export function getCustomTabsSupportingBrowsersAsync(): Promise<WebBrowserCustomTabsResults>;
|
31 | 25 | declare export function warmUpAsync(browserPackage?: string): Promise<WebBrowserWarmUpResult>;
|
32 | 26 | declare export function mayInitWithUrlAsync(url: string, browserPackage?: string): Promise<WebBrowserMayInitWithUrlResult>;
|
33 | 27 | diff --git types/expo-web-browser/build/WebBrowser.types.js.flow types/expo-web-browser/build/WebBrowser.types.js.flow
|
34 |
| -index 0b2c54c70..26584386d 100644 |
| 28 | +index 26584386d..88b3d2364 100644 |
35 | 29 | --- types/expo-web-browser/build/WebBrowser.types.js.flow
|
36 | 30 | +++ types/expo-web-browser/build/WebBrowser.types.js.flow
|
37 |
| -@@ -33,23 +33,22 @@ export type WebBrowserCustomTabsResults = { |
| 31 | +@@ -16,7 +16,7 @@ export type WebBrowserOpenOptions = { |
| 32 | + controlsColor?: string, |
| 33 | + dismissButtonStyle?: "done" | "close" | "cancel", |
| 34 | + readerMode?: boolean, |
| 35 | +- presentationStyle?: WebBrowserPresentationStyle, |
| 36 | ++ presentationStyle?: WebBrowserPresentationStyleT, |
| 37 | + windowName?: string, |
| 38 | + windowFeatures?: string | WebBrowserWindowFeatures, |
38 | 39 | ...
|
39 |
| - }; |
| 40 | +@@ -50,50 +50,49 @@ declare export var WebBrowserResultType: {| |
| 41 | + |} |
| 42 | + export type WebBrowserResultTypeT = $Values<typeof WebBrowserResultType>; |
40 | 43 |
|
41 | 44 | -/* tsflower-unimplemented: EnumDeclaration */
|
42 | 45 | -/*
|
43 |
| --export declare enum WebBrowserResultType { |
44 |
| -- /** |
45 |
| -- * @platform ios |
| 46 | + /** |
| 47 | + * A browser presentation style. Its values are directly mapped to the [`UIModalPresentationStyle`](https://developer.apple.com/documentation/uikit/uiviewcontroller/1621355-modalpresentationstyle). |
| 48 | + * |
| 49 | + * @platform ios |
| 50 | +- * / |
| 51 | +-export declare enum WebBrowserPresentationStyle { |
| 52 | ++ */ |
| 53 | ++declare export var WebBrowserPresentationStyle: {| |
| 54 | + /** |
| 55 | + * A presentation style in which the presented browser covers the screen. |
46 | 56 | - * /
|
47 |
| -- CANCEL = "cancel", |
48 |
| -- /** |
49 |
| -- * @platform ios |
| 57 | +- FULL_SCREEN = "fullScreen", |
| 58 | ++ */ |
| 59 | ++ +FULL_SCREEN: "fullScreen", |
| 60 | + /** |
| 61 | + * A presentation style that partially covers the underlying content. |
50 | 62 | - * /
|
51 |
| -- DISMISS = "dismiss", |
52 |
| -- /** |
53 |
| -- * @platform android |
| 63 | +- PAGE_SHEET = "pageSheet", |
| 64 | ++ */ |
| 65 | ++ +PAGE_SHEET: "pageSheet", |
| 66 | + /** |
| 67 | + * A presentation style that displays the browser centered in the screen. |
54 | 68 | - * /
|
55 |
| -- OPENED = "opened", |
56 |
| -- LOCKED = "locked" |
| 69 | +- FORM_SHEET = "formSheet", |
| 70 | ++ */ |
| 71 | ++ +FORM_SHEET: "formSheet", |
| 72 | + /** |
| 73 | + * A presentation style where the browser is displayed over the app's content. |
| 74 | +- * / |
| 75 | +- CURRENT_CONTEXT = "currentContext", |
| 76 | ++ */ |
| 77 | ++ +CURRENT_CONTEXT: "currentContext", |
| 78 | + /** |
| 79 | + * A presentation style in which the browser view covers the screen. |
| 80 | +- * / |
| 81 | +- OVER_FULL_SCREEN = "overFullScreen", |
| 82 | ++ */ |
| 83 | ++ +OVER_FULL_SCREEN: "overFullScreen", |
| 84 | + /** |
| 85 | + * A presentation style where the browser is displayed over the app's content. |
| 86 | +- * / |
| 87 | +- OVER_CURRENT_CONTEXT = "overCurrentContext", |
| 88 | ++ */ |
| 89 | ++ +OVER_CURRENT_CONTEXT: "overCurrentContext", |
| 90 | + /** |
| 91 | + * A presentation style where the browser is displayed in a popover view. |
| 92 | +- * / |
| 93 | +- POPOVER = "popover", |
| 94 | ++ */ |
| 95 | ++ +POPOVER: "popover", |
| 96 | + /** |
| 97 | + * The default presentation style chosen by the system. |
| 98 | + * On older iOS versions, falls back to `WebBrowserPresentationStyle.FullScreen`. |
| 99 | + * |
| 100 | + * @platform ios 13+ |
| 101 | +- * / |
| 102 | +- AUTOMATIC = "automatic" |
57 | 103 | -} */
|
58 |
| -+declare export var WebBrowserResultType: {| |
59 |
| -+ /** |
60 |
| -+ * @platform ios |
61 |
| -+ */ |
62 |
| -+ +CANCEL: 'cancel', |
63 |
| -+ /** |
64 |
| -+ * @platform ios |
65 |
| -+ */ |
66 |
| -+ +DISMISS: 'dismiss', |
67 |
| -+ /** |
68 |
| -+ * @platform android |
69 |
| -+ */ |
70 |
| -+ +OPENED: 'opened', |
71 |
| -+ +LOCKED: 'locked', |
| 104 | ++ */ |
| 105 | ++ +AUTOMATIC: "automatic" |
72 | 106 | +|}
|
73 |
| -+export type WebBrowserResultTypeT = $Values<typeof WebBrowserResultType>; |
74 |
| - |
75 |
| - /* tsflower-unimplemented: EnumDeclaration */ |
76 |
| - /* |
77 |
| -@@ -96,7 +95,7 @@ export declare enum WebBrowserPresentationStyle { |
78 |
| - AUTOMATIC = "automatic" |
79 |
| - } */ |
| 107 | ++export type WebBrowserPresentationStyleT = $Values<typeof WebBrowserPresentationStyle>; |
80 | 108 |
|
81 |
| --export type WebBrowserResult = { type: WebBrowserResultType, ... }; |
82 |
| -+export type WebBrowserResult = { type: WebBrowserResultTypeT, ... }; |
| 109 | + export type WebBrowserResult = { type: WebBrowserResultTypeT, ... }; |
83 | 110 |
|
84 |
| - export type WebBrowserRedirectResult = { |
85 |
| - type: "success", |
86 | 111 | --
|
87 | 112 | 2.32.0
|
88 | 113 |
|
0 commit comments