flagpole
Version:
Simple and fast DOM integration, headless or headful browser, and REST API testing framework.
26 lines (25 loc) • 862 B
TypeScript
/// <reference types="node" />
import * as http from 'http';
export declare class WebResponse {
private _response;
private _output;
static createFromTemplate(response: http.ServerResponse, templatePath: string): WebResponse;
static createFromInput(response: http.ServerResponse, input: string): WebResponse;
private constructor();
replace(key: string, value: string): WebResponse;
parse(replace: {
[key: string]: string;
}): WebResponse;
send(replace?: {
[key: string]: string;
}): WebResponse;
}
export declare class WebServer {
private _httpPort;
private _server;
readonly isListening: boolean;
httpPort: number;
constructor(requestHandler: (request: http.ServerRequest, response: http.ServerResponse) => void);
listen(port?: number): Promise<void>;
close(): Promise<void>;
}