Bones/node_modules/popsicle/dist/response.d.ts

27 lines
708 B
TypeScript
Raw Normal View History

2017-05-17 13:45:25 -04:00
import Base, { BaseOptions, Headers, RawHeaders } from './base';
import Request from './request';
import PopsicleError from './error';
export interface ResponseOptions extends BaseOptions {
body: any;
status: number;
statusText: string;
}
export interface ResponseJSON {
headers: Headers;
rawHeaders: RawHeaders;
body: any;
url: string;
status: number;
statusText: string;
}
export default class Response extends Base {
status: number;
statusText: string;
body: any;
request: Request;
constructor(options: ResponseOptions);
statusType(): number;
error(message: string, type: string, error?: Error): PopsicleError;
toJSON(): ResponseJSON;
}