plainheart / bing-translate-api

A simple and free API for Bing & Microsoft Translator for Node.js
https://github.com/plainheart/bing-translate-api
MIT License
156 stars 28 forks source link

fix:index.d.ts: remove nested declare modifier for TS1038 #37

Closed suejon closed 6 months ago

suejon commented 6 months ago

The generated index.d.ts after running npm run gen:config seems to nest a declare inside another declare scope which the typescript compiler plains about with this message: node_modules/bing-translate-api/index.d.ts(247,3): error TS1038: A 'declare' modifier cannot be used in an already ambient context.. https://github.com/microsoft/TypeScript/blob/42bb138173e3b3869b6a6f68d277c7172387a4cf/src/compiler/diagnosticMessages.json#L114-L117

This points to an issue inside the generate-config.js. But you might have a better idea of what is happening here.

suejon commented 6 months ago

My mistake, the fix needed to happen inside index.tpl.d.ts, not index.d.ts

plainheart commented 6 months ago

Thanks for your contribution!