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

add types declaration file for TS support #16

Closed
wants to merge 1 commit into from
Closed

add types declaration file for TS support #16

wants to merge 1 commit into from

Conversation

andersonjoseph
Copy link

closes #14

@kachkaev
Copy link

Thanks for this PR @andersonjoseph! @btd WDYT?

@kachkaev
Copy link

In the meantime, I am using declarations/sharp-phash.d.ts as a workaround:

declare module "sharp-phash" {
  import type sharp from "sharp";

  type SharpImage = Parameters<typeof sharp>[0];
  type SharpOptions = Parameters<typeof sharp>[1];

  export default function phash(
    image: SharpImage,
    options?: SharpOptions,
  ): Promise<string>;
}

declare module "sharp-phash/distance" {
  export default function distance(a: string, b: string): number;
}

Thanks for crafting the diff @andersonjoseph 🙌

@andersonjoseph andersonjoseph closed this by deleting the head repository Jun 29, 2024
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

Successfully merging this pull request may close these issues.

TypeScript typings
2 participants