ScottHamper / Cookies

JavaScript Client-Side Cookie Manipulation Library
The Unlicense
1.77k stars 169 forks source link

Typescript fails to find type definitions #73

Open letharion opened 7 years ago

letharion commented 7 years ago

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.

faergeek commented 7 years ago

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