mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
Motivation (#40091)
Use "export =" syntax instead of "export default" syntax. Because in Node.js environment, ES6 module syntax could not be converted correctly to CommonJS module syntax. Solution Use "export =" syntax. Refer to <https://www.typescriptlang.org/docs/handbook/modules.html>
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
fb3c5606ad
commit
65d3b17a6f
Vendored
+1
-1
@@ -28,4 +28,4 @@ interface UIDGeneratorClass {
|
||||
|
||||
declare const UIDGenerator: UIDGeneratorClass;
|
||||
|
||||
export { UIDGenerator as default, UIDGeneratorClass, UIDGeneratorInstance };
|
||||
export = UIDGenerator;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { default as UIDGenerator } from 'uid-generator';
|
||||
import UIDGenerator = require('uid-generator');
|
||||
|
||||
new UIDGenerator('abc'); // $ExpectType UIDGeneratorInstance
|
||||
const generator = new UIDGenerator(128, 'abc'); // $ExpectType UIDGeneratorInstance
|
||||
|
||||
Reference in New Issue
Block a user