diff --git a/packages/nodejs/.changesets/fix-compatibility-for-global-object-augmentation.md b/packages/nodejs/.changesets/fix-compatibility-for-global-object-augmentation.md new file mode 100644 index 00000000..b718fb60 --- /dev/null +++ b/packages/nodejs/.changesets/fix-compatibility-for-global-object-augmentation.md @@ -0,0 +1,5 @@ +--- +bump: "patch" +--- + +Fix TypeScript compatibility for global object augmentation. diff --git a/packages/nodejs/global.d.ts b/packages/nodejs/global.d.ts new file mode 100644 index 00000000..8ba1668d --- /dev/null +++ b/packages/nodejs/global.d.ts @@ -0,0 +1,5 @@ +export {} + +declare global { + var __APPSIGNAL__: any +} diff --git a/packages/nodejs/tsconfig.json b/packages/nodejs/tsconfig.json index 43605857..2657f1b2 100644 --- a/packages/nodejs/tsconfig.json +++ b/packages/nodejs/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../../tsconfig.json", - "include": ["src/**/*", "vendor.d.ts"], + "include": ["src/**/*", "vendor.d.ts", "global.d.ts"], "exclude": [ "src/**/__tests__", "src/**/__mocks__" diff --git a/packages/nodejs/vendor.d.ts b/packages/nodejs/vendor.d.ts index 792ee64b..25c39dac 100644 --- a/packages/nodejs/vendor.d.ts +++ b/packages/nodejs/vendor.d.ts @@ -17,9 +17,3 @@ declare module "require-in-the-middle" { export = Hook } - -declare module NodeJS { - interface Global { - __APPSIGNAL__: any - } -}