You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

33 lines
779 B

import has = require('./has');
import types = require('./types');
declare namespace fetch {
interface IResult {
ok: boolean;
status: number;
statusText: string;
url: string;
clone(): IResult;
text(): Promise<string>;
json(): Promise<any>;
xml(): Promise<Document | null>;
blob(): Promise<Blob>;
headers: {
keys(): string[];
entries(): Array<string[]>;
get(name: string): string;
has(name: string): boolean;
};
}
}
declare function fetch(
url: string,
options?: {
method?: string;
timeout?: number;
headers?: types.PlainObj<string>;
body?: any;
}
): Promise<fetch.IResult>;
export = fetch;