hybrid-navigation 2.16.11 → 2.17.0

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.
@@ -0,0 +1,9 @@
1
+ #import <UIKit/UIKit.h>
2
+
3
+ NS_ASSUME_NONNULL_BEGIN
4
+
5
+ @interface HBDBackBarButtonItem : UIBarButtonItem
6
+
7
+ @end
8
+
9
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,13 @@
1
+ #import "HBDBackBarButtonItem.h"
2
+
3
+ @implementation HBDBackBarButtonItem
4
+
5
+ - (void)setMenu:(UIMenu *)menu {
6
+ //
7
+ }
8
+
9
+ - (UIMenu *)menu {
10
+ return [super menu];
11
+ }
12
+
13
+ @end
@@ -4,6 +4,7 @@
4
4
  #import "HBDUtils.h"
5
5
  #import "HBDAnimationObserver.h"
6
6
  #import "GlobalStyle.h"
7
+ #import "HBDBackBarButtonItem.h"
7
8
 
8
9
  #import <React/RCTLog.h>
9
10
 
@@ -205,17 +206,16 @@
205
206
  }
206
207
 
207
208
  if ([GlobalStyle globalStyle].isBackTitleHidden) {
209
+ UIBarButtonItem *buttonItem = [[HBDBackBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:NULL];
210
+ self.navigationItem.backBarButtonItem = buttonItem;
208
211
  if (@available(iOS 14.0, *)) {
209
212
  self.navigationItem.backButtonDisplayMode = UINavigationItemBackButtonDisplayModeMinimal;
210
- } else {
211
- UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:NULL];
212
- self.navigationItem.backBarButtonItem = buttonItem;
213
213
  }
214
214
  }
215
215
 
216
216
  NSDictionary *backItem = options[@"backItemIOS"];
