Creating new definitions for "md5-file" (#29505)

This commit is contained in:
BamButz 2018-10-08 18:31:15 +02:00 committed by Andy
parent a9d806263a
commit f03bd00508
4 changed files with 44 additions and 0 deletions

11
types/md5-file/index.d.ts vendored Normal file
View File

@ -0,0 +1,11 @@
// Type definitions for md5-file 4.0
// Project: https://github.com/roryrjb/md5-file#readme
// Definitions by: BamButz <https://github.com/BamButz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare var module: {
(filename: string, cb: (err: Error, hash: string) => void): void;
sync: (filename: string) => string;
};
export = module;

View File

@ -0,0 +1,9 @@
import * as md5 from "md5-file";
// $ExpectType void
md5("test.txt", (err, hash) => {
return;
});
// $ExpectType string
md5.sync("text.txt");

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"strictFunctionTypes": true
},
"files": [
"index.d.ts",
"md5-file-tests.ts"
]
}

View File

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