rexuws
Version:
An express-like framework built on top of uWebsocket.js aims at simple codebase and high performance
25 lines (24 loc) • 1.15 kB
TypeScript
/// <reference types="node" />
import { HttpResponse } from 'uWebSockets.js';
import { ILogger } from '../Logger';
import { ParametersMap } from '../Request';
export declare const charsetRegExp: RegExp;
export declare const setCharset: (type: any, charset: any) => any;
export declare const getParamNames: (func: (...args: any) => any) => RegExpMatchArray;
export declare const toHtml: (str: string, title?: string) => string;
export declare const notFoundHtml: (method: string, path: string) => string;
export declare const extractParamsPath: (path: string) => {
parametersMap: ParametersMap;
path: string;
basePath: string;
};
export declare const readBody: (res: HttpResponse, cb: (raw: Buffer) => void) => void;
export declare const hasAsync: (logger: ILogger, es5?: boolean) => (fn: (...args: any) => any) => boolean;
/**
* This code was taken from uWebSockets.js examples
*
* @see https://github.com/uNetworking/uWebSockets.js/blob/master/examples/VideoStreamer.js
* @param buffer
*/
export declare const toArrayBuffer: (buffer: Buffer) => ArrayBuffer;
export declare const getMime: (arg1: string) => Promise<string | string[]>;