mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
da7962fd4d
PR-URL: https://github.com/nodejs/node/pull/49742 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
declare namespace InternalHttpParserBinding {
|
|
type Buffer = Uint8Array;
|
|
type Stream = object;
|
|
|
|
class HTTPParser {
|
|
static REQUEST: 1;
|
|
static RESPONSE: 2;
|
|
|
|
static kOnMessageBegin: 0;
|
|
static kOnHeaders: 1;
|
|
static kOnHeadersComplete: 2;
|
|
static kOnBody: 3;
|
|
static kOnMessageComplete: 4;
|
|
static kOnExecute: 5;
|
|
static kOnTimeout: 6;
|
|
|
|
static kLenientNone: number;
|
|
static kLenientHeaders: number;
|
|
static kLenientChunkedLength: number;
|
|
static kLenientKeepAlive: number;
|
|
static kLenientAll: number;
|
|
|
|
close(): void;
|
|
free(): void;
|
|
execute(buffer: Buffer): Error | Buffer;
|
|
finish(): Error | Buffer;
|
|
initialize(
|
|
type: number,
|
|
resource: object,
|
|
maxHeaderSize?: number,
|
|
lenient?: number,
|
|
headersTimeout?: number,
|
|
): void;
|
|
pause(): void;
|
|
resume(): void;
|
|
consume(stream: Stream): void;
|
|
unconsume(): void;
|
|
getCurrentBuffer(): Buffer;
|
|
}
|
|
}
|
|
|
|
export interface HttpParserBinding {
|
|
methods: string[];
|
|
HTTPParser: typeof InternalHttpParserBinding.HTTPParser;
|
|
}
|