Create a type definition for npm module ssdeep (#38264)

This commit is contained in:
Arne Schubert 2019-09-11 16:14:30 +02:00 committed by Mine Starks
parent 0043edad70
commit fc2b1b6d16
4 changed files with 42 additions and 0 deletions

10
types/ssdeep/index.d.ts vendored Normal file
View File

@ -0,0 +1,10 @@
// Type definitions for ssdeep 0.1
// Project: https://github.com/pchaigno/node-ssdeep
// Definitions by: Arne Schubert <https://github.com/atd-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;

View File

@ -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);

View 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",
"ssdeep-tests.ts"
]
}

1
types/ssdeep/tslint.json Normal file
View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }