Closed G-Rath closed 4 years ago
You forgot to add issueType to index.d.ts ð
You forgot to add issueType to index.d.ts ð
Good catch!
Plus you've reminded me I should use export =
in issueType.d.ts
:D
Can you give a comment about why we use export =
, not export declare class ...
?
Sure!
We use it b/c that represents the export in the js
; you can see this in the playground, but in a nutshell, here's what each type of export transpiles to:
export default 'hello';
Becomes
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = 'hello';
export const hello = 'hello';
Becomes
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hello = 'hello';
export = 'hello';
Becomes
"use strict";
module.exports = 'hello';
Since the exports are being done using module.exports
, the correct way to represent that in TypeScript is to use export = ...
ð
This is new knowledge for me, thanks!
No problem! It's a bit of an edge-case in TS land, that you generally don't need to worry about unless you're writing types manually ðŽ
Thanks! ðĪŠ
ð