Skip to content

Commit ab38020

Browse files
Merge pull request #46 from apstanisic/add-types
Add TypeScript support
2 parents a8d22ba + 2bf96f0 commit ab38020

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

index.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
declare class Cryptr {
2+
constructor(
3+
secret: string,
4+
options?: { pbkdf2Iterations?: number; saltLength?: number },
5+
);
6+
7+
encrypt(value: string): string;
8+
9+
decrypt(value: string): string;
10+
}
11+
12+
export = Cryptr;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "6.1.0",
44
"description": "a simple encrypt and decrypt module for node.js",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"directories": {
78
"test": "tests"
89
},

0 commit comments

Comments
 (0)