-
Notifications
You must be signed in to change notification settings - Fork 104
/
index.d.ts
38 lines (34 loc) · 1.11 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
export namespace ReactNativeSSLPinning {
interface Cookies {
[cookieName: string]: string;
}
interface Header {
[headerName: string]: string;
}
interface Options {
body?: string | object,
responseType?: 'text' | 'base64',
credentials?: string,
headers?: Header;
method?: 'DELETE' | 'GET' | 'POST' | 'PUT',
pkPinning?: boolean,
sslPinning: {
certs: string[]
},
timeoutInterval?: number,
disableAllSecurity?: boolean,
caseSensitiveHeaders?: boolean = false
}
interface Response {
bodyString?: string;
data?: string;
headers: Header;
status: number;
url: string;
json: () => Promise<{ [key: string]: any}>;
text: () => Promise<string>;
}
}
export declare function fetch(url: string, options: ReactNativeSSLPinning.Options): Promise<ReactNativeSSLPinning.Response>;
export declare function getCookies(domain: string): Promise<ReactNativeSSLPinning.Cookies>;
export declare function removeCookieByName(cookieName: string): Promise<void>;