Add Connection class
This commit is contained in:
27
web3.js/flow-typed/node-fetch.js
vendored
Normal file
27
web3.js/flow-typed/node-fetch.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
declare module 'node-fetch' {
|
||||
declare export type Config = {
|
||||
method?: string;
|
||||
headers?: {[key: string]: string};
|
||||
compress?: bool;
|
||||
body?: Buffer|string;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
declare export class Headers {
|
||||
get(name: string): ?string;
|
||||
set(name: string, value: string): void;
|
||||
}
|
||||
|
||||
declare export class Response {
|
||||
url: string;
|
||||
status: string;
|
||||
statusText: string;
|
||||
headers: Headers;
|
||||
ok: bool;
|
||||
|
||||
json(): Promise<Object>;
|
||||
text(): Promise<string>;
|
||||
}
|
||||
|
||||
declare export default (url: string, config?: Config) => Promise<Response>;
|
||||
}
|
Reference in New Issue
Block a user