Skip to content

Commit 2edd979

Browse files
committed
Do not use declare module in first-party type declarations
First-party type declarations should simply be provided at top level in .d.ts files with the right filenames. The `declare module` was breaking usage like `import "handlebars/runtime.js"` (which happens to be the only way to import the runtime from a project with native ES modules, "type": "module"). Signed-off-by: Anders Kaseorg <[email protected]>
1 parent e914d60 commit 2edd979

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

runtime.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import Handlebars = require('handlebars')
1+
import Handlebars = require('handlebars');
22

3-
declare module "handlebars/runtime" {
4-
5-
}
3+
export = Handlebars;

types/index.d.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,4 @@ declare namespace hbs {
413413
}
414414
}
415415

416-
declare module "handlebars" {
417-
export = Handlebars;
418-
}
419-
420-
declare module "handlebars/runtime" {
421-
export = Handlebars;
422-
}
416+
export = Handlebars;

0 commit comments

Comments
 (0)