forked from clarityhk/react-native-ssl-pinning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
33 lines (29 loc) · 961 Bytes
/
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
export namespace ReactNativeSSLPinning {
interface Cookies {
[cookieName: string]: string;
}
interface Header {
[headerName: string]: string;
}
interface Options {
body?: string | object,
credentials?: string,
headers?: Header;
method?: 'DELETE' | 'GET' | 'POST' | 'PUT',
sslPinning: {
certs: string[]
},
timeoutInterval?: number,
}
interface Response {
bodyString: 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>;