-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.d.mts
More file actions
40 lines (40 loc) · 1.59 KB
/
index.d.mts
File metadata and controls
40 lines (40 loc) · 1.59 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
/// <reference types="node" />
type Stringable = string | {
toString: () => string;
};
export declare class ModSecurity {
constructor();
setLogCallback(callback: (message: string) => void): void;
whoAmI(): string;
}
export declare class Rules {
constructor();
loadFromFile(path: Stringable): boolean;
add(rules: Stringable | Buffer): boolean;
dump(): void;
merge(rules: Rules): boolean;
get length(): number;
}
export declare class Intervention {
status: number;
url: string | null;
log: string | null;
disruptive: boolean;
}
export declare class Transaction {
constructor(modsec: ModSecurity, rules: Rules);
processConnection(clientIP: Stringable, clientPort: number, serverIP: Stringable, serverPort: number): boolean | Intervention;
processURI(uri: Stringable, method: Stringable, httpVersion: Stringable): boolean | Intervention;
addRequestHeader(name: Stringable | Buffer, value: Stringable | Buffer): boolean;
processRequestHeaders(): boolean | Intervention;
appendRequestBody(body: string | Buffer): boolean | Intervention;
requestBodyFromFile(path: Stringable): boolean | Intervention;
processRequestBody(): boolean | Intervention;
addResponseHeader(name: Stringable | Buffer, value: Stringable | Buffer): boolean;
processResponseHeaders(status: number, protocolVersion: Stringable): boolean | Intervention;
updateStatusCode(status: number): boolean;
appendResponseBody(body: string | Buffer): boolean | Intervention;
processResponseBody(): boolean | Intervention;
processLogging(): boolean;
}
export {};