I'm using a .d.ts
definition file I found online for interoperating with a JavaScript library.
I'm seeing the error message:
TS1046: 'declare' modifier required for top level element
What is causing this?
I'm using TypeScript 0.9.1.
This was a breaking change between 0.8.x vs 0.9.x. declare
is now required for all top level non-interface elements (i.e. module
, class
, var
) in a declaration .d.ts
file:
Source: Microsoft Blog
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With