Skip to content

Commit

Permalink
Add missing type aliases (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
yassernasc authored Feb 4, 2025
1 parent 214e995 commit 4943bd8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export {
HTTPError as errors
}

export const STATUS_CODES: typeof constants.status

export interface HTTPIncomingMessageEvents extends ReadableEvents {
timeout: []
}
Expand Down Expand Up @@ -65,6 +67,8 @@ export class HTTPIncomingMessage {
)
}

export { HTTPIncomingMessage as IncomingMessage }

export interface HTTPOutgoingMessageEvents extends WritableEvents {
timeout: []
}
Expand All @@ -90,6 +94,8 @@ export class HTTPOutgoingMessage {
constructor(socket?: TCPSocket)
}

export { HTTPOutgoingMessage as OutgoingMessage }

export interface HTTPAgentOptions {
keepAlive?: boolean
keepAliveMsecs?: number
Expand Down Expand Up @@ -122,6 +128,8 @@ export class HTTPAgent {

export const globalAgent: HTTPAgent

export { HTTPAgent as Agent }

export interface HTTPServerEvents extends TCPServerEvents {
request: [req: HTTPIncomingMessage, res: HTTPServerResponse]
upgrade: [req: HTTPIncomingMessage, socket: TCPSocket, head: Buffer]
Expand All @@ -146,6 +154,8 @@ export class HTTPServer {
)
}

export { HTTPServer as Server }

export interface HTTPServerResponse extends HTTPOutgoingMessage {
readonly req: HTTPIncomingMessage
readonly statusCode: HTTPStatusCode
Expand All @@ -167,6 +177,8 @@ export class HTTPServerResponse {
constructor(socket: TCPSocket, req: HTTPIncomingMessage, close: boolean)
}

export { HTTPServerResponse as ServerResponse }

export interface HTTPServerConnectionOptions {
IncomingMessage?: typeof HTTPIncomingMessage
ServerResponse?: typeof HTTPServerResponse
Expand All @@ -192,6 +204,8 @@ export class HTTPServerConnection {
static for(socket: TCPSocket): HTTPServerConnection
}

export { HTTPServerConnection as ServerConnection }

export interface HTTPClientRequestEvents extends HTTPOutgoingMessageEvents {
response: [res: HTTPIncomingMessage]
upgrade: [res: HTTPIncomingMessage, socket: TCPSocket, head: Buffer]
Expand All @@ -218,6 +232,8 @@ export class HTTPClientRequest {
constructor(onresponse: () => void)
}

export { HTTPClientRequest as ClientRequest }

export interface HTTPClientConnectionOptions {
IncomingMessage?: typeof HTTPIncomingMessage
}
Expand All @@ -242,6 +258,8 @@ export class HTTPClientConnection {
): HTTPClientConnection
}

export { HTTPClientConnection as ClientConnection }

export function createServer(
opts?: HTTPServerConnectionOptions,
onrequest?: (req: HTTPIncomingMessage, res: HTTPServerResponse) => void
Expand Down

0 comments on commit 4943bd8

Please sign in to comment.