Skip to content

Commit 2767829

Browse files
authored
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
1 parent 7bf34e9 commit 2767829

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,4 @@ export interface Hotkeys {
178178
}
179179
// https://github.com/eiriklv/react-masonry-component/issues/57
180180
declare var hotkeys: Hotkeys;
181-
export default hotkeys;
181+
export = hotkeys;

0 commit comments

Comments
 (0)