hybrid-navigation 2.17.11 → 2.18.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.
- package/android/src/main/java/com/reactnative/hybridnavigation/NavigationModule.java +6 -5
- package/ios/HybridNavigation/Navigator/HBDDrawerNavigator.m +0 -5
- package/ios/HybridNavigation/Navigator/HBDScreenNavigator.m +11 -5
- package/ios/HybridNavigation/Navigator/HBDStackNavigator.m +0 -6
- package/ios/HybridNavigation/Navigator/HBDTabNavigator.m +0 -5
- package/ios/HybridNavigation/ReactBridge/HBDNavigationModule.m +3 -1
- package/ios/HybridNavigation/ViewController/HBDReactViewController.m +2 -2
- package/ios/HybridNavigation/ViewController/UIViewController+HBD.h +2 -2
- package/ios/HybridNavigation/ViewController/UIViewController+HBD.m +7 -21
- package/lib/Route.d.ts +1 -0
- package/lib/handler/ResultEventHandler.d.ts +1 -1
- package/lib/handler/ResultEventHandler.js +18 -16
- package/package.json +1 -1
- package/src/Route.ts +1 -0
- package/src/handler/ResultEventHandler.ts +20 -16
|
@@ -91,7 +91,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
|
91
91
|
if (activity == null) {
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
|
|
95
95
|
activity.scheduleTaskAtStarted(() -> {
|
|
96
96
|
AwesomeFragment fragment = findFragmentBySceneId(sceneId);
|
|
97
97
|
if (fragment instanceof ReactFragment) {
|
|
@@ -166,7 +166,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
|
166
166
|
callback.invoke(null, -1);
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
|
-
|
|
169
|
+
|
|
170
170
|
activity.scheduleTaskAtStarted(() -> {
|
|
171
171
|
AwesomeFragment fragment = findFragmentBySceneId(sceneId);
|
|
172
172
|
if (fragment == null) {
|
|
@@ -193,7 +193,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
|
193
193
|
callback.invoke(null, -1);
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
|
|
197
197
|
activity.scheduleTaskAtStarted(() -> {
|
|
198
198
|
AwesomeFragment fragment = findFragmentBySceneId(sceneId);
|
|
199
199
|
if (fragment == null) {
|
|
@@ -225,7 +225,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
|
225
225
|
UiThreadUtil.runOnUiThread(this, 16);
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
|
-
|
|
228
|
+
|
|
229
229
|
activity.scheduleTaskAtStarted(() -> {
|
|
230
230
|
FragmentManager fragmentManager = activity.getSupportFragmentManager();
|
|
231
231
|
Fragment fragment = fragmentManager.findFragmentById(android.R.id.content);
|
|
@@ -300,6 +300,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
|
300
300
|
bundle.putString("moduleName", current.getModuleName());
|
|
301
301
|
bundle.putString("sceneId", current.getSceneId());
|
|
302
302
|
bundle.putString("mode", Navigator.Util.getMode(current));
|
|
303
|
+
bundle.putInt("requestCode", current.getRequestCode());
|
|
303
304
|
callback.invoke(null, Arguments.fromBundle(bundle));
|
|
304
305
|
});
|
|
305
306
|
}
|
|
@@ -318,7 +319,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
|
318
319
|
UiThreadUtil.runOnUiThread(this, 16);
|
|
319
320
|
return;
|
|
320
321
|
}
|
|
321
|
-
|
|
322
|
+
|
|
322
323
|
activity.scheduleTaskAtStarted(() -> {
|
|
323
324
|
FragmentManager fragmentManager = activity.getSupportFragmentManager();
|
|
324
325
|
ArrayList<Bundle> graph = bridgeManager.buildRouteGraph(fragmentManager);
|
|
@@ -83,11 +83,6 @@
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
- (void)handleNavigationWithViewController:(UIViewController *)vc action:(NSString *)action extras:(NSDictionary *)extras callback:(RCTResponseSenderBlock)callback {
|
|
86
|
-
if (!vc.hbd_inViewHierarchy) {
|
|
87
|
-
callback(@[NSNull.null, @NO]);
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
86
|
HBDDrawerController *drawer = [vc drawerController];
|
|
92
87
|
if (!drawer) {
|
|
93
88
|
callback(@[NSNull.null, @NO]);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
#import "HBDReactBridgeManager.h"
|
|
4
4
|
#import "HBDNavigationController.h"
|
|
5
5
|
#import "HBDAnimationObserver.h"
|
|
6
|
+
#import "UIViewController+HBD.h"
|
|
6
7
|
|
|
7
8
|
#import <React/RCTLog.h>
|
|
8
9
|
|
|
@@ -50,11 +51,6 @@
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
- (void)handleNavigationWithViewController:(UIViewController *)vc action:(NSString *)action extras:(NSDictionary *)extras callback:(RCTResponseSenderBlock)callback {
|
|
53
|
-
if (!vc.hbd_inViewHierarchy) {
|
|
54
|
-
callback(@[NSNull.null, @NO]);
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
54
|
if ([action isEqualToString:@"present"]) {
|
|
59
55
|
[self handlePresentWithViewController:vc extras:extras callback:callback];
|
|
60
56
|
return;
|
|
@@ -87,6 +83,11 @@
|
|
|
87
83
|
}
|
|
88
84
|
|
|
89
85
|
- (void)handlePresentWithViewController:(UIViewController *)presenting extras:(NSDictionary *)extras callback:(RCTResponseSenderBlock)callback {
|
|
86
|
+
if (![presenting canPresentViewController]) {
|
|
87
|
+
callback(@[NSNull.null, @NO]);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
90
91
|
UIViewController *vc = [self viewControllerWithExtras:extras];
|
|
91
92
|
NSInteger requestCode = [extras[@"requestCode"] integerValue];
|
|
92
93
|
HBDNavigationController *nav = [[HBDNavigationController alloc] initWithRootViewController:vc];
|
|
@@ -105,6 +106,11 @@
|
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
- (void)handleShowModalWithViewController:(UIViewController *)presenting extras:(NSDictionary *)extras callback:(RCTResponseSenderBlock)callback {
|
|
109
|
+
if (![presenting canPresentViewController]) {
|
|
110
|
+
callback(@[NSNull.null, @NO]);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
108
114
|
UIViewController *vc = [self viewControllerWithExtras:extras];
|
|
109
115
|
NSInteger requestCode = [extras[@"requestCode"] integerValue];
|
|
110
116
|
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
|
@@ -66,12 +66,6 @@
|
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
if (![nav.childViewControllers containsObject:vc]) {
|
|
70
|
-
RCTLogInfo(@"[Navigation] 找不到对应的 action target %@", extras[@"from"]);
|
|
71
|
-
callback(@[NSNull.null, @NO]);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
69
|
if (nav.transitionCoordinator) {
|
|
76
70
|
RCTLogInfo(@"[Navigation] 等待上个 action 执行完成 from:%@ %@ to:%@", extras[@"from"], action, extras[@"to"]);
|
|
77
71
|
[nav.transitionCoordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
|
|
@@ -175,11 +175,6 @@
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
- (void)handleNavigationWithViewController:(UIViewController *)vc action:(NSString *)action extras:(NSDictionary *)extras callback:(RCTResponseSenderBlock)callback {
|
|
178
|
-
if (!vc.hbd_inViewHierarchy) {
|
|
179
|
-
callback(@[NSNull.null, @NO]);
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
178
|
UITabBarController *tabBarController = [self tabBarControllerForViewController:vc];
|
|
184
179
|
|
|
185
180
|
if (!tabBarController) {
|
|
@@ -214,11 +214,13 @@ RCT_EXPORT_METHOD(currentRoute:(RCTResponseSenderBlock)callback) {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
HBDViewController *current = [self.bridgeManager primaryViewController];
|
|
217
|
+
|
|
217
218
|
if (current) {
|
|
218
219
|
callback(@[[NSNull null], @{
|
|
219
220
|
@"moduleName": RCTNullIfNil(current.moduleName),
|
|
220
221
|
@"sceneId": current.sceneId,
|
|
221
|
-
@"mode": [current hbd_mode]
|
|
222
|
+
@"mode": [current hbd_mode],
|
|
223
|
+
@"requestCode": @(current.requestCode),
|
|
222
224
|
}]);
|
|
223
225
|
} else {
|
|
224
226
|
[self performSelector:@selector(currentRouteWithCallback:) withObject:callback afterDelay:0.016];
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
- (void)dealloc {
|
|
24
24
|
[[NSNotificationCenter defaultCenter] removeObserver:self name:RCTBridgeWillReloadNotification object:nil];
|
|
25
|
-
RCTLogInfo(@"销毁页面 %@", self.moduleName);
|
|
25
|
+
RCTLogInfo(@"[Navigation] 销毁页面 %@", self.moduleName);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
- (instancetype)initWithModuleName:(NSString *)moduleName props:(NSDictionary *)props options:(NSDictionary *)options {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
self.view = [[HBDRootView alloc] initWithRootView:rootView];
|
|
49
49
|
[self.view addSubview:rootView];
|
|
50
50
|
[self updateReactViewConstraints];
|
|
51
|
-
RCTLogInfo(@"加载页面 %@", self.moduleName);
|
|
51
|
+
RCTLogInfo(@"[Navigation] 加载页面 %@", self.moduleName);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
- (void)viewDidLoad {
|
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
@property(nonatomic, assign, readonly) float hbd_barShadowAlpha;
|
|
17
17
|
@property(nonatomic, assign) BOOL hbd_statusBarHidden;
|
|
18
18
|
|
|
19
|
-
@property(nonatomic, assign) BOOL hbd_inViewHierarchy;
|
|
20
|
-
|
|
21
19
|
- (void)hbd_setNeedsUpdateNavigationBar;
|
|
22
20
|
|
|
23
21
|
@property(nonatomic, copy, readonly) NSString *sceneId;
|
|
@@ -26,6 +24,8 @@
|
|
|
26
24
|
@property(nonatomic, assign) NSInteger requestCode;
|
|
27
25
|
@property(nonatomic, copy) NSDictionary *resultData;
|
|
28
26
|
|
|
27
|
+
- (BOOL)canPresentViewController;
|
|
28
|
+
|
|
29
29
|
- (void)setResultCode:(NSInteger)resultCode resultData:(NSDictionary *)data;
|
|
30
30
|
|
|
31
31
|
- (void)didReceiveResultCode:(NSInteger)resultCode resultData:(NSDictionary *)data requestCode:(NSInteger)requestCode;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#import "UIViewController+HBD.h"
|
|
2
2
|
|
|
3
3
|
#import "HBDNavigationController.h"
|
|
4
|
+
#import "HBDReactViewController.h"
|
|
4
5
|
#import "HBDUtils.h"
|
|
5
6
|
#import "GlobalStyle.h"
|
|
6
7
|
#import "UITabBar+Badge.h"
|
|
@@ -15,21 +16,11 @@
|
|
|
15
16
|
Class clazz = [self class];
|
|
16
17
|
hbd_exchangeImplementations(clazz, @selector(presentViewController:animated:completion:), @selector(hbd_presentViewController:animated:completion:));
|
|
17
18
|
hbd_exchangeImplementations(clazz, @selector(dismissViewControllerAnimated:completion:), @selector(hbd_dismissViewControllerAnimated:completion:));
|
|
18
|
-
hbd_exchangeImplementations(clazz, @selector(didMoveToParentViewController:), @selector(hbd_didMoveToParentViewController:));
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
- (void)hbd_didMoveToParentViewController:(UIViewController *)parent {
|
|
23
|
-
[self hbd_didMoveToParentViewController:parent];
|
|
24
|
-
self.hbd_inViewHierarchy = parent != nil;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
22
|
- (void)hbd_presentViewController:(UIViewController *)viewController animated:(BOOL)animated completion:(void (^)(void))completion {
|
|
28
23
|
if (![self canPresentViewController]) {
|
|
29
|
-
[self didReceiveResultCode:0 resultData:nil requestCode:viewController.requestCode];
|
|
30
|
-
if (completion) {
|
|
31
|
-
completion();
|
|
32
|
-
}
|
|
33
24
|
return;
|
|
34
25
|
}
|
|
35
26
|
viewController.presentingSceneId = self.sceneId;
|
|
@@ -39,7 +30,12 @@
|
|
|
39
30
|
- (BOOL)canPresentViewController {
|
|
40
31
|
UIViewController *presented = self.presentedViewController;
|
|
41
32
|
if (presented && !presented.isBeingDismissed) {
|
|
42
|
-
|
|
33
|
+
if ([presented isKindOfClass:[HBDReactViewController class]]) {
|
|
34
|
+
HBDReactViewController *vc = (HBDReactViewController *)presented;
|
|
35
|
+
RCTLogInfo(@"[Navigation] Can't present since the scene had present another scene already. %@", vc.moduleName);
|
|
36
|
+
} else {
|
|
37
|
+
RCTLogInfo(@"[Navigation] Can't present since the scene had present another scene already. %@", NSStringFromClass([presented class]));
|
|
38
|
+
}
|
|
43
39
|
return NO;
|
|
44
40
|
}
|
|
45
41
|
return YES;
|
|
@@ -246,16 +242,6 @@
|
|
|
246
242
|
objc_setAssociatedObject(self, @selector(hbd_swipeBackEnabled), @(enabled), OBJC_ASSOCIATION_COPY_NONATOMIC);
|
|
247
243
|
}
|
|
248
244
|
|
|
249
|
-
|
|
250
|
-
- (BOOL)hbd_inViewHierarchy {
|
|
251
|
-
id obj = objc_getAssociatedObject(self, _cmd);
|
|
252
|
-
return obj ? [obj boolValue] : YES;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
- (void)setHbd_inViewHierarchy:(BOOL)inViewHierarchy {
|
|
256
|
-
objc_setAssociatedObject(self, @selector(hbd_inViewHierarchy), @(inViewHierarchy), OBJC_ASSOCIATION_COPY_NONATOMIC);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
245
|
- (void)hbd_setNeedsUpdateNavigationBar {
|
|
260
246
|
if (self.navigationController && [self.navigationController isKindOfClass:[HBDNavigationController class]]) {
|
|
261
247
|
HBDNavigationController *nav = (HBDNavigationController *) self.navigationController;
|
package/lib/Route.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ interface IndexType {
|
|
|
4
4
|
export type ResultType = IndexType | null;
|
|
5
5
|
export type ResultEventListener<T extends ResultType> = (resultCode: number, data: T) => void;
|
|
6
6
|
export default class ResultEventHandler {
|
|
7
|
-
private
|
|
7
|
+
private listenerRecords;
|
|
8
8
|
constructor();
|
|
9
9
|
handleComponentResult(): void;
|
|
10
10
|
private addResultEventListener;
|
|
@@ -2,38 +2,40 @@ import Event from '../Event';
|
|
|
2
2
|
import NavigationModule from '../NavigationModule';
|
|
3
3
|
const { RESULT_CANCEL } = NavigationModule.getConstants();
|
|
4
4
|
export default class ResultEventHandler {
|
|
5
|
-
|
|
5
|
+
listenerRecords = {};
|
|
6
6
|
constructor() { }
|
|
7
7
|
handleComponentResult() {
|
|
8
8
|
Event.listenComponentResult((sceneId, requestCode, resultCode, data) => {
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
delete this.
|
|
12
|
-
|
|
9
|
+
const listeners = this.listenerRecords[sceneId]?.[requestCode];
|
|
10
|
+
if (listeners) {
|
|
11
|
+
delete this.listenerRecords[sceneId][requestCode];
|
|
12
|
+
listeners.forEach(l => l(resultCode, data));
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
addResultEventListener(sceneId, requestCode, listener) {
|
|
17
|
-
if (!this.
|
|
18
|
-
this.
|
|
17
|
+
if (!this.listenerRecords[sceneId]) {
|
|
18
|
+
this.listenerRecords[sceneId] = {};
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
previousListener(RESULT_CANCEL, null);
|
|
20
|
+
if (!this.listenerRecords[sceneId][requestCode]) {
|
|
21
|
+
this.listenerRecords[sceneId][requestCode] = [];
|
|
23
22
|
}
|
|
24
|
-
this.
|
|
23
|
+
this.listenerRecords[sceneId][requestCode].push(listener);
|
|
25
24
|
}
|
|
26
25
|
removeResultEventListener(sceneId, requestCode) {
|
|
27
|
-
if (this.
|
|
28
|
-
delete this.
|
|
26
|
+
if (this.listenerRecords[sceneId]) {
|
|
27
|
+
delete this.listenerRecords[sceneId][requestCode];
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
invalidateResultEventListener(sceneId) {
|
|
32
|
-
const listeners = this.
|
|
31
|
+
const listeners = this.listenerRecords[sceneId];
|
|
33
32
|
if (listeners) {
|
|
34
|
-
Object.values(listeners).forEach(listener => listener(RESULT_CANCEL, null))
|
|
33
|
+
// Object.values(listeners).forEach(listener => listener(RESULT_CANCEL, null))
|
|
34
|
+
Object.values(listeners)
|
|
35
|
+
.reduce((acc, next) => [...acc, ...next], [])
|
|
36
|
+
.forEach(listener => listener(RESULT_CANCEL, null));
|
|
35
37
|
}
|
|
36
|
-
delete this.
|
|
38
|
+
delete this.listenerRecords[sceneId];
|
|
37
39
|
}
|
|
38
40
|
waitResult(sceneId, requestCode) {
|
|
39
41
|
return new Promise(resolve => {
|
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.
|
|
4
|
+
"version": "2.18.0",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
7
7
|
"react-native": "src/index",
|
package/src/Route.ts
CHANGED
|
@@ -9,17 +9,17 @@ export type ResultEventListener<T extends ResultType> = (resultCode: number, dat
|
|
|
9
9
|
|
|
10
10
|
const { RESULT_CANCEL } = NavigationModule.getConstants()
|
|
11
11
|
export default class ResultEventHandler {
|
|
12
|
-
private
|
|
12
|
+
private listenerRecords: Record<string, Record<number, Array<ResultEventListener<any>>>> = {}
|
|
13
13
|
|
|
14
14
|
constructor() {}
|
|
15
15
|
|
|
16
16
|
handleComponentResult() {
|
|
17
17
|
Event.listenComponentResult(
|
|
18
18
|
(sceneId: string, requestCode: number, resultCode: number, data: any) => {
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
delete this.
|
|
22
|
-
|
|
19
|
+
const listeners = this.listenerRecords[sceneId]?.[requestCode]
|
|
20
|
+
if (listeners) {
|
|
21
|
+
delete this.listenerRecords[sceneId][requestCode]
|
|
22
|
+
listeners.forEach(l => l(resultCode, data))
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
)
|
|
@@ -30,29 +30,33 @@ export default class ResultEventHandler {
|
|
|
30
30
|
requestCode: number,
|
|
31
31
|
listener: ResultEventListener<any>,
|
|
32
32
|
) {
|
|
33
|
-
if (!this.
|
|
34
|
-
this.
|
|
33
|
+
if (!this.listenerRecords[sceneId]) {
|
|
34
|
+
this.listenerRecords[sceneId] = {}
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
if (
|
|
38
|
-
|
|
36
|
+
|
|
37
|
+
if (!this.listenerRecords[sceneId][requestCode]) {
|
|
38
|
+
this.listenerRecords[sceneId][requestCode] = []
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
this.listenerRecords[sceneId][requestCode].push(listener)
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
private removeResultEventListener(sceneId: string, requestCode: number) {
|
|
44
|
-
if (this.
|
|
45
|
-
delete this.
|
|
45
|
+
if (this.listenerRecords[sceneId]) {
|
|
46
|
+
delete this.listenerRecords[sceneId][requestCode]
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
invalidateResultEventListener(sceneId: string) {
|
|
50
|
-
const listeners = this.
|
|
51
|
+
const listeners = this.listenerRecords[sceneId]
|
|
51
52
|
if (listeners) {
|
|
52
|
-
Object.values(listeners).forEach(listener => listener(RESULT_CANCEL, null))
|
|
53
|
+
// Object.values(listeners).forEach(listener => listener(RESULT_CANCEL, null))
|
|
54
|
+
Object.values(listeners)
|
|
55
|
+
.reduce((acc, next) => [...acc, ...next], [])
|
|
56
|
+
.forEach(listener => listener(RESULT_CANCEL, null))
|
|
53
57
|
}
|
|
54
58
|
|
|
55
|
-
delete this.
|
|
59
|
+
delete this.listenerRecords[sceneId]
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
waitResult<T extends ResultType>(sceneId: string, requestCode: number): Promise<[number, T]> {
|