diff --git a/types/ssdeep/index.d.ts b/types/ssdeep/index.d.ts new file mode 100644 index 0000000000..f8ade9f2b2 --- /dev/null +++ b/types/ssdeep/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for ssdeep 0.1 +// Project: https://github.com/pchaigno/node-ssdeep +// Definitions by: Arne Schubert +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function compare(hash1: string, hash2: string): number; + +export function hash(content: string): string; + +export function hash_from_file(path: string): string; diff --git a/types/ssdeep/ssdeep-tests.ts b/types/ssdeep/ssdeep-tests.ts new file mode 100644 index 0000000000..cdcbcaf3e8 --- /dev/null +++ b/types/ssdeep/ssdeep-tests.ts @@ -0,0 +1,8 @@ +import { compare, hash, hash_from_file } from 'ssdeep'; + +let str = 'string'; +let num = 123; + +num = compare(str, str); +str = hash(str); +str = hash_from_file(str); diff --git a/types/ssdeep/tsconfig.json b/types/ssdeep/tsconfig.json new file mode 100644 index 0000000000..4360d2906f --- /dev/null +++ b/types/ssdeep/tsconfig.json @@ -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", + "ssdeep-tests.ts" + ] +} diff --git a/types/ssdeep/tslint.json b/types/ssdeep/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ssdeep/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }