feat: enhance plugin navigator,add popSelf and popToRoot

This commit is contained in:
pengfei.zhou
2021-06-08 11:55:21 +08:00
committed by osborn
parent 864ffa0de7
commit 4da1f3be9d
15 changed files with 162 additions and 8 deletions

View File

@@ -3120,6 +3120,14 @@ function navigator(context) {
if (animated === void 0) { animated = true; }
return context.callNative(moduleName, 'pop', { animated: animated });
},
popSelf: function (animated) {
if (animated === void 0) { animated = true; }
return context.callNative(moduleName, 'popSelf', { animated: animated });
},
popToRoot: function (animated) {
if (animated === void 0) { animated = true; }
return context.callNative(moduleName, 'popToRoot', { animated: animated });
},
openUrl: function (url) {
return context.callNative(moduleName, "openUrl", url);
},

View File

@@ -2419,6 +2419,12 @@ function navigator(context) {
pop: (animated = true) => {
return context.callNative(moduleName, 'pop', { animated });
},
popSelf: (animated = true) => {
return context.callNative(moduleName, 'popSelf', { animated });
},
popToRoot: (animated = true) => {
return context.callNative(moduleName, 'popToRoot', { animated });
},
openUrl: (url) => {
return context.callNative(moduleName, "openUrl", url);
},

View File

@@ -3940,6 +3940,12 @@ function navigator(context) {
pop: (animated = true) => {
return context.callNative(moduleName, 'pop', { animated });
},
popSelf: (animated = true) => {
return context.callNative(moduleName, 'popSelf', { animated });
},
popToRoot: (animated = true) => {
return context.callNative(moduleName, 'popToRoot', { animated });
},
openUrl: (url) => {
return context.callNative(moduleName, "openUrl", url);
},

2
doric-js/index.d.ts vendored
View File

@@ -887,6 +887,8 @@ declare module 'doric/lib/src/native/navigator' {
singlePage?: boolean | undefined;
} | undefined) => Promise<any>;
pop: (animated?: boolean) => Promise<any>;
popSelf: (animated?: boolean) => Promise<any>;
popToRoot: (animated?: boolean) => Promise<any>;
openUrl: (url: string) => Promise<any>;
};
}

View File

@@ -10,5 +10,7 @@ export declare function navigator(context: BridgeContext): {
singlePage?: boolean | undefined;
} | undefined) => Promise<any>;
pop: (animated?: boolean) => Promise<any>;
popSelf: (animated?: boolean) => Promise<any>;
popToRoot: (animated?: boolean) => Promise<any>;
openUrl: (url: string) => Promise<any>;
};

View File

@@ -18,6 +18,12 @@ export function navigator(context) {
pop: (animated = true) => {
return context.callNative(moduleName, 'pop', { animated });
},
popSelf: (animated = true) => {
return context.callNative(moduleName, 'popSelf', { animated });
},
popToRoot: (animated = true) => {
return context.callNative(moduleName, 'popToRoot', { animated });
},
openUrl: (url) => {
return context.callNative(moduleName, "openUrl", url);
},

View File

@@ -43,6 +43,12 @@ export function navigator(context: BridgeContext) {
pop: (animated = true) => {
return context.callNative(moduleName, 'pop', { animated })
},
popSelf: (animated = true) => {
return context.callNative(moduleName, 'popSelf', { animated })
},
popToRoot: (animated = true) => {
return context.callNative(moduleName, 'popToRoot', { animated })
},
openUrl: (url: string) => {
return context.callNative(moduleName, "openUrl", url)
},