added @types/cryptr

This commit is contained in:
Roman Rogowski
2018-12-06 17:48:12 -05:00
parent 6f6aaa4dee
commit 3027a7b01e
4 changed files with 54 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
import Cryptr = require('cryptr');
// $ExpectType Cryptr
const cryptr = new Cryptr('myTotallySecretKey');
// $ExpectType string
const encrypted_string = cryptr.encrypt('bacon');
// $ExpectType string
cryptr.decrypt(encrypted_string);
+20
View File
@@ -0,0 +1,20 @@
// Type definitions for cryptr 4.0
// Project: https://github.com/MauriceButler/cryptr
// Definitions by: Roman Rogowski <https://github.com/rrogowski>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare class Cryptr {
/**
* Cryptr provides a mechanism for aes-256-ctr encryption/decryption.
* @param secret key used for encryption/decryption
*/
constructor(secret: string);
/** Encrypt a string. */
encrypt(value: string): string;
/** Decrypt a string. */
decrypt(value: string): string;
}
export = Cryptr;
+23
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",
"cryptr-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }