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

How to define types for local JS file #260

Closed
sonovice opened this issue Nov 22, 2018 · 0 comments
Closed

How to define types for local JS file #260

sonovice opened this issue Nov 22, 2018 · 0 comments

Comments

@sonovice
Copy link

I am having troubles using a simple one-file JS library with this template. This is my folder structure:

src/app.ts
src/verovio.js <-- the library
src/types/verovio.d.ts

The app.ts consists of the following:

/// <reference path="./types/verovio.d.ts" />
import * as verovio from './verovio'

And verovio.d.ts:

declare module 'verovio' // Todo: Dirty, do it properly!

I've also put src/types into the typeRoots property of my tsconfig.json (which shouldn't be necessary anymore). But I still get the same error over and over again:

error TS7016: Could not find a declaration file for module './verovio'. '/foo/bar/project/src/verovio.js' implicitly has an 'any' type.

Any ideas what I'm doing wrong? This is at least how I got it to work in another project.

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

1 participant