mirror of
https://github.com/morluto/rea.git
synced 2026-12-04 01:54:49 +00:00
22 lines
625 B
TypeScript
22 lines
625 B
TypeScript
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
|
|
export interface ModelFixtureServer {
|
|
readonly origin: string;
|
|
readonly failure: string | undefined;
|
|
close(): Promise<void>;
|
|
}
|
|
|
|
export function readModelFixtureBody(
|
|
request: IncomingMessage,
|
|
budgetMessage?: string,
|
|
): Promise<unknown>;
|
|
|
|
/** Own the HTTP transport and every admitted protocol handler through finalization. */
|
|
export function createModelFixtureServer(
|
|
handleRequest: (
|
|
request: IncomingMessage,
|
|
response: ServerResponse,
|
|
recordFailure: (cause: unknown) => string,
|
|
) => Promise<void>,
|
|
): Promise<ModelFixtureServer>;
|