question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid declaration file index.d.ts

See original GitHub issue

Hello,

I wanted to utilize the elastic-builder (1.0.2), however during typescript transpilation I get the following error:

ERROR in node_modules/elastic-builder/index.d.ts (280,1): A 'declare' modifier is required for a top level declaration in a .d.ts file.

this refers to the top-level definition:

class Query {

which is not allowed since typescript 0.9. (https://typescript.codeplex.com/wikipage?title=Known breaking changes between 0.8 and 0.9)

Could you adapt your building / publishing procedure to produce a valid declaration file?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rado0x54commented, Jul 28, 2017

Wow, I would have offered to take a look on the weekend, but you were a lot faster. 1.0.3 works fine for me now. Thank you very much!

0reactions
sudo-suhascommented, Jul 30, 2017

@rado0x54 I was actually imitating some of the modules I found in DefinitelyTyped. Dunno about the real impact of export type. I was able to use it in the test file with ES6 import.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid TypeScript declaration files (.d.ts) emitted when mono ...
It seems Parcel fails to emit valid TypeScript declaration files (.d.ts) when the input source is importing any of its mono-repo related ...
Read more >
generated declaration file (d.ts) with bad imports
These import statements are output in the d.ts declaration files. That makes the declaration files invalid because there are no sass files ...
Read more >
TypeScript errors and how to fix them
A list of common TypeScript errors and how to fix them.
Read more >
How to fix error TS7016: Could not find a declaration file for ...
Try `npm install @types/XYZ` if it exists or add a new declaration (.d.ts) file containing `declare module 'XYZ';. If XYZ is a direct...
Read more >
Module: Class - TypeScript: Documentation
/*~ This is the module template file for class modules. *~ You should rename it to index.d.ts and place it in a folder...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found