This repository has been archived by the owner on Jun 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
87 lines (70 loc) · 2.23 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import * as uws from 'uWebSockets.js';
export interface cache_control_types {
no_store: string,
no_cache: string,
private_cached: string,
public_cached: string,
}
export interface port_access_types {
SHARED: number,
EXCLUSIVE: number,
}
export interface response {
aborted?: boolean,
ended?: boolean,
error?: Error,
status?: number,
headers?: object,
file_path?: string,
file_name?: string,
file_content_type?: string,
file_dispose?: boolean,
file_cache?: boolean,
file_cache_max_age_ms?: number,
text?: string,
html?: string,
json?: object,
buffer?: Buffer,
buffer_hash?: string,
compress?: boolean,
compressed?: boolean,
brotli_buffer?: Buffer,
brotli_buffer_hash?: string,
gzip_buffer?: Buffer,
gzip_buffer_hash?: string,
timestamp?: number,
start?: number,
end?: number,
took?: number,
}
export interface headers {
host: string,
accept: string,
accept_encoding: string,
content_type: string,
if_none_match: string,
user_agent: string,
}
export interface request {
url: string,
query: string,
method: string,
headers: headers,
json: object,
}
export const cache_control_types: cache_control_types;
export const port_access_types: port_access_types;
export type handler = (response: response, request: request) => void;
export type internal_handler_2 = (res: uws.HttpResponse, handler: handler, response: response, request: request) => void;
export type internal_handler = (res: uws.HttpResponse, req: uws.HttpRequest) => void;
export type serve_handler = (handler: handler) => internal_handler;
export const serve_handler: serve_handler;
export type serve_static = (app: uws.TemplatedApp, route_path: string, local_path: string, response_override: response) => void;
export const serve_static: serve_static;
export type serve_redirect = (app: uws.TemplatedApp) => void;
export const serve_redirect: serve_redirect;
export type serve_http = (app: uws.TemplatedApp, port_access_type: number, port: number) => Promise<uws.us_listen_socket>;
export const serve_http: serve_http;
export type serve_https = (app: uws.TemplatedApp, port_access_type: number, port: number) => Promise<uws.us_listen_socket>;
export const serve_https: serve_https;
export * as uws from 'uWebSockets.js';