mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Merge pull request #31142 from rrogowski/@types/cryptr
Added types for cryptr
This commit is contained in:
10
types/cryptr/cryptr-tests.ts
Normal file
10
types/cryptr/cryptr-tests.ts
Normal 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
types/cryptr/index.d.ts
vendored
Normal file
20
types/cryptr/index.d.ts
vendored
Normal 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
types/cryptr/tsconfig.json
Normal file
23
types/cryptr/tsconfig.json
Normal 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
types/cryptr/tslint.json
Normal file
1
types/cryptr/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user