Open
Description
As of @types/web@0.0.208
, SubtleCrypto is declared as:
interface SubtleCrypto {
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
}
Notably, the keyUsages
argument in the first overload accepts readonly KeyUsage[]
, while the second overload requires a mutable array.
Web Cryptography API section 14.3.9 does not have any procedure that would mutate this argument.
Hence, this argument should accept readonly
in both overloads.
The same problem also occurs in one of the overloads in deriveKey
and generateKey
and unwrapKey
methods.
Metadata
Metadata
Assignees
Labels
No labels