diff --git a/src/middleware/node/get-missing-headers.ts b/src/middleware/node/get-missing-headers.ts index d7d878d7..8e4b0c32 100644 --- a/src/middleware/node/get-missing-headers.ts +++ b/src/middleware/node/get-missing-headers.ts @@ -1,6 +1,6 @@ // remove type imports from http for Deno compatibility // see https://github.com/octokit/octokit.js/issues/24#issuecomment-817361886 -// import { IncomingMessage } from "http"; +// import type { IncomingMessage } from "node:http"; type IncomingMessage = any; const WEBHOOK_HEADERS = [ diff --git a/src/middleware/node/get-payload.ts b/src/middleware/node/get-payload.ts index 9d1d4909..30c924ad 100644 --- a/src/middleware/node/get-payload.ts +++ b/src/middleware/node/get-payload.ts @@ -2,12 +2,12 @@ import AggregateError from "aggregate-error"; // remove type imports from http for Deno compatibility -// see https://github.com/octokit/octokit.js/issues/24#issuecomment-817361886 -// import { IncomingMessage } from "http"; -// declare module "http" { -// interface IncomingMessage { -// body?: WebhookEvent | unknown; -// } +// see https://github.com/octokit/octokit.js/issues/2075#issuecomment-817361886 +// import type { IncomingMessage } from "node:http"; +// declare module "node:http" { +// interface IncomingMessage { +// body?: string; +// } // } type IncomingMessage = any; diff --git a/src/middleware/node/middleware.ts b/src/middleware/node/middleware.ts index 4947172d..d80246e3 100644 --- a/src/middleware/node/middleware.ts +++ b/src/middleware/node/middleware.ts @@ -1,6 +1,6 @@ // remove type imports from http for Deno compatibility // see https://github.com/octokit/octokit.js/issues/2075#issuecomment-817361886 -// import { IncomingMessage, ServerResponse } from "http"; +// import type { IncomingMessage, ServerResponse } from "node:http"; type IncomingMessage = any; type ServerResponse = any; diff --git a/src/middleware/node/on-unhandled-request-default.ts b/src/middleware/node/on-unhandled-request-default.ts index 367b1c0f..bb064961 100644 --- a/src/middleware/node/on-unhandled-request-default.ts +++ b/src/middleware/node/on-unhandled-request-default.ts @@ -1,6 +1,6 @@ // remove type imports from http for Deno compatibility // see https://github.com/octokit/octokit.js/issues/24#issuecomment-817361886 -// import { IncomingMessage, ServerResponse } from "http"; +// import type { IncomingMessage, ServerResponse } from "node:http"; type IncomingMessage = any; type ServerResponse = any; diff --git a/test/typescript-validate.ts b/test/typescript-validate.ts index 4d76f915..32f5d900 100644 --- a/test/typescript-validate.ts +++ b/test/typescript-validate.ts @@ -5,7 +5,7 @@ import { WebhookError, createNodeMiddleware, } from "../src/index.ts"; -import { createServer } from "http"; +import { createServer } from "node:http"; import type { HandlerFunction, RemoveHandlerFunction,