mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
added types for img-diff-js (#46231)
* added types for img-diff-js * Update types/img-diff-js/index.d.ts Co-authored-by: Florian Keller <ffflorian@users.noreply.github.com> * Update types/img-diff-js/index.d.ts Co-authored-by: Florian Keller <ffflorian@users.noreply.github.com> * updated JSDoc * Update types/img-diff-js/index.d.ts Co-authored-by: Sheetal Nandi <shkamat@microsoft.com> Co-authored-by: Florian Keller <ffflorian@users.noreply.github.com> Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
This commit is contained in:
parent
39c383fd8a
commit
22aaff326a
8
types/img-diff-js/img-diff-js-tests.ts
Normal file
8
types/img-diff-js/img-diff-js-tests.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import { imgDiff } from 'img-diff-js';
|
||||
|
||||
const options = {
|
||||
actualFilename: 'a.jpg',
|
||||
expectedFilename: 'b.jpg',
|
||||
};
|
||||
|
||||
const result = imgDiff(options); // $ExpectType Promise<ImgDiffResult>
|
||||
31
types/img-diff-js/index.d.ts
vendored
Normal file
31
types/img-diff-js/index.d.ts
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
// Type definitions for img-diff-js 0.4
|
||||
// Project: https://github.com/reg-viz/img-diff-js#readme
|
||||
// Definitions by: Daniel Chif <https://github.com/nadchif>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface ImgDiffOptions {
|
||||
actualFilename: string;
|
||||
expectedFilename: string;
|
||||
diffFilename?: string;
|
||||
/** {default:false} */
|
||||
generateOnlyDiffFile?: boolean;
|
||||
options?: {
|
||||
/** {default: 0.1} */
|
||||
threshold?: number;
|
||||
/** {default:false} */
|
||||
includeAA?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ImgDiffResult {
|
||||
width: number;
|
||||
height: number;
|
||||
imagesAreSame: boolean;
|
||||
diffCount: number;
|
||||
}
|
||||
/**
|
||||
* Create image differential between two images.
|
||||
*/
|
||||
export function imgDiff(opt: ImgDiffOptions): Promise<ImgDiffResult>;
|
||||
|
||||
export function registerDecoder(extensions: string[], decoder: (filename: string) => any): void;
|
||||
23
types/img-diff-js/tsconfig.json
Normal file
23
types/img-diff-js/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"img-diff-js-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/img-diff-js/tslint.json
Normal file
1
types/img-diff-js/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user