-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcgi-core.d.ts
More file actions
47 lines (39 loc) · 1.05 KB
/
cgi-core.d.ts
File metadata and controls
47 lines (39 loc) · 1.05 KB
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
import { IncomingMessage, ServerResponse } from "node:http";
export const defaultExtensions: Readonly<Extensions>;
export const defaultConfig: Readonly<Config>;
export interface Handler {
(req: IncomingMessage, res: ServerResponse): Promise<boolean>;
}
export function createHandler(configOptions?: Partial<Config>): Handler;
export interface Extensions {
[key: string]: Array<string>;
}
export interface StatusPages {
[key: number]: {
content: string;
contentType: string;
};
}
export interface EnvVars {
[key: string]: string | number | boolean;
}
export interface EnvUpdaterFunction {
(env: EnvVars, req: IncomingMessage): EnvVars;
}
export interface Config {
urlPath: string;
filePath: string;
extensions: Extensions;
indexExtension: string;
debugOutput: boolean;
logRequests: boolean;
maxBuffer: number;
requestChunkSize: number;
responseChunkSize: number;
requestTimeout: number;
forceKillDelay: number;
requireExecBit: boolean;
trustProxy: boolean;
statusPages: StatusPages;
env: EnvVars | EnvUpdaterFunction;
}