Skip to content

Support Type Script 6 #484

Description

@taranda

Request support for Type Script 6. Upgrading to Type Script 6 results in 13 Type Errors across 6 filest:

src/common.ts:51:7 - error TS2322: Type 'CryptoEngine | null' is not assignable to type 'ICryptoEngine | null'.
  Type 'CryptoEngine' is not assignable to type 'ICryptoEngine'.
    Types of property 'generateKey' are incompatible.
      Type '{ (algorithm: "Ed25519", extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; }' is not assignable to type '{ (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>; }'.
        Types of parameters 'algorithm' and 'algorithm' are incompatible.
          Type '"X25519" | { name: "X25519"; }' is not assignable to type '"Ed25519"'.
            Type '"X25519"' is not assignable to type '"Ed25519"'.

51       crypto = typeof self !== "undefined" && self.crypto ? new CryptoEngine({ name: "browser", crypto: self.crypto }) : null;
         ~~~~~~

src/common.ts:62:7 - error TS2322: Type 'CryptoEngine' is not assignable to type 'ICryptoEngine'.
  Types of property 'generateKey' are incompatible.
    Type '{ (algorithm: "Ed25519", extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; }' is not assignable to type '{ (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>; }'.
      Types of parameters 'algorithm' and 'algorithm' are incompatible.
        Type '"X25519" | { name: "X25519"; }' is not assignable to type '"Ed25519"'.
          Type '"X25519"' is not assignable to type '"Ed25519"'.

