forked from clarityhk/react-native-ssl-pinning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js.flow
32 lines (28 loc) · 780 Bytes
/
index.js.flow
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
// @flow
export type Header = {
[headerName: string]: string;
}
export type Cookies = {
[cookieName: string]: string;
}
export type Options = {
body?: string | {},
credentials?: string,
headers?: Header,
method?: 'DELETE' | 'GET' | 'POST' | 'PUT',
sslPinning: {
certs: Array<string>
},
timeoutInterval?: number,
}
export type Response = {
bodyString: string,
headers: Header,
status: number,
url: string,
json: () => Promise<{ [key: string]: any}>,
text: () => Promise<string>,
}
declare export function fetch(url: string, options: Options): Promise<Response>;
declare export function removeCookieByName(cookieName: string): Promise<void>
declare export function getCookies(domain: string): Promise<Cookies>