@sinclair/hammer
Version:
Build Tool for Browser and Node Applications
22 lines (21 loc) • 682 B
TypeScript
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from 'http';
export declare type FileInfo = {
type: 'file';
sourcePath: string;
mimeType: string;
disposition: string;
fileSize: number;
};
export declare type HtmlInfo = {
type: 'html';
sourcePath: string;
mimeType: string;
disposition: string;
fileSize: number;
};
export declare type NotFound = {
type: 'not-found';
};
export declare function htmlHandler(request: IncomingMessage, response: ServerResponse, info: HtmlInfo): void;
export declare function staticHandler(request: IncomingMessage, response: ServerResponse, targetDirectory: string): Promise<void>;