62       crypto = new CryptoEngine({
         ~~~~~~

src/CryptoEngine/AbstractCryptoEngine.ts:65:10 - error TS2416: Property 'generateKey' in type 'AbstractCryptoEngine' is not assignable to the same property in base type 'ICryptoEngine'.
  Type '{ (algorithm: "Ed25519", extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; }' is not assignable to type '{ (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>; }'.
    Types of parameters 'algorithm' and 'algorithm' are incompatible.
      Type '"X25519" | { name: "X25519"; }' is not assignable to type '"Ed25519"'.
        Type '"X25519"' is not assignable to type '"Ed25519"'.

65   public generateKey(algorithm: "Ed25519", extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
            ~~~~~~~~~~~

src/CryptoEngine/AbstractCryptoEngine.ts:66:10 - error TS2416: Property 'generateKey' in type 'AbstractCryptoEngine' is not assignable to the same property in base type 'ICryptoEngine'.
  Type '{ (algorithm: "Ed25519", extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; }' is not assignable to type '{ (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>; }'.
    Types of parameters 'algorithm' and 'algorithm' are incompatible.
      Type '"X25519" | { name: "X25519"; }' is not assignable to type '"Ed25519"'.
        Type '"X25519"' is not assignable to type '"Ed25519"'.

66   public generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
            ~~~~~~~~~~~

src/CryptoEngine/AbstractCryptoEngine.ts:67:10 - error TS2416: Property 'generateKey' in type 'AbstractCryptoEngine' is not assignable to the same property in base type 'ICryptoEngine'.
  Type '{ (algorithm: "Ed25519", extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; }' is not assignable to type '{ (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>; }'.
    Types of parameters 'algorithm' and 'algorithm' are incompatible.
      Type '"X25519" | { name: "X25519"; }' is not assignable to type '"Ed25519"'.
        Type '"X25519"' is not assignable to type '"Ed25519"'.

67   public generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
            ~~~~~~~~~~~

src/CryptoEngine/AbstractCryptoEngine.ts:68:10 - error TS2416: Property 'generateKey' in type 'AbstractCryptoEngine' is not assignable to the same property in base type 'ICryptoEngine'.
  Type '{ (algorithm: "Ed25519", extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; }' is not assignable to type '{ (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>; }'.
    Types of parameters 'algorithm' and 'algorithm' are incompatible.
      Type '"X25519" | { name: "X25519"; }' is not assignable to type '"Ed25519"'.
        Type '"X25519"' is not assignable to type '"Ed25519"'.

68   public generateKey(algorithm: globalThis.AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
            ~~~~~~~~~~~

src/CryptoEngine/AbstractCryptoEngine.ts:69:16 - error TS2416: Property 'generateKey' in type 'AbstractCryptoEngine' is not assignable to the same property in base type 'ICryptoEngine'.
  Type '{ (algorithm: "Ed25519", extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; }' is not assignable to type '{ (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>; }'.
    Types of parameters 'algorithm' and 'algorithm' are incompatible.
      Type '"X25519" | { name: "X25519"; }' is not assignable to type '"Ed25519"'.
        Type '"X25519"' is not assignable to type '"Ed25519"'.

69   public async generateKey(...args: any[]): Promise<CryptoKey | CryptoKeyPair> {
                  ~~~~~~~~~~~

src/CryptoEngine/AbstractCryptoEngine.ts:113:40 - error TS2345: Argument of type 'ArrayBufferView<ArrayBufferLike>' is not assignable to parameter of type 'ArrayBufferView<ArrayBuffer>'.
  Type 'ArrayBufferLike' is not assignable to type 'ArrayBuffer'.
    Type 'SharedArrayBuffer' is not assignable to type 'ArrayBuffer'.
      Types of property '[Symbol.toStringTag]' are incompatible.
        Type '"SharedArrayBuffer"' is not assignable to type '"ArrayBuffer"'.

113     return this.crypto.getRandomValues(array) as T;
                                           ~~~~~

src/CryptoEngine/CryptoEngineInit.ts:13:34 - error TS2345: Argument of type 'CryptoEngine' is not assignable to parameter of type 'ICryptoEngine'.
  Types of property 'generateKey' are incompatible.
    Type '{ (algorithm: "Ed25519", extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; }' is not assignable to type '{ (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>; }'.
      Types of parameters 'algorithm' and 'algorithm' are incompatible.
        Type '"X25519" | { name: "X25519"; }' is not assignable to type '"Ed25519"'.
          Type '"X25519"' is not assignable to type '"Ed25519"'.

13     common.setEngine(engineName, new CryptoEngine({ name: engineName, crypto: globalThis.crypto }));
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  src/common.ts:43:17
    43 export function setEngine(name: string, ...args: any[]): void {
                       ~~~~~~~~~
    The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.

src/CryptoEngine/CryptoEngineInit.ts:18:28 - error TS2345: Argument of type 'CryptoEngine' is not assignable to parameter of type 'ICryptoEngine'.
  Types of property 'generateKey' are incompatible.
    Type '{ (algorithm: "Ed25519", extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; }' is not assignable to type '{ (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>; }'.
      Types of parameters 'algorithm' and 'algorithm' are incompatible.
        Type '"X25519" | { name: "X25519"; }' is not assignable to type '"Ed25519"'.
          Type '"X25519"' is not assignable to type '"Ed25519"'.

18     common.setEngine(name, new CryptoEngine({ name, crypto: nodeCrypto }));
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  src/common.ts:43:17
    43 export function setEngine(name: string, ...args: any[]): void {
                       ~~~~~~~~~
    The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.

test/nodePKCS12Example.spec.ts:236:38 - error TS2345: Argument of type 'NodeEngine' is not assignable to parameter of type 'ICryptoEngine'.
  Types of property 'generateKey' are incompatible.
    Type '{ (algorithm: "Ed25519", extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; }' is not assignable to type '{ (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>; }'.
      Types of parameters 'algorithm' and 'algorithm' are incompatible.
        Type '"X25519" | { name: "X25519"; }' is not assignable to type '"Ed25519"'.
          Type '"X25519"' is not assignable to type '"Ed25519"'.

236     pkijs.setEngine(nodeEngine.name, nodeEngine);
                                         ~~~~~~~~~~

  src/common.ts:43:17
    43 export function setEngine(name: string, ...args: any[]): void {
                       ~~~~~~~~~
    The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.

test/rsaPssSpki.spec.ts:26:54 - error TS2345: Argument of type 'CryptoEngine' is not assignable to parameter of type 'ICryptoEngine'.
  Types of property 'generateKey' are incompatible.
    Type '{ (algorithm: "Ed25519", extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; }' is not assignable to type '{ (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>; }'.
      Types of parameters 'algorithm' and 'algorithm' are incompatible.
        Type '"X25519" | { name: "X25519"; }' is not assignable to type '"Ed25519"'.
          Type '"X25519"' is not assignable to type '"Ed25519"'.

26     await publicKeyInfo.importKey(keyPair.publicKey, engine);
                                                        ~~~~~~

test/utils.ts:56:27 - error TS2345: Argument of type 'CryptoEngine' is not assignable to parameter of type 'ICryptoEngine'.
  Types of property 'generateKey' are incompatible.
    Type '{ (algorithm: "Ed25519", extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; }' is not assignable to type '{ (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>; (algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: readonly ("sign" | "verify")[]): Promise<CryptoKeyPair>; (algorithm: "X25519" | { name: "X25519"; }, extractable: boolean, keyUsages: readonly ("deriveBits" | "deriveKey")[]): Promise<CryptoKeyPair>; (algorithm: EcKeyGenParams | RsaHashedKeyGenParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>; (algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>; }'.
      Types of parameters 'algorithm' and 'algorithm' are incompatible.
        Type '"X25519" | { name: "X25519"; }' is not assignable to type '"Ed25519"'.
          Type '"X25519"' is not assignable to type '"Ed25519"'.

56     pkijs.setEngine(name, new pkijs.CryptoEngine({ name, crypto: webcrypto }));
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  src/common.ts:43:17
    43 export function setEngine(name: string, ...args: any[]): void {
                       ~~~~~~~~~
    The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.


Found 13 errors in 6 files.

Errors  Files
     2  src/common.ts:51
     6  src/CryptoEngine/AbstractCryptoEngine.ts:65
     2  src/CryptoEngine/CryptoEngineInit.ts:13
     1  test/nodePKCS12Example.spec.ts:236
     1  test/rsaPssSpki.spec.ts:26
     1  test/utils.ts:56

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions