diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..3a188b4 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,19 @@ +declare module "fpcalc" { + export interface FpcalcOptions { + length?: number + raw?: boolean + command?: string + } + + export interface FpcalcResult { + file?: string + duration?: number + fingerprint: T + } + + function fpcalc(file: string | ReadableStream, callback: (err: Error, result: FpcalcResult) => void) + function fpcalc(file: string | ReadableStream, options: FpcalcOptions & { raw: true }, callback: (err: Error, result: FpcalcResult) => void) + function fpcalc(file: string | ReadableStream, options: FpcalcOptions, callback: (err: Error, result: FpcalcResult) => void) + + export default fpcalc +} \ No newline at end of file diff --git a/package.json b/package.json index 8c1ec16..a5a6058 100644 --- a/package.json +++ b/package.json @@ -31,5 +31,6 @@ }, "devDependencies": { "tape": "^4.2.1" - } -} + }, + "types": "index.d.ts" +} \ No newline at end of file