fix 修改小程序拉起 APP 后的 Res 回调参数,增加 WeChatReq 和 WeChatResp 的 ts 类型定义

This commit is contained in:
snowfox 2019-11-06 22:13:20 +08:00
parent ec1dd8d221
commit 3633cf614b
4 changed files with 20 additions and 3 deletions

View File

@ -26,7 +26,8 @@
## 安装 ## 安装
```sh ```sh
$ npm install react-native-wechat-lib --save npm install react-native-wechat-lib --save
react-native link react-native-wechat-lib
``` ```
## 起步 ## 起步

16
index.d.ts vendored
View File

@ -23,6 +23,22 @@ declare module "react-native-wechat-lib" {
lang?: string; lang?: string;
country?: string; country?: string;
} }
export interface WeChatReq {
type?: string,
errStr?: string,
extMsg?: string,
country?: string,
state?: string,
returnKey?: string
}
export interface WeChatResp {
type?: string,
errStr?: string,
extMsg?: string,
country?: string,
state?: string,
returnKey?: string
}
export function sendAuthRequest( export function sendAuthRequest(
scope: string | string[], scope: string | string[],
state?: string state?: string

View File

@ -467,7 +467,7 @@ RCT_EXPORT_METHOD(pay:(NSDictionary *)data
body[@"type"] = @"LaunchFromWX.Req"; body[@"type"] = @"LaunchFromWX.Req";
body[@"lang"] = launchReq.lang; body[@"lang"] = launchReq.lang;
body[@"country"] = launchReq.country; body[@"country"] = launchReq.country;
body[@"appParameter"] = appParameter; body[@"extMsg"] = appParameter;
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventNameWeChatReq body:body]; [self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventNameWeChatReq body:body];
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "react-native-wechat-lib", "name": "react-native-wechat-lib",
"version": "1.1.0", "version": "1.1.1",
"description": "react-native library for wechat app", "description": "react-native library for wechat app",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {