hybrid-navigation 2.16.1 → 2.16.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,16 +17,30 @@ export type NavigationSubscription = {
17
17
  };
18
18
  export type HOC = (WrappedComponent: React.ComponentType<any>) => React.ComponentType<any>;
19
19
  export interface Navigation {
20
+ }
21
+ declare class NavigationImpl implements Navigation {
22
+ private dispatchHandler;
23
+ private resultHandler;
24
+ private buttonHandler;
25
+ private layoutHandler;
26
+ private visibilityHandler;
27
+ constructor();
28
+ private wrap?;
29
+ private hoc?;
30
+ private registerEnded;
20
31
  startRegisterComponent(hoc?: HOC): void;
21
32
  endRegisterComponent(): void;
22
33
  registerComponent(appKey: string, getComponentFunc: ComponentProvider, routeConfig?: RouteConfig): void;
34
+ private _routeConfigs;
35
+ private registerRoute;
23
36
  routeConfigs(): Map<string, RouteConfig>;
24
37
  setNavigationComponentWrap(wrap: (moduleName: string) => HOC): void;
25
38
  addGlobalVisibilityEventListener(listener: GlobalVisibilityEventListener): NavigationSubscription;
26
39
  addVisibilityEventListener(sceneId: string, listener: VisibilityEventListener): NavigationSubscription;
27
40
  dispatch(sceneId: string, action: string, params?: DispatchParams): Promise<boolean>;
41
+ private handleTabSwitch;
28
42
  setInterceptor(interceptor: NavigationInterceptor): void;
29
- setResult<T extends ResultType>(sceneId: string, resultCode: number, data?: T): void;
43
+ setResult: <T extends ResultType>(sceneId: string, resultCode: number, data?: T) => void;
30
44
  result<T extends ResultType>(sceneId: string, resultCode: number): Promise<[number, T]>;
31
45
  unmount(sceneId: string): void;
32
46
  setRoot(layout: BuildInLayout | Layout, sticky?: boolean): Promise<boolean>;
@@ -48,6 +62,7 @@ export interface Navigation {
48
62
  setTabItem(sceneId: string, item: TabItemInfo | TabItemInfo[]): void;
49
63
  setMenuInteractive(sceneId: string, enabled: boolean): void;
50
64
  setBarButtonClickEventListener(listener: BarButtonClickEventListener): void;
65
+ private bindBarButtonClickEvent;
51
66
  }
52
- declare const _default: Navigation;
67
+ declare const _default: NavigationImpl;
53
68
  export default _default;
package/lib/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import Navigation from './Navigation';
1
+ import navigation from './Navigation';
2
+ declare const Navigation: typeof navigation;
2
3
  export default Navigation;
3
4
  export { RESULT_OK, RESULT_CANCEL } from './Navigation';
4
5
  export { statusBarHeight, toolbarHeight, topBarHeight } from './GardenModule';
package/lib/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { withNavigation } from './NavigationComponentWrap';
2
- import Navigation from './Navigation';
3
- Navigation.setNavigationComponentWrap(withNavigation);
2
+ import navigation from './Navigation';
3
+ navigation.setNavigationComponentWrap(withNavigation);
4
+ const Navigation = navigation;
4
5
  export default Navigation;
5
6
  export { RESULT_OK, RESULT_CANCEL } from './Navigation';
6
7
  export { statusBarHeight, toolbarHeight, topBarHeight } from './GardenModule';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hybrid-navigation",
3
3
  "description": "React Native Navigation that supports seamless navigation between Native and React.",
4
- "version": "2.16.1",
4
+ "version": "2.16.2-beta.1",
5
5
  "main": "./lib/index.js",
6
6
  "typings": "./lib/index.d.ts",
7
7
  "react-native": "src/index",
package/src/Navigation.ts CHANGED
@@ -43,45 +43,44 @@ export type NavigationSubscription = {
43
43
  export type HOC = (WrappedComponent: React.ComponentType<any>) => React.ComponentType<any>
44
44
 
45
45
  export interface Navigation {
46
- startRegisterComponent(hoc?: HOC): void
47
- endRegisterComponent(): void
48
- registerComponent(
49
- appKey: string,
50
- getComponentFunc: ComponentProvider,
51
- routeConfig?: RouteConfig,
52
- ): void
53
-
54
- routeConfigs(): Map<string, RouteConfig>
55
- setNavigationComponentWrap(wrap: (moduleName: string) => HOC): void
56
- addGlobalVisibilityEventListener(listener: GlobalVisibilityEventListener): NavigationSubscription
57
- addVisibilityEventListener(
58
- sceneId: string,
59
- listener: VisibilityEventListener,
60
- ): NavigationSubscription
61
- dispatch(sceneId: string, action: string, params?: DispatchParams): Promise<boolean>
62
- setInterceptor(interceptor: NavigationInterceptor): void
63
- setResult<T extends ResultType>(sceneId: string, resultCode: number, data?: T): void
64
- result<T extends ResultType>(sceneId: string, resultCode: number): Promise<[number, T]>
65
- unmount(sceneId: string): void
66
- setRoot(layout: BuildInLayout | Layout, sticky?: boolean): Promise<boolean>
67
- setRootLayoutUpdateListener(willSetRoot?: () => void, didSetRoot?: () => void): void
68
- currentTab(sceneId: string): Promise<number>
69
- findSceneIdByModuleName(moduleName: string): Promise<string | null>
70
- isStackRoot(sceneId: string): Promise<boolean>
71
- signalFirstRenderComplete(sceneId: string): void
72
- currentRoute(): Promise<Route>
73
- routeGraph(): Promise<RouteGraph[]>
74
- setDefaultOptions(options: DefaultOptions): void
75
- setLeftBarButtonItem(sceneId: string, buttonItem: Nullable<BarButtonItem> | null): void
76
- setRightBarButtonItem(sceneId: string, buttonItem: Nullable<BarButtonItem> | null): void
77
- setLeftBarButtonItems(sceneId: string, buttonItems: Array<Nullable<BarButtonItem>> | null): void
78
- setRightBarButtonItems(sceneId: string, buttonItems: Array<Nullable<BarButtonItem>> | null): void
79
- setTitleItem(sceneId: string, titleItem: TitleItem): void
80
- updateOptions(sceneId: string, options: NavigationOption): void
81
- updateTabBar(sceneId: string, options: TabBarStyle): void
82
- setTabItem(sceneId: string, item: TabItemInfo | TabItemInfo[]): void
83
- setMenuInteractive(sceneId: string, enabled: boolean): void
84
- setBarButtonClickEventListener(listener: BarButtonClickEventListener): void
46
+ // startRegisterComponent(hoc?: HOC): void
47
+ // endRegisterComponent(): void
48
+ // registerComponent(
49
+ // appKey: string,
50
+ // getComponentFunc: ComponentProvider,
51
+ // routeConfig?: RouteConfig,
52
+ // ): void
53
+ // routeConfigs(): Map<string, RouteConfig>
54
+ // setNavigationComponentWrap(wrap: (moduleName: string) => HOC): void
55
+ // addGlobalVisibilityEventListener(listener: GlobalVisibilityEventListener): NavigationSubscription
56
+ // addVisibilityEventListener(
57
+ // sceneId: string,
58
+ // listener: VisibilityEventListener,
59
+ // ): NavigationSubscription
60
+ // dispatch(sceneId: string, action: string, params?: DispatchParams): Promise<boolean>
61
+ // setInterceptor(interceptor: NavigationInterceptor): void
62
+ // setResult<T extends ResultType>(sceneId: string, resultCode: number, data?: T): void
63
+ // result<T extends ResultType>(sceneId: string, resultCode: number): Promise<[number, T]>
64
+ // unmount(sceneId: string): void
65
+ // setRoot(layout: BuildInLayout | Layout, sticky?: boolean): Promise<boolean>
66
+ // setRootLayoutUpdateListener(willSetRoot?: () => void, didSetRoot?: () => void): void
67
+ // currentTab(sceneId: string): Promise<number>
68
+ // findSceneIdByModuleName(moduleName: string): Promise<string | null>
69
+ // isStackRoot(sceneId: string): Promise<boolean>
70
+ // signalFirstRenderComplete(sceneId: string): void
71
+ // currentRoute(): Promise<Route>
72
+ // routeGraph(): Promise<RouteGraph[]>
73
+ // setDefaultOptions(options: DefaultOptions): void
74
+ // setLeftBarButtonItem(sceneId: string, buttonItem: Nullable<BarButtonItem> | null): void
75
+ // setRightBarButtonItem(sceneId: string, buttonItem: Nullable<BarButtonItem> | null): void
76
+ // setLeftBarButtonItems(sceneId: string, buttonItems: Array<Nullable<BarButtonItem>> | null): void
77
+ // setRightBarButtonItems(sceneId: string, buttonItems: Array<Nullable<BarButtonItem>> | null): void
78
+ // setTitleItem(sceneId: string, titleItem: TitleItem): void
79
+ // updateOptions(sceneId: string, options: NavigationOption): void
80
+ // updateTabBar(sceneId: string, options: TabBarStyle): void
81
+ // setTabItem(sceneId: string, item: TabItemInfo | TabItemInfo[]): void
82
+ // setMenuInteractive(sceneId: string, enabled: boolean): void
83
+ // setBarButtonClickEventListener(listener: BarButtonClickEventListener): void
85
84
  }
86
85
 
87
86
  class NavigationImpl implements Navigation {
@@ -290,4 +289,4 @@ class NavigationImpl implements Navigation {
290
289
  }
291
290
  }
292
291
 
293
- export default new NavigationImpl() as Navigation
292
+ export default new NavigationImpl()
package/src/index.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { withNavigation } from './NavigationComponentWrap'
2
- import Navigation from './Navigation'
3
-
4
- Navigation.setNavigationComponentWrap(withNavigation)
5
-
2
+ import navigation from './Navigation'
3
+ navigation.setNavigationComponentWrap(withNavigation)
4
+ const Navigation: typeof navigation = navigation
6
5
  export default Navigation
7
6
  export { RESULT_OK, RESULT_CANCEL } from './Navigation'
8
7
  export { statusBarHeight, toolbarHeight, topBarHeight } from './GardenModule'