UNPKG

tream

Version:

Lightweight lazy streams in TypeScript

18 lines (17 loc) 618 B
/// <reference types="node" /> export declare const enum Method { Get = "GET", Post = "POST", Put = "PUT", Delete = "DELETE", Head = "HEAD", Patch = "PATCH", Options = "OPTIONS", } export interface Headers { [name: string]: string; } export declare type ResFn = (status: number, message: string, headers: Headers, body?: Buffer) => void; export declare type ErrFn = (error: Error) => void; export declare type AbrFn = () => void; export declare type ReqFn = (method: Method, url: string, headers: Headers, body: Buffer | undefined, need_body: boolean, res: ResFn, err: ErrFn) => AbrFn;