Add Connection class

This commit is contained in:
Michael Vines
2018-08-23 10:52:48 -07:00
parent 79ab826678
commit 4df189513e
12 changed files with 526 additions and 70 deletions

27
web3.js/flow-typed/node-fetch.js vendored Normal file
View 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>;
}