sharp-phash
sharp-phash copied to clipboard
add types declaration file for TS support
closes #14
Thanks for this PR @andersonjoseph! @btd WDYT?
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 🙌