diff --git a/nacl-util.d.ts b/nacl-util.d.ts new file mode 100644 index 0000000..49fa190 --- /dev/null +++ b/nacl-util.d.ts @@ -0,0 +1,11 @@ +// Type definitions for tweetnacl-util + +declare var util: util; +export = util; + +interface util { + decodeUTF8(s: string): Uint8Array; + encodeUTF8(arr: Uint8Array): string; + encodeBase64(arr: Uint8Array): string; + decodeBase64(s: string): Uint8Array; +} \ No newline at end of file diff --git a/package.json b/package.json index 9abb64d..9d6ffa0 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.13.3", "description": "String encoding utilitlies extracted from TweetNaCl.js", "main": "nacl-util.js", + "types": "nacl-util.d.ts", "scripts": { "build": "uglifyjs nacl-util.js -c -m -o nacl-util.min.js" },