zipWithPassword method results in TypeScript type error (ts-2345) when passed string for encryptionType #327
Description
Describe the bug
TypeScript linter flags the string passed in for the encryptionType parameter when invoking the zipWithPassword method
To Reproduce
If I invoke zipWithPassword as follows:
await zipWithPassword(source, target, password, 'AES-256')
TypeScript complains:
Argument of type '"AES-256"' is not assignable to parameter of type 'encryptionMethods | undefined'. ts(2345)
Expected behavior
No TypeScript errors for relevant strings passed in for encryptionMethods parameter.
Env (please complete the following information):
- Device:
- OS: Linux
- OS Version: Linux Mint 20.2
- Package Version: 7.0.1
Additional context
I believe you've incorrectly implemented your enum in your index.d.ts. The correct implementation should be:
enum EncryptionMethods { STANDARD = "STANDARD", AES_128 = "AES-128", AES_256 = "AES-256" }
If I edit your types declaration as above, everything works as expected and TypeScript is happy. For context, I'm running an Android emulator using Android Studio. When invoking zipWithPassword, I am passing a single file as source, so it's enclosed in an array, as per documentation.