Skip to content

Rerun LKG to remove 'awaited' type #37616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2020
Merged

Rerun LKG to remove 'awaited' type #37616

merged 1 commit into from
Mar 31, 2020

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants