Vault.d.ts:1087:2 - error TS2666: Exports and export assignments are not permitted in module augmentations.
Closed this issue · 4 comments
abcfy2 commented
Describe the bug
I try to use this lib in typescript but I got this error:
> rimraf dist && tsc -p tsconfig-build.json
node_modules/hashi-vault-js/Vault.d.ts:1087:2 - error TS2666: Exports and export assignments are not permitted in module augmentations.
1087 export = Vault;
~~~~~~
Found 1 error in node_modules/hashi-vault-js/Vault.d.ts:1087
abcfy2 commented
I find the reason: https://github.com/rod4n4m1/hashi-vault-js/blob/62c30e41dd3b6f4eeab3bd07d8d2bc58718e238f/Vault.d.ts#L1087
Should be export default class Vault {/.../}
export =
cannot inside declare module
.
abcfy2 commented
And I think declare module "hashi-vault-js"
can be removed:
// declare module "hashi-vault-js" {
export default class Vault {
//...
}
//}
rod4n4m1 commented
Folks, instead of re-coding all the interfaces, I just used the TypeScript compiler to generate the .d.ts files from the JavaScript code through JSDoc syntax.
https://www.typescriptlang.org/docs/handbook/declaration-files/dts-from-js.html
Please check if that's good enough!
rod4n4m1 commented
Closing it due to the age and lack of feedback.