-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update http and add missing exports
- Loading branch information
Showing
7 changed files
with
41 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,35 @@ | ||
// https://nodejs.org/api/http.html | ||
import type http from 'node:http' | ||
import http from 'node:http' | ||
import { notImplemented } from '../../_internal/utils' | ||
|
||
import * as consts from './_consts' | ||
import * as request from './_request' | ||
import * as response from './_response' | ||
import { IncomingMessage } from './_request' | ||
import { ServerResponse } from './_response' | ||
|
||
export * from './_consts' | ||
export * from './_request' | ||
export * from './_response' | ||
|
||
// @ts-ignore | ||
export const createServer: typeof http.createServer = notImplemented('http.createServer') | ||
export const request: typeof http.request = notImplemented('http.request') | ||
export const get: typeof http.get = notImplemented('http.get') | ||
|
||
export const Server: typeof http.Server = undefined as any as typeof http.Server | ||
export const OutgoingMessage: typeof http.OutgoingMessage = undefined as any as typeof http.OutgoingMessage | ||
export const ClientRequest: typeof http.ClientRequest = undefined as any as typeof http.ClientRequest | ||
export const Agent: typeof http.Agent = undefined as any as typeof http.Agent | ||
export const globalAgent: typeof http.globalAgent = undefined as any as typeof http.globalAgent | ||
|
||
export default <typeof http> { | ||
...consts, | ||
...request, | ||
...response | ||
IncomingMessage: IncomingMessage as any as typeof http.IncomingMessage, | ||
ServerResponse: ServerResponse as any as typeof http.ServerResponse, | ||
createServer, | ||
request, | ||
get, | ||
Server, | ||
OutgoingMessage, | ||
ClientRequest, | ||
Agent, | ||
globalAgent | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters