From 2767829cc7c142fddb2cd03b9fa0d88cee9e66ae Mon Sep 17 00:00:00 2001 From: Maddy Miller Date: Fri, 8 Dec 2023 22:59:36 +1000 Subject: [PATCH] fix: fix types under node16 moduleResolution (#441) The types of this library do not match the actual JS code, leading to a situation where using ESM under the `node16` moduleResolution method in TypeScript, the default export types will fail to resolve. TypeScript is more strict around type compliance with these settings enabled, and therefore requires the types to match. The JS code does not use a default import, as `export default` in ESM is not identical to `module.exports = `. `export =` can be used in the `index.d.ts` to match the behaviour within the JS file. More information on this specific issue is available here, https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseExportDefault.md --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 2a6651c..528d09b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -178,4 +178,4 @@ export interface Hotkeys { } // https://github.com/eiriklv/react-masonry-component/issues/57 declare var hotkeys: Hotkeys; -export default hotkeys; +export = hotkeys;