Merge pull request #33365 from adamzerella/types/cipher-base

[cipher-base] Add typing for cipher-base
This commit is contained in:
Nathan Shively-Sanders
2019-03-06 08:00:07 -08:00
committed by GitHub
4 changed files with 59 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import CipherBase = require("cipher-base");
const buf = new Buffer(1);
class CipherTest extends CipherBase {
constructor() {
super();
}
final() {
return buf;
}
update(testBuffer: Buffer) {
return testBuffer;
}
}
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for cipher-base 1.0
// Project: https://github.com/crypto-browserify/cipher-base
// Definitions by: Adam Zerella <https://github.com/adamzerella>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
declare abstract class CipherBase {
constructor(hashMode?: string);
abstract final(): Buffer;
abstract update(value: Buffer, inputEnc?: string, outputEnc?: string): Buffer;
}
export = CipherBase;
+25
View File
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [
],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"cipher-base-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}