diff options
Diffstat (limited to 'typings/internalBinding/http_parser.d.ts')
-rw-r--r-- | typings/internalBinding/http_parser.d.ts | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/typings/internalBinding/http_parser.d.ts b/typings/internalBinding/http_parser.d.ts new file mode 100644 index 0000000000..260c6e802b --- /dev/null +++ b/typings/internalBinding/http_parser.d.ts @@ -0,0 +1,42 @@ +declare namespace InternalHttpParserBinding { + 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: object): void; + unconsume(): void; + getCurrentBuffer(): Buffer; + } +} + +declare function InternalBinding(binding: 'http_parser'): { + methods: string[]; + HTTPParser: typeof InternalHttpParserBinding.HTTPParser; +}; |