Skip to content

Commit

Permalink
fix: merge from origin
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Apr 11, 2020
1 parent 62f1535 commit ed0edbe
Show file tree
Hide file tree
Showing 3 changed files with 280 additions and 141 deletions.
21 changes: 19 additions & 2 deletions src/https.common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,40 @@ export interface HttpsSSLPinningOptions {
commonName?: string;
useLegacy?: boolean;
}
export interface CacheOptions {
diskLocation: string;
diskSize: number;
memorySize?: number;
}
export interface HttpsFormDataParam {
data: any;
parameterName: string;
fileName?: string;
contentType?: string;
}
export interface HttpsRequestObject {
[key: string]: string | number;
[key: string]: string | number | boolean | HttpsRequestObject | Array<any> | HttpsFormDataParam;
}
export declare type CachePolicy = 'noCache' | 'onlyCache' | 'ignoreCache';
export interface HttpsRequestOptions {
url: string;
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD';
headers?: Headers;
params?: HttpsRequestObject;
body?: HttpsRequestObject;
body?: HttpsRequestObject | HttpsFormDataParam[];
content?: string;
allowLargeResponse?: boolean;
timeout?: number;
onProgress?: (current: number, total: number) => void;
cachePolicy?: CachePolicy;
}
export interface HttpsResponse {
headers?: Headers;
statusCode?: number;
content?: any;
reason?: string;
description?: string;
url?: string;
reject?: boolean;
failure?: any;
}
5 changes: 5 additions & 0 deletions src/https.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ export interface HttpsRequestOptions {
*/
timeout?: number;

/**
* iOS for now
*/
onProgress?: (current: number, total: number) => void

cachePolicy?:CachePolicy
}

Expand Down
Loading

0 comments on commit ed0edbe

Please sign in to comment.