Skip to content

TypeScript typingsΒ #14

@kachkaev

Description

@kachkaev

πŸ‘‹ @btd! I just came across your library – looks great! WDYT of adding typescript typings so that users could avoid these errors in TS imports:

Could not find a declaration file for module 'sharp-phash'. '/path/tp/project/node_modules/.pnpm/[email protected][email protected]/node_modules/sharp-phash/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/sharp-phash` if it exists or add a new declaration (.d.ts) file containing `declare module 'sharp-phash';`ts(7016)

In the meantime, this serves as a workaround:

// @ts-expect-error -- upstream types do not exist: https://github.com/btd/sharp-phash/issues/14
import phash from "sharp-phash";
// @ts-expect-error -- upstream types do not exist: https://github.com/btd/sharp-phash/issues/14
import phashDistance from "sharp-phash/distance";

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