tspace-spear
Version:
tspace-spear is a lightweight, high-performance API framework for Node.js that leverages the native HTTP server and supports uWebSockets.js (C++) for maximum speed and efficiency.
31 lines (30 loc) • 839 B
TypeScript
import { IncomingMessage, ServerResponse } from "http";
import { Stream } from "stream";
import type { T } from "../../types";
export declare const uWSAdaptRequestResponse: (uwsReq: any, uwsRes: any) => {
req: T.Request;
res: T.Response;
};
export declare const uWSBody: (req: T.Request, res: T.Response & {
uWS: any;
}) => Promise<unknown>;
export declare const uWSfiles: ({ req, res, options, }: {
req: T.Request;
res: T.Response;
options: {
limit: number;
tempFileDir: string;
removeTempFile: {
remove: boolean;
ms: number;
};
};
}) => Promise<{
body: T.Body;
files: T.FileUpload;
}>;
export declare const uWSPipeStream: ({ req, res, filePath }: {
req: IncomingMessage;
res: ServerResponse;
filePath: string;
}) => Promise<Stream>;