Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/typings/index.d.ts(293,1): error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. #61

Closed
TiFu opened this issue Dec 31, 2018 · 3 comments

Comments

@TiFu
Copy link

TiFu commented Dec 31, 2018

Hey,

first: thanks for creating this great API!

I am currently trying to get kayn to work with TypeScript. Unfortunately, it looks like the typings are incorrect for TypeScript v3.2.2 and are missing multiple declare modifiers in front of top level classes/enums.

Repo for reproduction: https://github.com/TiFu/kayn-bug
Output of npm run build:

$ npm run build

> test@1.0.0 build ~\test
> tsc

node_modules/kayn/typings/index.d.ts(293,1): error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! test@1.0.0 build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the test@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     ~\AppData\Roaming\npm-cache\_logs\2018-12-31T02_14_58_111Z-debug.log

A trivial fix would be prepending declare in front of all top level classes/enums in typings/index.d.ts and upgrading the TypeScript version in typings/package.json.

@cnguy
Copy link
Owner

cnguy commented Dec 31, 2018

Thank you! Forgot about TS 3.. releasing the fix after I double-check

cnguy added a commit that referenced this issue Dec 31, 2018
cnguy added a commit that referenced this issue Dec 31, 2018
@cnguy
Copy link
Owner

cnguy commented Dec 31, 2018

Fix is in v0.9.3, try it out

@TiFu
Copy link
Author

TiFu commented Dec 31, 2018

Works like a charm. Thanks!

Happy new year!

@TiFu TiFu closed this as completed Dec 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants