Cookies icon indicating copy to clipboard operation
Cookies copied to clipboard

Typescript fails to find type definitions

Open letharion opened this issue 7 years ago • 1 comments

import * as cookies from 'cookies-js'; yields: error TS7016: Could not find a declaration file for module 'cookies-js'. 'node_modules/cookies-js/dist/cookies.js' implicitly has an 'any' type.

I believe there's (at least) two ways to resolve this.

a) Include explicit "typings" into the package.json file, telling tsc where to look. "typings": "dist/cookies.d.ts", this is what I've done locally for now. b) Submit type definitions to https://github.com/DefinitelyTyped/DefinitelyTyped and they will then become available under the new "@types/" package type with npm.

letharion avatar May 23 '17 10:05 letharion

@ScottHamper Would be really nice to have typings correctly discovered by typescript out-of-the-box

faergeek avatar Oct 23 '17 13:10 faergeek