mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Merge pull request #30842 from BendingBender/create-hash
Add types for create-hash
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import createHash = require('create-hash');
|
||||
|
||||
const hash = createHash('sha224');
|
||||
|
||||
hash.update('synchronous write');
|
||||
hash.digest();
|
||||
hash.write('write to it as a stream');
|
||||
hash.end();
|
||||
hash.read();
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
// Type definitions for create-hash 1.2
|
||||
// Project: https://github.com/crypto-browserify/createHash
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Hash } from 'crypto';
|
||||
|
||||
export = createHash;
|
||||
|
||||
declare function createHash(algo: createHash.Algorithm): Hash;
|
||||
|
||||
declare namespace createHash {
|
||||
type Algorithm =
|
||||
| 'md5'
|
||||
| 'rmd160'
|
||||
| 'ripemd160'
|
||||
| 'sha'
|
||||
| 'sha1'
|
||||
| 'sha224'
|
||||
| 'sha256'
|
||||
| 'sha384'
|
||||
| 'sha512';
|
||||
}
|
||||
@@ -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",
|
||||
"create-hash-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user