Update TypeScript to 4.4.2

This commit is contained in:
Fedor Indutny 2021-08-27 13:21:42 -07:00 committed by GitHub
parent 853e27e9eb
commit a43abe628a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 21 additions and 462 deletions

View file

@ -15,105 +15,6 @@ import {
typedArrayToArrayBuffer,
} from '../Crypto';
declare global {
// this is fixed in already, and won't be necessary when the new definitions
// files are used: https://github.com/microsoft/TSJS-lib-generator/pull/843
// We want to extend `SubtleCrypto`, so we need an interface.
// eslint-disable-next-line no-restricted-syntax
export interface SubtleCrypto {
decrypt(
algorithm:
| string
| RsaOaepParams
| AesCtrParams
| AesCbcParams
| AesCmacParams
| AesGcmParams
| AesCfbParams,
key: CryptoKey,
data:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| ArrayBuffer
): Promise<ArrayBuffer>;
digest(
algorithm: string | Algorithm,
data:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| ArrayBuffer
): Promise<ArrayBuffer>;
importKey(
format: 'raw' | 'pkcs8' | 'spki',
keyData:
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| ArrayBuffer,
algorithm:
| string
| RsaHashedImportParams
| EcKeyImportParams
| HmacImportParams
| DhImportKeyParams
| AesKeyAlgorithm,
extractable: boolean,
keyUsages: Array<string>
): Promise<CryptoKey>;
importKey(
format: string,
keyData:
| JsonWebKey
| Int8Array
| Int16Array
| Int32Array
| Uint8Array
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array
| DataView
| ArrayBuffer,
algorithm:
| string
| RsaHashedImportParams
| EcKeyImportParams
| HmacImportParams
| DhImportKeyParams
| AesKeyAlgorithm,
extractable: boolean,
keyUsages: Array<string>
): Promise<CryptoKey>;
}
}
const PROFILE_IV_LENGTH = 12; // bytes
const PROFILE_KEY_LENGTH = 32; // bytes
const PROFILE_TAG_LENGTH = 128; // bits