From 5f56a0a59ff6eb7e095ff61c3c4a9bcd84226653 Mon Sep 17 00:00:00 2001 From: Jason Merino Date: Wed, 6 Jun 2018 07:56:33 -0700 Subject: [PATCH 1/4] Adds more id types and type prop to react-native-navigation NavigatorEvent. --- types/react-native-navigation/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-native-navigation/index.d.ts b/types/react-native-navigation/index.d.ts index 3edf071e98..c4a7a4419d 100644 --- a/types/react-native-navigation/index.d.ts +++ b/types/react-native-navigation/index.d.ts @@ -119,7 +119,8 @@ export interface LightBox { } export interface NavigatorEvent { - id: 'willAppear' | 'didAppear' | 'willDisappear' | 'didDisappear' | 'willCommitPreview' | 'backPress'; + id: 'willAppear' | 'didAppear' | 'willDisappear' | 'didDisappear' | 'willCommitPreview' | 'backPress' | 'bottomTabSelected' | 'bottomTabReselected' | string; + type: 'NavBarButtonPress' | 'DeepLink'; } export class Navigator { From 87529593e42c702a8033e8dd93616a7da7828e70 Mon Sep 17 00:00:00 2001 From: Jason Merino Date: Wed, 6 Jun 2018 08:12:09 -0700 Subject: [PATCH 2/4] Add tests. --- types/react-native-navigation/index.d.ts | 1 + types/react-native-navigation/react-native-navigation-tests.tsx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/types/react-native-navigation/index.d.ts b/types/react-native-navigation/index.d.ts index c4a7a4419d..cf2225a0a3 100644 --- a/types/react-native-navigation/index.d.ts +++ b/types/react-native-navigation/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for react-native-navigation 1.1 // Project: https://github.com/wix/react-native-navigation // Definitions by: Egor Shulga +// Jason Merino // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/react-native-navigation/react-native-navigation-tests.tsx b/types/react-native-navigation/react-native-navigation-tests.tsx index e99bfd47dc..91ab4088e8 100644 --- a/types/react-native-navigation/react-native-navigation-tests.tsx +++ b/types/react-native-navigation/react-native-navigation-tests.tsx @@ -20,6 +20,8 @@ class Screen1 extends React.Component { onNavigatorEvent = (event: NavigatorEvent) => { if (event.id === 'willAppear') { console.log('will appear'); + } else if (event.type === 'NavBarButtonPress' && event.id === 'sideMenu') { + console.log('side menu pressed'); } } From 12beafcc7d2f5c14ee8a7d034817c2d410ee7638 Mon Sep 17 00:00:00 2001 From: Jason Merino Date: Wed, 6 Jun 2018 08:23:18 -0700 Subject: [PATCH 3/4] Bumps version number. --- types/react-native-navigation/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native-navigation/index.d.ts b/types/react-native-navigation/index.d.ts index cf2225a0a3..fa23a9cb79 100644 --- a/types/react-native-navigation/index.d.ts +++ b/types/react-native-navigation/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-native-navigation 1.1 +// Type definitions for react-native-navigation 1.1.1 // Project: https://github.com/wix/react-native-navigation // Definitions by: Egor Shulga // Jason Merino From 2a35196c9234ec4ee5226bedd873aae07dfa17b1 Mon Sep 17 00:00:00 2001 From: Jason Merino Date: Wed, 6 Jun 2018 08:25:35 -0700 Subject: [PATCH 4/4] Undo version bump. --- types/react-native-navigation/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native-navigation/index.d.ts b/types/react-native-navigation/index.d.ts index fa23a9cb79..cf2225a0a3 100644 --- a/types/react-native-navigation/index.d.ts +++ b/types/react-native-navigation/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-native-navigation 1.1.1 +// Type definitions for react-native-navigation 1.1 // Project: https://github.com/wix/react-native-navigation // Definitions by: Egor Shulga // Jason Merino