Update TS definitions (#376)

This commit is contained in:
pavulon 2020-10-24 19:56:18 +02:00 committed by GitHub
parent 056fba9e4f
commit 20b2fe7f67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

14
docs/index.d.ts vendored
View File

@ -191,8 +191,10 @@ export interface HttpRequest {
getUrl() : string;
/** Returns the HTTP method, useful for "any" routes. */
getMethod() : string;
/** Returns the part of URL after ? sign or empty string. */
/** Returns the raw querystring (the part of URL after ? sign) or empty string. */
getQuery() : string;
/** Returns a decoded query parameter value or empty string. */
getQuery(key: string) : string;
/** Loops over all headers. */
forEach(cb: (key: string, value: string) => void) : void;
/** Setting yield to true is to say that this route handler did not handle the route, causing the router to continue looking for a matching route handler, or fail. */
@ -291,6 +293,16 @@ export function SSLApp(options: AppOptions): TemplatedApp;
/** Closes a uSockets listen socket. */
export function us_listen_socket_close(listenSocket: us_listen_socket): void;
export interface MultipartField {
data: ArrayBuffer;
name: string;
type?: string;
filename?: string;
}
/** Takes a POSTed body and contentType, and returns an array of parts if the request is a multipart request */
export function getParts(body: RecognizedString, contentType: RecognizedString): MultipartField[] | undefined;
/** WebSocket compression options */
export type CompressOptions = number;
/** No compression (always a good idea if you operate using an efficient binary protocol) */