-
-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dep types: Use TsFlower for expo-web-browser
- Loading branch information
1 parent
17e42fc
commit 3e87323
Showing
9 changed files
with
302 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* @flow | ||
* @generated by TsFlower | ||
*/ | ||
import type { ProxyNativeModule as $tsflower_import_type$_$expo_2d_modules_2d_core$ProxyNativeModule, } from "expo-modules-core"; | ||
declare var _default: $tsflower_import_type$_$expo_2d_modules_2d_core$ProxyNativeModule; | ||
export default _default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* @flow | ||
* @generated by TsFlower | ||
*/ | ||
import { | ||
type WebBrowserAuthSessionResult, | ||
type WebBrowserOpenOptions, | ||
type WebBrowserResult, | ||
} from "./WebBrowser.types"; | ||
|
||
declare var _default: { | ||
+name: string, | ||
openBrowserAsync(url: string, browserParams?: WebBrowserOpenOptions): Promise<WebBrowserResult>, | ||
dismissAuthSession(): void, | ||
maybeCompleteAuthSession({ skipRedirectCheck?: boolean | void, ... }): { | ||
type: "success" | "failed", | ||
message: string, | ||
... | ||
}, | ||
openAuthSessionAsync( | ||
url: string, | ||
redirectUrl?: string | void, | ||
openOptions?: WebBrowserOpenOptions | void | ||
): Promise<WebBrowserAuthSessionResult>, | ||
... | ||
}; | ||
|
||
export default _default; | ||
declare export function featureObjectToString(features: { [key: string]: any }): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* @flow | ||
* @generated by TsFlower | ||
*/ | ||
import { | ||
type WebBrowserAuthSessionResult as WebBrowserAuthSessionResult_, | ||
type WebBrowserCompleteAuthSessionOptions as WebBrowserCompleteAuthSessionOptions_, | ||
type WebBrowserCompleteAuthSessionResult as WebBrowserCompleteAuthSessionResult_, | ||
type WebBrowserCoolDownResult as WebBrowserCoolDownResult_, | ||
type WebBrowserCustomTabsResults as WebBrowserCustomTabsResults_, | ||
type WebBrowserMayInitWithUrlResult as WebBrowserMayInitWithUrlResult_, | ||
type WebBrowserOpenOptions as WebBrowserOpenOptions_, | ||
type WebBrowserRedirectResult as WebBrowserRedirectResult_, | ||
type WebBrowserResult as WebBrowserResult_, | ||
WebBrowserResultType, | ||
type WebBrowserResultTypeT as WebBrowserResultTypeT_, | ||
type WebBrowserWarmUpResult as WebBrowserWarmUpResult_, | ||
type WebBrowserWindowFeatures as WebBrowserWindowFeatures_, | ||
} from "./WebBrowser.types"; | ||
|
||
export { WebBrowserResultType }; | ||
|
||
export type WebBrowserAuthSessionResult = WebBrowserAuthSessionResult_; | ||
export type WebBrowserCompleteAuthSessionOptions = WebBrowserCompleteAuthSessionOptions_; | ||
export type WebBrowserCompleteAuthSessionResult = WebBrowserCompleteAuthSessionResult_; | ||
export type WebBrowserCoolDownResult = WebBrowserCoolDownResult_; | ||
export type WebBrowserCustomTabsResults = WebBrowserCustomTabsResults_; | ||
export type WebBrowserMayInitWithUrlResult = WebBrowserMayInitWithUrlResult_; | ||
export type WebBrowserOpenOptions = WebBrowserOpenOptions_; | ||
export type WebBrowserRedirectResult = WebBrowserRedirectResult_; | ||
export type WebBrowserResult = WebBrowserResult_; | ||
export type WebBrowserResultTypeT = WebBrowserResultTypeT_; | ||
export type WebBrowserWarmUpResult = WebBrowserWarmUpResult_; | ||
export type WebBrowserWindowFeatures = WebBrowserWindowFeatures_; | ||
|
||
declare export function getCustomTabsSupportingBrowsersAsync(): Promise<WebBrowserCustomTabsResults>; | ||
declare export function warmUpAsync(browserPackage?: string): Promise<WebBrowserWarmUpResult>; | ||
declare export function mayInitWithUrlAsync(url: string, browserPackage?: string): Promise<WebBrowserMayInitWithUrlResult>; | ||
declare export function coolDownAsync(browserPackage?: string): Promise<WebBrowserCoolDownResult>; | ||
declare export function openBrowserAsync(url: string, browserParams?: WebBrowserOpenOptions): Promise<WebBrowserResult>; | ||
declare export function dismissBrowser(): void; | ||
declare export function openAuthSessionAsync(url: string, redirectUrl: string, browserParams?: WebBrowserOpenOptions): Promise<WebBrowserAuthSessionResult>; | ||
declare export function dismissAuthSession(): void; | ||
declare export function maybeCompleteAuthSession(options?: WebBrowserCompleteAuthSessionOptions): WebBrowserCompleteAuthSessionResult; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* @flow | ||
* @generated by TsFlower | ||
*/ | ||
export type RedirectEvent = { url: string, ... }; | ||
export type WebBrowserWindowFeatures = { [key: string]: number | boolean | string }; | ||
|
||
export type WebBrowserOpenOptions = { | ||
toolbarColor?: string, | ||
browserPackage?: string, | ||
enableBarCollapsing?: boolean, | ||
secondaryToolbarColor?: string, | ||
showTitle?: boolean, | ||
enableDefaultShareMenuItem?: boolean, | ||
showInRecents?: boolean, | ||
createTask?: boolean, | ||
controlsColor?: string, | ||
dismissButtonStyle?: "done" | "close" | "cancel", | ||
readerMode?: boolean, | ||
windowName?: string, | ||
windowFeatures?: string | WebBrowserWindowFeatures, | ||
... | ||
}; | ||
|
||
export type WebBrowserAuthSessionResult = WebBrowserRedirectResult | WebBrowserResult; | ||
|
||
export type WebBrowserCustomTabsResults = { | ||
defaultBrowserPackage?: string, | ||
preferredBrowserPackage?: string, | ||
browserPackages: string[], | ||
servicePackages: string[], | ||
... | ||
}; | ||
|
||
declare export var WebBrowserResultType: {| | ||
/** | ||
* iOS only. | ||
*/ | ||
+CANCEL: 'cancel', | ||
/** | ||
* iOS only. | ||
*/ | ||
+DISMISS: 'dismiss', | ||
/** | ||
* Android only. | ||
*/ | ||
+OPENED: 'opened', | ||
+LOCKED: 'locked', | ||
|} | ||
export type WebBrowserResultTypeT = $Values<typeof WebBrowserResultType>; | ||
|
||
export type WebBrowserResult = { type: WebBrowserResultTypeT, ... }; | ||
|
||
export type WebBrowserRedirectResult = { | ||
type: "success", | ||
url: string, | ||
... | ||
}; | ||
|
||
export type ServiceActionResult = { servicePackage?: string, ... }; | ||
export type WebBrowserMayInitWithUrlResult = ServiceActionResult; | ||
export type WebBrowserWarmUpResult = ServiceActionResult; | ||
export type WebBrowserCoolDownResult = ServiceActionResult; | ||
export type WebBrowserCompleteAuthSessionOptions = { skipRedirectCheck?: boolean, ... }; | ||
|
||
export type WebBrowserCompleteAuthSessionResult = { | ||
type: "success" | "failed", | ||
message: string, | ||
... | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,4 @@ | ||
/** | ||
* Types for the NPM package `expo-web-browser`. | ||
* | ||
* @flow strict-local | ||
/* @flow | ||
* @generated | ||
*/ | ||
|
||
import type { | ||
WebBrowserAuthSessionResult, | ||
WebBrowserCoolDownResult, | ||
WebBrowserCustomTabsResults, | ||
WebBrowserMayInitWithUrlResult, | ||
WebBrowserOpenOptions, | ||
WebBrowserRedirectResult, | ||
WebBrowserResult, | ||
WebBrowserWarmUpResult, | ||
WebBrowserWindowFeatures, | ||
} from './WebBrowser.types'; | ||
|
||
export * from './WebBrowser.types' | ||
declare export function getCustomTabsSupportingBrowsersAsync(): Promise<WebBrowserCustomTabsResults>; | ||
declare export function warmUpAsync(browserPackage?: string): Promise<WebBrowserWarmUpResult>; | ||
declare export function mayInitWithUrlAsync( | ||
url: string, | ||
browserPackage?: string, | ||
): Promise<WebBrowserMayInitWithUrlResult>; | ||
declare export function coolDownAsync(browserPackage?: string): Promise<WebBrowserCoolDownResult>; | ||
declare export function openBrowserAsync( | ||
url: string, | ||
browserParams?: WebBrowserOpenOptions, | ||
): Promise<WebBrowserResult>; | ||
declare export function dismissBrowser(): void; | ||
declare export function openAuthSessionAsync( | ||
url: string, | ||
redirectUrl: string, | ||
browserParams?: WebBrowserOpenOptions, | ||
): Promise<WebBrowserAuthSessionResult>; | ||
declare export function dismissAuthSession(): void; | ||
|
||
/** | ||
* Attempts to complete an auth session in the browser. | ||
* @param options | ||
*/ | ||
declare export function maybeCompleteAuthSession(options?: { | ||
skipRedirectCheck?: boolean, | ||
... | ||
}): { | ||
type: 'success' | 'failed', | ||
message: string, | ||
... | ||
}; | ||
export * from './build/WebBrowser.js.flow'; |
80 changes: 80 additions & 0 deletions
80
types/patches/0040-shortcut-expo-web-browser-Translate-a-TS-enum.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Chris Bobbe <[email protected]> | ||
Date: Mon, 25 Jul 2022 13:35:00 -0700 | ||
Subject: [shortcut] expo-web-browser: Translate a TS enum | ||
|
||
Read more about our approach in the recent patch that did this for | ||
expo-application. | ||
--- | ||
.../expo-web-browser/build/WebBrowser.js.flow | 3 +- | ||
.../build/WebBrowser.types.js.flow | 35 +++++++++---------- | ||
2 files changed, 19 insertions(+), 19 deletions(-) | ||
|
||
diff --git types/expo-web-browser/build/WebBrowser.js.flow types/expo-web-browser/build/WebBrowser.js.flow | ||
index 506ab86a1..969ce710d 100644 | ||
--- types/expo-web-browser/build/WebBrowser.js.flow | ||
+++ types/expo-web-browser/build/WebBrowser.js.flow | ||
@@ -12,11 +12,12 @@ import { | ||
type WebBrowserRedirectResult, | ||
type WebBrowserResult, | ||
WebBrowserResultType, | ||
+ type WebBrowserResultTypeT, | ||
type WebBrowserWarmUpResult, | ||
type WebBrowserWindowFeatures, | ||
} from "./WebBrowser.types"; | ||
|
||
-export { WebBrowserAuthSessionResult, WebBrowserCompleteAuthSessionOptions, WebBrowserCompleteAuthSessionResult, WebBrowserCoolDownResult, WebBrowserCustomTabsResults, WebBrowserMayInitWithUrlResult, WebBrowserOpenOptions, WebBrowserRedirectResult, WebBrowserResult, WebBrowserResultType, WebBrowserWarmUpResult, WebBrowserWindowFeatures }; | ||
+export { WebBrowserAuthSessionResult, WebBrowserCompleteAuthSessionOptions, WebBrowserCompleteAuthSessionResult, WebBrowserCoolDownResult, WebBrowserCustomTabsResults, WebBrowserMayInitWithUrlResult, WebBrowserOpenOptions, WebBrowserRedirectResult, WebBrowserResult, WebBrowserResultType, WebBrowserResultTypeT, WebBrowserWarmUpResult, WebBrowserWindowFeatures }; | ||
declare export function getCustomTabsSupportingBrowsersAsync(): Promise<WebBrowserCustomTabsResults>; | ||
declare export function warmUpAsync(browserPackage?: string): Promise<WebBrowserWarmUpResult>; | ||
declare export function mayInitWithUrlAsync(url: string, browserPackage?: string): Promise<WebBrowserMayInitWithUrlResult>; | ||
diff --git types/expo-web-browser/build/WebBrowser.types.js.flow types/expo-web-browser/build/WebBrowser.types.js.flow | ||
index 803676488..c4e0fdeb0 100644 | ||
--- types/expo-web-browser/build/WebBrowser.types.js.flow | ||
+++ types/expo-web-browser/build/WebBrowser.types.js.flow | ||
@@ -31,25 +31,24 @@ export type WebBrowserCustomTabsResults = { | ||
... | ||
}; | ||
|
||
-/* tsflower-unimplemented: EnumDeclaration */ | ||
-/* | ||
-export declare enum WebBrowserResultType { | ||
- /** | ||
- * iOS only. | ||
- * / | ||
- CANCEL = "cancel", | ||
- /** | ||
- * iOS only. | ||
- * / | ||
- DISMISS = "dismiss", | ||
- /** | ||
- * Android only. | ||
- * / | ||
- OPENED = "opened", | ||
- LOCKED = "locked" | ||
-} */ | ||
+declare export var WebBrowserResultType: {| | ||
+ /** | ||
+ * iOS only. | ||
+ */ | ||
+ +CANCEL: 'cancel', | ||
+ /** | ||
+ * iOS only. | ||
+ */ | ||
+ +DISMISS: 'dismiss', | ||
+ /** | ||
+ * Android only. | ||
+ */ | ||
+ +OPENED: 'opened', | ||
+ +LOCKED: 'locked', | ||
+|} | ||
+export type WebBrowserResultTypeT = $Values<typeof WebBrowserResultType>; | ||
|
||
-export type WebBrowserResult = { type: WebBrowserResultType, ... }; | ||
+export type WebBrowserResult = { type: WebBrowserResultTypeT, ... }; | ||
|
||
export type WebBrowserRedirectResult = { | ||
type: "success", | ||
-- | ||
2.32.0 | ||
|
Oops, something went wrong.