217
217
  if (backItem) {
218
- UIBarButtonItem *backButton = [[UIBarButtonItem alloc] init];
218
+ UIBarButtonItem *backButton = [[HBDBackBarButtonItem alloc] init];
219
219
  backButton.title = backItem[@"title"];
220
220
  NSString *tintColor = backItem[@"tintColor"];
221
221
  if (tintColor) {
@@ -1,16 +1,10 @@
1
1
  import React from 'react';
2
- import type { Garden } from './Garden';
3
2
  import type { NavigationItem } from './Options';
4
3
  import { Navigator } from './Navigator';
5
4
  export interface NavigationProps {
6
5
  navigator: Navigator;
7
- garden: Garden;
8
6
  sceneId: string;
9
7
  }
10
- /**
11
- * @deprecated Use NavigationProps instead.
12
- */
13
- export type InjectedProps = NavigationProps;
14
8
  interface NativeProps {
15
9
  sceneId: string;
16
10
  }
@@ -12,7 +12,6 @@ export function withNavigation(moduleName) {
12
12
  if (navigator.moduleName === undefined) {
13
13
  navigator.moduleName = moduleName;
14
14
  }
15
- const garden = navigator.garden;
16
15
  useEffect(() => {
17
16
  Navigation.signalFirstRenderComplete(navigator.sceneId);
18
17
  return () => {
@@ -20,7 +19,6 @@ export function withNavigation(moduleName) {
20
19
  };
21
20
  }, [navigator]);
22
21
  const injected = {
23
- garden,
24
22
  navigator,
25
23
  };
26
24
  return (<NavigationContext.Provider value={navigator}>
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
- import type { Visibility, Layout, BuildInLayout, Route, RouteGraph } from './Route';
2
+ import type { Visibility, Layout, BuildInLayout } from './Route';
3
3
  import type { NavigationItem } from './Options';
4
- import { Garden } from './Garden';
5
- import { NavigationInterceptor, DispatchParams, ResultType } from './Navigation';
4
+ import { ResultType } from './Navigation';
6
5
  export declare const NavigationContext: import("react").Context<any>;
7
6
  interface NavigationState {
8
7
  params: {
@@ -20,47 +19,7 @@ export declare class Navigator implements Navigator {
20
19
  static of(sceneId: string): Navigator;
21
20
  static find(moduleName: string): Promise<Navigator | undefined>;
22
21
  static current(): Promise<Navigator>;
23
- /**
24
- * @deprecated Use Navigation.currentRoute() instead
25
- * @returns
26
- */
27
- static currentRoute(): Promise<Route>;
28
- /**
29
- * @deprecated Use Navigation.routeGraph() instead
30
- * @returns
31
- */
32
- static routeGraph(): Promise<RouteGraph[]>;
33
- /**
34
- * @deprecated Use Navigation.setRoot() instead
35
- * @param layout
36
- * @param sticky
37
- */
38
- static setRoot(layout: BuildInLayout | Layout, sticky?: boolean): void;
39
- /**
40
- * @deprecated Use Navigation.setRootLayoutUpdateListener() instead
41
- * @param willSetRoot
42
- * @param didSetRoot
43
- */
44
- static setRootLayoutUpdateListener(willSetRoot?: () => void, didSetRoot?: () => void): void;
45
- /**
46
- * @deprecated Use Navigation.dispatch() instead
47
- * @param sceneId
48
- * @param action
49
- * @param params
50
- * @returns
51
- */
52
- static dispatch(sceneId: string, action: string, params?: DispatchParams): Promise<boolean>;
53
- /**
54
- * @deprecated Use Navigation.setInterceptor() instead
55
- * @param interceptor
56
- */
57
- static setInterceptor(interceptor: NavigationInterceptor): void;
58
22
  constructor(sceneId: string, moduleName?: string | undefined);
59
- private _garden?;
60
- /**
61
- * @deprecated Garden is deprecated, Use Navigation related methods instead.
62
- */
63
- get garden(): Garden;
64
23
  visibility: Visibility;
65
24
  readonly state: NavigationState;
66
25
  setParams: (params: {
package/lib/Navigator.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { createContext } from 'react';
2
2
  import store from './store';
3
- import { Garden } from './Garden';
4
- import Navigation, { RESULT_CANCEL, } from './Navigation';
3
+ import Navigation, { RESULT_CANCEL } from './Navigation';
5
4
  export const NavigationContext = createContext(null);
6
5
  let tagGenerator = 0;
7
6
  Navigation.addGlobalVisibilityEventListener((sceneId, visibility) => {
@@ -35,67 +34,10 @@ export class Navigator {
35
34
  const route = await Navigation.currentRoute();
36
35
  return Navigator.of(route.sceneId);
37
36
  }
38
- /**
39
- * @deprecated Use Navigation.currentRoute() instead
40
- * @returns
41
- */
42
- static currentRoute() {
43
- return Navigation.currentRoute();
44
- }
45
- /**
46
- * @deprecated Use Navigation.routeGraph() instead
47
- * @returns
48
- */
49
- static routeGraph() {
50
- return Navigation.routeGraph();
51
- }
52
- /**
53
- * @deprecated Use Navigation.setRoot() instead
54
- * @param layout
55
- * @param sticky
56
- */
57
- static setRoot(layout, sticky = false) {
58
- Navigation.setRoot(layout, sticky);
59
- }
60
- /**
61
- * @deprecated Use Navigation.setRootLayoutUpdateListener() instead
62
- * @param willSetRoot
63
- * @param didSetRoot
64
- */
65
- static setRootLayoutUpdateListener(willSetRoot = () => { }, didSetRoot = () => { }) {
66
- Navigation.setRootLayoutUpdateListener(willSetRoot, didSetRoot);
67
- }
68
- /**
69
- * @deprecated Use Navigation.dispatch() instead
70
- * @param sceneId
71
- * @param action
72
- * @param params
73
- * @returns
74
- */
75
- static async dispatch(sceneId, action, params = {}) {
76
- return Navigation.dispatch(sceneId, action, params);
77
- }
78
- /**
79
- * @deprecated Use Navigation.setInterceptor() instead
80
- * @param interceptor
81
- */
82
- static setInterceptor(interceptor) {
83
- Navigation.setInterceptor(interceptor);
84
- }
85
37
  constructor(sceneId, moduleName) {
86
38
  this.sceneId = sceneId;
87
39
  this.moduleName = moduleName;
88
40
  }
89
- _garden;
90
- /**
91
- * @deprecated Garden is deprecated, Use Navigation related methods instead.
92
- */
93
- get garden() {
94
- if (!this._garden) {
95
- this._garden = new Garden(this.sceneId);
96
- }
97
- return this._garden;
98
- }
99
41
  visibility = 'pending';
100
42
  state = {
101
43
  params: {},
package/lib/hooks.d.ts CHANGED
@@ -4,8 +4,3 @@ export declare function useNavigator(): Navigator;
4
4
  export declare function useVisibility(): "visible" | "invisible" | "pending";
5
5
  export declare function useVisible(): boolean;
6
6
  export declare function useVisibleEffect(effect: React.EffectCallback): void;
7
- /**
8
- * @deprecated Use Navigation related methods instead.
9
- * @returns
10
- */
11
- export declare function useGarden(): import("./Garden").Garden;
package/lib/hooks.js CHANGED
@@ -28,11 +28,3 @@ export function useVisibleEffect(effect) {
28
28
  return () => destructor && destructor();
29
29
  }, [effect, visible]);
30
30
  }
31
- /**
32
- * @deprecated Use Navigation related methods instead.
33
- * @returns
34
- */
35
- export function useGarden() {
36
- const ctx = useContext(NavigationContext);
37
- return ctx.garden;
38
- }
package/lib/index.d.ts CHANGED
@@ -3,10 +3,8 @@ export default Navigation;
3
3
  export { RESULT_OK, RESULT_CANCEL } from './Navigation';
4
4
  export { statusBarHeight, toolbarHeight, topBarHeight } from './GardenModule';
5
5
  export { withNavigationItem } from './NavigationComponentWrap';
6
- export type { NavigationProps, InjectedProps } from './NavigationComponentWrap';
6
+ export type { NavigationProps } from './NavigationComponentWrap';
7
7
  export * from './Navigator';
8
- export * from './Garden';
9
- export * from './ReactRegistry';
10
8
  export * from './hooks';
11
9
  export * from './router';
12
10
  export * from './DeepLink';
package/lib/index.js CHANGED
@@ -7,8 +7,6 @@ export { RESULT_OK, RESULT_CANCEL } from './Navigation';
7
7
  export { statusBarHeight, toolbarHeight, topBarHeight } from './GardenModule';
8
8
  export { withNavigationItem } from './NavigationComponentWrap';
9
9
  export * from './Navigator';
10
- export * from './Garden';
11
- export * from './ReactRegistry';
12
10
  export * from './hooks';
13
11
  export * from './router';
14
12
  export * from './DeepLink';
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.11",
4
+ "version": "2.17.0",
5
5
  "main": "./lib/index.js",
6
6
  "typings": "./lib/index.d.ts",
7
7
  "react-native": "src/index",
@@ -1,20 +1,13 @@
1
1
  import React, { useEffect } from 'react'
2
- import type { Garden } from './Garden'
3
2
  import type { NavigationItem } from './Options'
4
3
  import { Navigator, NavigationContext } from './Navigator'
5
4
  import Navigation from './Navigation'
6
5
 
7
6
  export interface NavigationProps {
8
7
  navigator: Navigator
9
- garden: Garden
10
8
  sceneId: string
11
9
  }
12
10
 
13
- /**
14
- * @deprecated Use NavigationProps instead.
15
- */
16
- export type InjectedProps = NavigationProps
17
-
18
11
  interface NativeProps {
19
12
  sceneId: string
20
13
  }
@@ -33,8 +26,6 @@ export function withNavigation(moduleName: string) {
33
26
  navigator.moduleName = moduleName
34
27
  }
35
28
 
36
- const garden = navigator.garden
37
-
38
29
  useEffect(() => {
39
30
  Navigation.signalFirstRenderComplete(navigator.sceneId)
40
31
  return () => {
@@ -43,7 +34,6 @@ export function withNavigation(moduleName: string) {
43
34
  }, [navigator])
44
35
 
45
36
  const injected = {
46
- garden,
47
37
  navigator,
48
38
  }
49
39
 
package/src/Navigator.ts CHANGED
@@ -1,15 +1,9 @@
1
1
  import { createContext } from 'react'
2
2
 
3
3
  import store from './store'
4
- import type { Visibility, Layout, BuildInLayout, Route, RouteGraph } from './Route'
4
+ import type { Visibility, Layout, BuildInLayout } from './Route'
5
5
  import type { NavigationItem } from './Options'
6
- import { Garden } from './Garden'
7
- import Navigation, {
8
- NavigationInterceptor,
9
- DispatchParams,
10
- ResultType,
11
- RESULT_CANCEL,
12
- } from './Navigation'
6
+ import Navigation, { ResultType, RESULT_CANCEL } from './Navigation'
13
7
 
14
8
  export const NavigationContext = createContext<any>(null)
15
9
 
@@ -59,77 +53,8 @@ export class Navigator implements Navigator {
59
53
  return Navigator.of(route.sceneId)
60
54
  }
61
55
 
62
- /**
63
- * @deprecated Use Navigation.currentRoute() instead
64
- * @returns
65
- */
66
- static currentRoute(): Promise<Route> {
67
- return Navigation.currentRoute()
68
- }
69
-
70
- /**
71
- * @deprecated Use Navigation.routeGraph() instead
72
- * @returns
73
- */
74
- static routeGraph(): Promise<RouteGraph[]> {
75
- return Navigation.routeGraph()
76
- }
77
-
78
- /**
79
- * @deprecated Use Navigation.setRoot() instead
80
- * @param layout
81
- * @param sticky
82
- */
83
- static setRoot(layout: BuildInLayout | Layout, sticky = false) {
84
- Navigation.setRoot(layout, sticky)
85
- }
86
-
87
- /**
88
- * @deprecated Use Navigation.setRootLayoutUpdateListener() instead
89
- * @param willSetRoot
90
- * @param didSetRoot
91
- */
92
- static setRootLayoutUpdateListener(willSetRoot = () => {}, didSetRoot = () => {}) {
93
- Navigation.setRootLayoutUpdateListener(willSetRoot, didSetRoot)
94
- }
95
-
96
- /**
97
- * @deprecated Use Navigation.dispatch() instead
98
- * @param sceneId
99
- * @param action
100
- * @param params
101
- * @returns
102
- */
103
- static async dispatch(
104
- sceneId: string,
105
- action: string,
106
- params: DispatchParams = {},
107
- ): Promise<boolean> {
108
- return Navigation.dispatch(sceneId, action, params)
109
- }
110
-
111
- /**
112
- * @deprecated Use Navigation.setInterceptor() instead
113
- * @param interceptor
114
- */
115
- static setInterceptor(interceptor: NavigationInterceptor) {
116
- Navigation.setInterceptor(interceptor)
117
- }
118
-
119
56
  constructor(public sceneId: string, public moduleName?: string) {}
120
57
 
121
- private _garden?: Garden
122
-
123
- /**
124
- * @deprecated Garden is deprecated, Use Navigation related methods instead.
125
- */
126
- get garden() {
127
- if (!this._garden) {
128
- this._garden = new Garden(this.sceneId)
129
- }
130
- return this._garden
131
- }
132
-
133
58
  visibility: Visibility = 'pending'
134
59
 
135
60
  readonly state: NavigationState = {
package/src/hooks.ts CHANGED
@@ -33,12 +33,3 @@ export function useVisibleEffect(effect: React.EffectCallback) {
33
33
  return () => destructor && destructor()
34
34
  }, [effect, visible])
35
35
  }
36
-
37
- /**
38
- * @deprecated Use Navigation related methods instead.
39
- * @returns
40
- */
41
- export function useGarden() {
42
- const ctx = useContext<Navigator>(NavigationContext)
43
- return ctx.garden
44
- }
package/src/index.ts CHANGED
@@ -6,11 +6,9 @@ export default Navigation
6
6
  export { RESULT_OK, RESULT_CANCEL } from './Navigation'
7
7
  export { statusBarHeight, toolbarHeight, topBarHeight } from './GardenModule'
8
8
  export { withNavigationItem } from './NavigationComponentWrap'
9
- export type { NavigationProps, InjectedProps } from './NavigationComponentWrap'
9
+ export type { NavigationProps } from './NavigationComponentWrap'
10
10
 
11
11
  export * from './Navigator'
12
- export * from './Garden'
13
- export * from './ReactRegistry'
14
12
  export * from './hooks'
15
13
  export * from './router'
16
14
  export * from './DeepLink'
package/lib/Garden.d.ts DELETED
@@ -1,65 +0,0 @@
1
- import type { BarButtonItem, DefaultOptions, NavigationOption, TabBarStyle, TabItemInfo, TitleItem } from './Options';
2
- type Nullable<T> = {
3
- [P in keyof T]: T[P] extends T[P] | undefined ? T[P] | null : T[P];
4
- };
5
- export interface Garden {
6
- }
7
- /**
8
- * @deprecated use Navigation instead. import Navigation from 'hybrid-navigation'
9
- */
10
- export declare class Garden implements Garden {
11
- sceneId: string;
12
- /**
13
- * @deprecated Use Navigation.setDefaultOptions() instead.
14
- * @param style
15
- */
16
- static setStyle(style: DefaultOptions): void;
17
- constructor(sceneId: string);
18
- /**
19
- * @deprecated Use Navigation.setLeftBarButtonItem() instead.
20
- * @param buttonItem
21
- */
22
- setLeftBarButtonItem(buttonItem: Nullable<BarButtonItem> | null): void;
23
- /**
24
- * @deprecated Use Navigation.setRightBarButtonItem() instead.
25
- * @param buttonItem
26
- */
27
- setRightBarButtonItem(buttonItem: Nullable<BarButtonItem> | null): void;
28
- /**
29
- *
30
- * @deprecated Use Navigation.setLeftBarButtonItems() instead.
31
- * @param buttonItems
32
- */
33
- setLeftBarButtonItems(buttonItems: Array<Nullable<BarButtonItem>> | null): void;
34
- /**
35
- * @deprecated Use Navigation.setRightBarButtonItems() instead.
36
- * @param buttonItems
37
- */
38
- setRightBarButtonItems(buttonItems: Array<Nullable<BarButtonItem>> | null): void;
39
- /**
40
- * @deprecated Use Navigation.setTitleItem() instead.
41
- * @param titleItem
42
- */
43
- setTitleItem(titleItem: TitleItem): void;
44
- /**
45
- * @deprecated Use Navigation.updateOptions() instead.
46
- * @param options
47
- */
48
- updateOptions(options: NavigationOption): void;
49
- /**
50
- * @deprecated Use Navigation.updateTabBar() instead.
51
- * @param options
52
- */
53
- updateTabBar(options: TabBarStyle): void;
54
- /**
55
- * @deprecated Use Navigation.setTabItem() instead.
56
- * @param item
57
- */
58
- setTabItem(item: TabItemInfo | TabItemInfo[]): void;
59
- /**
60
- * @deprecated Use Navigation.setMenuInteractive() instead.
61
- * @param enabled
62
- */
63
- setMenuInteractive(enabled: boolean): void;
64
- }
65
- export {};
package/lib/Garden.js DELETED
@@ -1,81 +0,0 @@
1
- import Navigation from './Navigation';
2
- /**
3
- * @deprecated use Navigation instead. import Navigation from 'hybrid-navigation'
4
- */
5
- export class Garden {
6
- sceneId;
7
- /**
8
- * @deprecated Use Navigation.setDefaultOptions() instead.
9
- * @param style
10
- */
11
- static setStyle(style) {
12
- Navigation.setDefaultOptions(style);
13
- }
14
- constructor(sceneId) {
15
- this.sceneId = sceneId;
16
- }
17
- /**
18
- * @deprecated Use Navigation.setLeftBarButtonItem() instead.
19
- * @param buttonItem
20
- */
21
- setLeftBarButtonItem(buttonItem) {
22
- Navigation.setLeftBarButtonItem(this.sceneId, buttonItem);
23
- }
24
- /**
25
- * @deprecated Use Navigation.setRightBarButtonItem() instead.
26
- * @param buttonItem
27
- */
28
- setRightBarButtonItem(buttonItem) {
29
- Navigation.setRightBarButtonItem(this.sceneId, buttonItem);
30
- }
31
- /**
32
- *
33
- * @deprecated Use Navigation.setLeftBarButtonItems() instead.
34
- * @param buttonItems
35
- */
36
- setLeftBarButtonItems(buttonItems) {
37
- Navigation.setLeftBarButtonItems(this.sceneId, buttonItems);
38
- }
39
- /**
40
- * @deprecated Use Navigation.setRightBarButtonItems() instead.
41
- * @param buttonItems
42
- */
43
- setRightBarButtonItems(buttonItems) {
44
- Navigation.setRightBarButtonItems(this.sceneId, buttonItems);
45
- }
46
- /**
47
- * @deprecated Use Navigation.setTitleItem() instead.
48
- * @param titleItem
49
- */
50
- setTitleItem(titleItem) {
51
- Navigation.setTitleItem(this.sceneId, titleItem);
52
- }
53
- /**
54
- * @deprecated Use Navigation.updateOptions() instead.
55
- * @param options
56
- */
57
- updateOptions(options) {
58
- Navigation.updateOptions(this.sceneId, options);
59
- }
60
- /**
61
- * @deprecated Use Navigation.updateTabBar() instead.
62
- * @param options
63
- */
64
- updateTabBar(options) {
65
- Navigation.updateTabBar(this.sceneId, options);
66
- }
67
- /**
68
- * @deprecated Use Navigation.setTabItem() instead.
69
- * @param item
70
- */
71
- setTabItem(item) {
72
- Navigation.setTabItem(this.sceneId, item);
73
- }
74
- /**
75
- * @deprecated Use Navigation.setMenuInteractive() instead.
76
- * @param enabled
77
- */
78
- setMenuInteractive(enabled) {
79
- Navigation.setMenuInteractive(this.sceneId, enabled);
80
- }
81
- }
@@ -1,25 +0,0 @@
1
- import { ComponentProvider } from 'react-native';
2
- import type { RouteConfig } from './Route';
3
- import { HOC } from './Navigation';
4
- /**
5
- * @deprecated use Navigation instead. import Navigation from 'hybrid-navigation'
6
- */
7
- export declare class ReactRegistry {
8
- /**
9
- * @deprecated Use Navigation.startRegisterComponent() instead.
10
- * @param hoc
11
- */
12
- static startRegisterComponent(hoc?: HOC): void;
13
- /**
14
- * @deprecated Use Navigation.endRegisterComponent() instead.
15
- */
16
- static endRegisterComponent(): void;
17
- /**
18
- *
19
- * @deprecated Use Navigation.registerComponent() instead.
20
- * @param appKey
21
- * @param getComponentFunc
22
- * @param routeConfig
23
- */
24
- static registerComponent(appKey: string, getComponentFunc: ComponentProvider, routeConfig?: RouteConfig): void;
25
- }
@@ -1,29 +0,0 @@
1
- import Navigation from './Navigation';
2
- /**
3
- * @deprecated use Navigation instead. import Navigation from 'hybrid-navigation'
4
- */
5
- export class ReactRegistry {
6
- /**
7
- * @deprecated Use Navigation.startRegisterComponent() instead.
8
- * @param hoc
9
- */
10
- static startRegisterComponent(hoc) {
11
- Navigation.startRegisterComponent(hoc);
12
- }
13
- /**
14
- * @deprecated Use Navigation.endRegisterComponent() instead.
15
- */
16
- static endRegisterComponent() {
17
- Navigation.endRegisterComponent();
18
- }
19
- /**
20
- *
21
- * @deprecated Use Navigation.registerComponent() instead.
22
- * @param appKey
23
- * @param getComponentFunc
24
- * @param routeConfig
25
- */
26
- static registerComponent(appKey, getComponentFunc, routeConfig) {
27
- Navigation.registerComponent(appKey, getComponentFunc, routeConfig);
28
- }
29
- }
package/src/Garden.ts DELETED
@@ -1,103 +0,0 @@
1
- import Navigation from './Navigation'
2
- import type {
3
- BarButtonItem,
4
- DefaultOptions,
5
- NavigationOption,
6
- TabBarStyle,
7
- TabItemInfo,
8
- TitleItem,
9
- } from './Options'
10
-
11
- type Nullable<T> = {
12
- [P in keyof T]: T[P] extends T[P] | undefined ? T[P] | null : T[P]
13
- }
14
-
15
- export interface Garden {}
16
-
17
- /**
18
- * @deprecated use Navigation instead. import Navigation from 'hybrid-navigation'
19
- */
20
- export class Garden implements Garden {
21
- /**
22
- * @deprecated Use Navigation.setDefaultOptions() instead.
23
- * @param style
24
- */
25
- static setStyle(style: DefaultOptions) {
26
- Navigation.setDefaultOptions(style)
27
- }
28
-
29
- constructor(public sceneId: string) {}
30
-
31
- /**
32
- * @deprecated Use Navigation.setLeftBarButtonItem() instead.
33
- * @param buttonItem
34
- */
35
- setLeftBarButtonItem(buttonItem: Nullable<BarButtonItem> | null) {
36
- Navigation.setLeftBarButtonItem(this.sceneId, buttonItem)
37
- }
38
-
39
- /**
40
- * @deprecated Use Navigation.setRightBarButtonItem() instead.
41
- * @param buttonItem
42
- */
43
- setRightBarButtonItem(buttonItem: Nullable<BarButtonItem> | null) {
44
- Navigation.setRightBarButtonItem(this.sceneId, buttonItem)
45
- }
46
-
47
- /**
48
- *
49
- * @deprecated Use Navigation.setLeftBarButtonItems() instead.
50
- * @param buttonItems
51
- */
52
- setLeftBarButtonItems(buttonItems: Array<Nullable<BarButtonItem>> | null) {
53
- Navigation.setLeftBarButtonItems(this.sceneId, buttonItems)
54
- }
55
-
56
- /**
57
- * @deprecated Use Navigation.setRightBarButtonItems() instead.
58
- * @param buttonItems
59
- */
60
- setRightBarButtonItems(buttonItems: Array<Nullable<BarButtonItem>> | null) {
61
- Navigation.setRightBarButtonItems(this.sceneId, buttonItems)
62
- }
63
-
64
- /**
65
- * @deprecated Use Navigation.setTitleItem() instead.
66
- * @param titleItem
67
- */
68
- setTitleItem(titleItem: TitleItem) {
69
- Navigation.setTitleItem(this.sceneId, titleItem)
70
- }
71
-
72
- /**
73
- * @deprecated Use Navigation.updateOptions() instead.
74
- * @param options
75
- */
76
- updateOptions(options: NavigationOption) {
77
- Navigation.updateOptions(this.sceneId, options)
78
- }
79
-
80
- /**
81
- * @deprecated Use Navigation.updateTabBar() instead.
82
- * @param options
83
- */
84
- updateTabBar(options: TabBarStyle) {
85
- Navigation.updateTabBar(this.sceneId, options)
86
- }
87
-
88
- /**
89
- * @deprecated Use Navigation.setTabItem() instead.
90
- * @param item
91
- */
92
- setTabItem(item: TabItemInfo | TabItemInfo[]) {
93
- Navigation.setTabItem(this.sceneId, item)
94
- }
95
-
96
- /**
97
- * @deprecated Use Navigation.setMenuInteractive() instead.
98
- * @param enabled
99
- */
100
- setMenuInteractive(enabled: boolean) {
101
- Navigation.setMenuInteractive(this.sceneId, enabled)
102
- }
103
- }
@@ -1,39 +0,0 @@
1
- import { ComponentProvider } from 'react-native'
2
- import type { RouteConfig } from './Route'
3
-
4
- import Navigation, { HOC } from './Navigation'
5
-
6
- /**
7
- * @deprecated use Navigation instead. import Navigation from 'hybrid-navigation'
8
- */
9
- export class ReactRegistry {
10
- /**
11
- * @deprecated Use Navigation.startRegisterComponent() instead.
12
- * @param hoc
13
- */
14
- static startRegisterComponent(hoc?: HOC) {
15
- Navigation.startRegisterComponent(hoc)
16
- }
17
-
18
- /**
19
- * @deprecated Use Navigation.endRegisterComponent() instead.
20
- */
21
- static endRegisterComponent() {
22
- Navigation.endRegisterComponent()
23
- }
24
-
25
- /**
26
- *
27
- * @deprecated Use Navigation.registerComponent() instead.
28
- * @param appKey
29
- * @param getComponentFunc
30
- * @param routeConfig
31
- */
32
- static registerComponent(
33
- appKey: string,
34
- getComponentFunc: ComponentProvider,
35
- routeConfig?: RouteConfig,
36
- ) {
37
- Navigation.registerComponent(appKey, getComponentFunc, routeConfig)
38
- }
39
- }