Skip to content

Commit ed0edbe

Browse files
committed
fix: merge from origin
1 parent 62f1535 commit ed0edbe

File tree

3 files changed

+280
-141
lines changed

3 files changed

+280
-141
lines changed

src/https.common.d.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,40 @@ export interface HttpsSSLPinningOptions {
77
commonName?: string;
88
useLegacy?: boolean;
99
}
10+
export interface CacheOptions {
11+
diskLocation: string;
12+
diskSize: number;
13+
memorySize?: number;
14+
}
15+
export interface HttpsFormDataParam {
16+
data: any;
17+
parameterName: string;
18+
fileName?: string;
19+
contentType?: string;
20+
}
1021
export interface HttpsRequestObject {
11-
[key: string]: string | number;
22+
[key: string]: string | number | boolean | HttpsRequestObject | Array<any> | HttpsFormDataParam;
1223
}
24+
export declare type CachePolicy = 'noCache' | 'onlyCache' | 'ignoreCache';
1325
export interface HttpsRequestOptions {
1426
url: string;
1527
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD';
1628
headers?: Headers;
1729
params?: HttpsRequestObject;
18-
body?: HttpsRequestObject;
30+
body?: HttpsRequestObject | HttpsFormDataParam[];
31+
content?: string;
1932
allowLargeResponse?: boolean;
2033
timeout?: number;
34+
onProgress?: (current: number, total: number) => void;
35+
cachePolicy?: CachePolicy;
2136
}
2237
export interface HttpsResponse {
2338
headers?: Headers;
2439
statusCode?: number;
2540
content?: any;
2641
reason?: string;
42+
description?: string;
43+
url?: string;
2744
reject?: boolean;
2845
failure?: any;
2946
}

src/https.common.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ export interface HttpsRequestOptions {
4545
*/
4646
timeout?: number;
4747

48+
/**
49+
* iOS for now
50+
*/
51+
onProgress?: (current: number, total: number) => void
52+
4853
cachePolicy?:CachePolicy
4954
}
5055

0 commit comments

Comments
 (0)