flagpole
Version:
Simple and fast DOM integration, headless or headful browser, and REST API testing framework.
30 lines (29 loc) • 952 B
TypeScript
import * as puppeteer from "puppeteer-core";
import { NeedleResponse } from "needle";
import { KeyValue } from "./interfaces";
export interface probeImageResponse {
headers: KeyValue;
statusCode: number;
url: string;
length: number;
imageData: probeImageData;
}
export declare type probeImageData = {
width: number;
height: number;
type: string;
mimeType: string;
};
export declare class HttpResponse {
body: string;
statusCode: number;
statusMessage: string;
headers: KeyValue;
cookies: KeyValue;
private constructor();
static createEmpty(): HttpResponse;
static fromNeedle(response: NeedleResponse): HttpResponse;
static fromPuppeteer(response: puppeteer.Response, body: string, cookies?: KeyValue): HttpResponse;
static fromProbeImage(response: probeImageResponse, cookies?: KeyValue): HttpResponse;
static fromLocalFile(relativePath: string): Promise<HttpResponse>;
}