Skip to content

Typescript fails to find type definitions #73

@letharion

Description

@letharion

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions