From 2ef486211f5c7588e000b57ca9f8b325f3355a4e Mon Sep 17 00:00:00 2001 From: Richard Burkhardt Date: Fri, 11 Jan 2019 13:19:23 +0100 Subject: [PATCH] enhanced types to make encryption libs accessible --- dist/secure-ls.d.ts | 23 ++++++++++++++++++++++- package.json | 2 ++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/dist/secure-ls.d.ts b/dist/secure-ls.d.ts index 987f024..06582c1 100644 --- a/dist/secure-ls.d.ts +++ b/dist/secure-ls.d.ts @@ -1,5 +1,8 @@ export = SecureLS; +import * as LZString from 'lz-string'; +import {CipherHelper, Encoder} from 'crypto-js'; + declare class SecureLS { constructor(config?: { isCompression?: boolean, encodingType?: string, encryptionSecret?: string , encryptionNamespace?: string }); getEncryptionSecret(): string; @@ -15,6 +18,24 @@ declare class SecureLS { processData(data: any | string, isAllKeysData: boolean): string; setMetaData(): void; getMetaData(): { keys: string[] }; + + _name: 'secure-ls'; + Base64: SecureLS.Base64; + LZString: LZString.LZStringStatic; + AES: CipherHelper; + DES: CipherHelper; + RABBIT: CipherHelper; + RC4: CipherHelper; + enc: { + Latin1: Encoder; + _Utf8: Encoder; + }; } -declare namespace SecureLS{} \ No newline at end of file +declare namespace SecureLS{ + interface Base64 { + _keyStr: string; + encode(e: string); + decode(e: string); + } +} \ No newline at end of file diff --git a/package.json b/package.json index b49591e..e8f4e29 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,8 @@ "coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls" }, "devDependencies": { + "@types/crypto-js": "^3.1.43", + "@types/lz-string": "^1.3.32", "babel": "6.3.13", "babel-core": "6.1.18", "babel-eslint": "5.0.0",