From 74e68b4f1234803ff77e021ce68ee5d2264ab3f4 Mon Sep 17 00:00:00 2001 From: Phil Nova Date: Tue, 5 Jun 2018 15:56:19 -0700 Subject: [PATCH 1/3] Put openURL under CustomTabs namespace --- types/react-native-custom-tabs/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/react-native-custom-tabs/index.d.ts b/types/react-native-custom-tabs/index.d.ts index ed74ff4303..5e0754c546 100644 --- a/types/react-native-custom-tabs/index.d.ts +++ b/types/react-native-custom-tabs/index.d.ts @@ -19,4 +19,6 @@ export interface CustomTabsOptions { headers?: any; } -export function openURL(url: string, options?: CustomTabsOptions): Promise; +declare namespace CustomTabs { + function openURL(url: string, options?: CustomTabsOptions): Promise; +} From d48e6d5e3b697ced4ebf52c5328baf0effbf197a Mon Sep 17 00:00:00 2001 From: Phil Nova Date: Tue, 5 Jun 2018 16:03:51 -0700 Subject: [PATCH 2/3] Update tests --- .../react-native-custom-tabs/react-native-custom-tabs-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native-custom-tabs/react-native-custom-tabs-tests.ts b/types/react-native-custom-tabs/react-native-custom-tabs-tests.ts index 86dad3b3ee..f300f79d35 100644 --- a/types/react-native-custom-tabs/react-native-custom-tabs-tests.ts +++ b/types/react-native-custom-tabs/react-native-custom-tabs-tests.ts @@ -7,4 +7,4 @@ const rnt: ReactNativeCustomTabs.CustomTabsOptions = { enableDefaultShare: true, }; -const url: Promise = ReactNativeCustomTabs.openURL('testurl.com', rnt); +const url: Promise = ReactNativeCustomTabs.CustomTabs.openURL('testurl.com', rnt); From 80e5beb6eb60c2e9a1edb75c4df1ee8545147ebe Mon Sep 17 00:00:00 2001 From: Phil Nova Date: Tue, 5 Jun 2018 17:32:19 -0700 Subject: [PATCH 3/3] Prefer export to declare --- types/react-native-custom-tabs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native-custom-tabs/index.d.ts b/types/react-native-custom-tabs/index.d.ts index 5e0754c546..42fd1cdf78 100644 --- a/types/react-native-custom-tabs/index.d.ts +++ b/types/react-native-custom-tabs/index.d.ts @@ -19,6 +19,6 @@ export interface CustomTabsOptions { headers?: any; } -declare namespace CustomTabs { +export namespace CustomTabs { function openURL(url: string, options?: CustomTabsOptions): Promise; }