mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
[wepy] modifying wx.request params (#27049)
* [wepy] modifying wx.request params * updating code owners
This commit is contained in:
committed by
Mohamed Hegazy
parent
6361591c22
commit
f83dee6c0e
@@ -4374,6 +4374,8 @@
|
||||
/types/weighted/ @ccitro
|
||||
/types/weixin-app/ @taoqf @AlexStacker
|
||||
/types/wellknown/ @yairtawil
|
||||
/types/wepy/ @Jimexist
|
||||
/types/wepy-redux/ @Jimexist
|
||||
/types/whatwg-mimetype/ @petejohanson
|
||||
/types/whatwg-streams/ @saschanaz @ksm2
|
||||
/types/whatwg-url/ @aomarks
|
||||
|
||||
@@ -21,8 +21,17 @@ export class MyComponent extends wepy.component {
|
||||
|
||||
methods = {};
|
||||
|
||||
onLoad() {
|
||||
async onLoad() {
|
||||
super.onLoad();
|
||||
await wepy.request("http://www.weixin.com");
|
||||
const a = await wepy.request({
|
||||
url: "www.weixin.com",
|
||||
data: { a: 1, b: 2 },
|
||||
header: {
|
||||
"content-type": "application/json"
|
||||
},
|
||||
method: "POST"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+17
-1
@@ -114,6 +114,22 @@ export interface UrlParam {
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface RequestParam extends UrlParam {
|
||||
data?: object | string | ArrayBuffer;
|
||||
header?: object;
|
||||
method?:
|
||||
| "GET"
|
||||
| "OPTIONS"
|
||||
| "HEAD"
|
||||
| "POST"
|
||||
| "PUT"
|
||||
| "DELETE"
|
||||
| "TRACE"
|
||||
| "CONNECT";
|
||||
dataType?: "json" | "text";
|
||||
responseType?: "text" | "arraybuffer";
|
||||
}
|
||||
|
||||
export interface FilePathParam {
|
||||
filePath: string;
|
||||
}
|
||||
@@ -332,7 +348,7 @@ export interface WxEnhances {
|
||||
|
||||
removeStorage(params: { key: string }): Promise<void>;
|
||||
|
||||
request(params: UrlParam): Promise<any>;
|
||||
request(params: RequestParam | string): Promise<any>;
|
||||
|
||||
requestPayment(params: {
|
||||
timeStamp: string;
|
||||
|
||||
Reference in New Issue
Block a user