Skip to content

Conversation

@rbuckton
Copy link
Contributor

This regenerates the LKG in master now that we've reverted 'awaited'.

@rbuckton rbuckton merged commit 065a996 into master Mar 31, 2020
@rbuckton rbuckton deleted the lkg-without-awaited branch March 31, 2020 18:54
@muuki88
Copy link

muuki88 commented May 14, 2020

This commit removes the WindowConsole object. Was this intented? It breaks window.console access with Property 'console' does not exist on type 'Window'

@muuki88
Copy link

muuki88 commented May 14, 2020

It seem that this was introduced in microsoft/TypeScript-DOM-lib-generator#831

@gaspard
Copy link

gaspard commented Sep 18, 2020

This commit breaks the generateKey overloads in SubtleCrypto...

I have no idea how to fix this...

interface SubtleCrypto {
    // AlgorithmIdentifier is too generic and masks other overloads. This definition should come last.
    // Previous definition had only 'string' which was more specific and prevented other definitions from
    // being hidden.
    generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
    generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
    generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
}

This breaks compilation for this perfectly correct code:

export const encAlgo: AesKeyGenParams = {
  name: 'AES-CBC',
  length: 128,
}

crypto.subtle
      .generateKey(encAlgo, true, ['decrypt', 'encrypt']) // ==> THIS USES THE GENERIC OVERLOAD
      // Symetric crypto: should see a CryptoKey
      .then(cryptoKey => { // SEES cryptoKey as CryptoKey | CryptoKeyPair
        crypto.subtle
          .exportKey('raw', cryptoKey) // FAILS NOW
          .then(keyBuffer => {
             // ...
          }, reject)
      }, reject)

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants