mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Merge pull request #31062 from TeamworkGuy2/master
[shasum] Add shasum@1.0 definition
This commit is contained in:
14
types/shasum/index.d.ts
vendored
Normal file
14
types/shasum/index.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// Type definitions for shasum 1.0
|
||||
// Project: https://github.com/dominictarr/shasum
|
||||
// Definitions by: TeamworkGuy2 <https://github.com/TeamworkGuy2>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Single function that return the sha1sum. Installing this is just a little bit quicker than reading the crypto documentation.
|
||||
* var shasum = require('shasum')
|
||||
* shasum(string || buffer || object)
|
||||
* It also works in the browser with browserify.
|
||||
*/
|
||||
declare function shasum(str: any, alg?: string | null, format?: "hex" | "latin1" | "base64"): string;
|
||||
|
||||
export = shasum;
|
||||
7
types/shasum/shasum-tests.ts
Normal file
7
types/shasum/shasum-tests.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import shasum = require("shasum");
|
||||
|
||||
function test(): string {
|
||||
const res1 = shasum("source");
|
||||
const res2 = shasum({ prop: "source" }, null, "hex");
|
||||
return res1 || res2;
|
||||
}
|
||||
23
types/shasum/tsconfig.json
Normal file
23
types/shasum/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"shasum-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/shasum/tslint.json
Normal file
1
types/shasum/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user