From cbf3ed607443c085d4c63b08f477604fdf1408ef Mon Sep 17 00:00:00 2001 From: Scott Date: Wed, 25 Jul 2018 12:07:20 -0400 Subject: [PATCH] AES encrypt also allows word arrays (#27569) the following code will execute fine, but typescript doesn't recognize it as valid var input = CryptoJS.lib.WordArray.create(new Uint8Array(5)); var encrypted = CryptoJS.AES.encrypt(input, secretKeyString, { iv: CryptoJS.enc.Hex.parse('00000000000000000000000000000000'), mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 }); --- types/crypto-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/crypto-js/index.d.ts b/types/crypto-js/index.d.ts index 02db36ab6c..faeeac78e6 100644 --- a/types/crypto-js/index.d.ts +++ b/types/crypto-js/index.d.ts @@ -29,7 +29,7 @@ declare namespace CryptoJS { interface StreamCipher extends Cipher {} interface CipherHelper { - encrypt(message: string, secretPassphrase: string | WordArray, option?: CipherOption): WordArray; + encrypt(message: string | LibWordArray, secretPassphrase: string | WordArray, option?: CipherOption): WordArray; decrypt(encryptedMessage: string | WordArray, secretPassphrase: string | WordArray, option?: CipherOption): DecryptedMessage; } interface Encryptor {