Update dependency typescript to v5.9.3 (#30492)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
renovate[bot]
2026-01-08 19:23:40 +00:00
committed by GitHub
co-authored by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Michael Telatynski
parent ce741f055c
commit 795780da66
14 changed files with 81 additions and 41 deletions
+1 -1
View File
@@ -294,7 +294,7 @@
"stylelint-value-no-unknown-custom-properties": "^6.0.1", "stylelint-value-no-unknown-custom-properties": "^6.0.1",
"terser-webpack-plugin": "^5.3.9", "terser-webpack-plugin": "^5.3.9",
"testcontainers": "^11.0.0", "testcontainers": "^11.0.0",
"typescript": "5.8.3", "typescript": "5.9.3",
"util": "^0.12.5", "util": "^0.12.5",
"web-streams-polyfill": "^4.0.0", "web-streams-polyfill": "^4.0.0",
"webpack": "^5.89.0", "webpack": "^5.89.0",
@@ -11,6 +11,53 @@ index 917a7fc..a2710c6 100644
didOkOrSubmit: boolean; didOkOrSubmit: boolean;
model: M; model: M;
}>; }>;
diff --git a/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.d.ts b/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.d.ts
index cb5f2e5..51daa51 100644
--- a/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.d.ts
+++ b/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.d.ts
@@ -66,23 +66,23 @@ export interface SetupEncryptionStoreProjection {
export interface ProvideCryptoSetupExtensions {
examineLoginResponse(response: any, credentials: ExtendedMatrixClientCreds): void;
persistCredentials(credentials: ExtendedMatrixClientCreds): void;
- getSecretStorageKey(): Uint8Array | null;
- createSecretStorageKey(): Uint8Array | null;
+ getSecretStorageKey(): Uint8Array<ArrayBuffer> | null;
+ createSecretStorageKey(): Uint8Array<ArrayBuffer> | null;
catchAccessSecretStorageError(e: Error): void;
setupEncryptionNeeded: (args: CryptoSetupArgs) => boolean;
/** @deprecated This callback is no longer used by matrix-react-sdk */
- getDehydrationKeyCallback(): ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array) => void) => Promise<Uint8Array>) | null;
+ getDehydrationKeyCallback(): ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array<ArrayBuffer>) => void) => Promise<Uint8Array<ArrayBuffer>>) | null;
SHOW_ENCRYPTION_SETUP_UI: boolean;
}
export declare abstract class CryptoSetupExtensionsBase implements ProvideCryptoSetupExtensions {
abstract examineLoginResponse(response: any, credentials: ExtendedMatrixClientCreds): void;
abstract persistCredentials(credentials: ExtendedMatrixClientCreds): void;
- abstract getSecretStorageKey(): Uint8Array | null;
- abstract createSecretStorageKey(): Uint8Array | null;
+ abstract getSecretStorageKey(): Uint8Array<ArrayBuffer> | null;
+ abstract createSecretStorageKey(): Uint8Array<ArrayBuffer> | null;
abstract catchAccessSecretStorageError(e: Error): void;
abstract setupEncryptionNeeded(args: CryptoSetupArgs): boolean;
/** `getDehydrationKeyCallback` is no longer used; we provide an empty impl for type compatibility. */
- getDehydrationKeyCallback(): ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array) => void) => Promise<Uint8Array>) | null;
+ getDehydrationKeyCallback(): ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array<ArrayBuffer>) => void) => Promise<Uint8Array<ArrayBuffer>>) | null;
abstract SHOW_ENCRYPTION_SETUP_UI: boolean;
}
export interface CryptoSetupArgs {
@@ -98,9 +98,9 @@ export declare class DefaultCryptoSetupExtensions extends CryptoSetupExtensionsB
SHOW_ENCRYPTION_SETUP_UI: boolean;
examineLoginResponse(response: any, credentials: ExtendedMatrixClientCreds): void;
persistCredentials(credentials: ExtendedMatrixClientCreds): void;
- getSecretStorageKey(): Uint8Array | null;
- createSecretStorageKey(): Uint8Array | null;
+ getSecretStorageKey(): Uint8Array<ArrayBuffer> | null;
+ createSecretStorageKey(): Uint8Array<ArrayBuffer> | null;
catchAccessSecretStorageError(e: Error): void;
setupEncryptionNeeded(args: CryptoSetupArgs): boolean;
- getDehydrationKeyCallback(): ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array) => void) => Promise<Uint8Array>) | null;
+ getDehydrationKeyCallback(): ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array<ArrayBuffer>) => void) => Promise<Uint8Array<ArrayBuffer>>) | null;
}
diff --git a/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.js b/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.js diff --git a/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.js b/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.js
index 5d422ed..b823add 100644 index 5d422ed..b823add 100644
--- a/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.js --- a/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.js
+5 -17
View File
@@ -13,7 +13,7 @@ import { type MatrixClient } from "matrix-js-sdk/src/matrix";
import type { Logger } from "matrix-js-sdk/src/logger"; import type { Logger } from "matrix-js-sdk/src/logger";
import type { SecretStorageKeyDescription } from "matrix-js-sdk/src/secret-storage"; import type { SecretStorageKeyDescription } from "matrix-js-sdk/src/secret-storage";
import type { Credentials, HomeserverInstance } from "../plugins/homeserver"; import type { Credentials, HomeserverInstance } from "../plugins/homeserver";
import type { GeneratedSecretStorageKey } from "matrix-js-sdk/src/crypto-api"; import type { CryptoCallbacks, GeneratedSecretStorageKey } from "matrix-js-sdk/src/crypto-api";
import { bootstrapCrossSigningForClient, Client } from "./client"; import { bootstrapCrossSigningForClient, Client } from "./client";
export interface CredentialsOptionalAccessToken extends Omit<Credentials, "accessToken"> { export interface CredentialsOptionalAccessToken extends Omit<Credentials, "accessToken"> {
@@ -141,22 +141,12 @@ export class Bot extends Client {
const logger = getLogger(`bot ${credentials.userId}`); const logger = getLogger(`bot ${credentials.userId}`);
const keys = {};
const getCrossSigningKey = (type: string) => {
return keys[type];
};
const saveCrossSigningKeys = (k: Record<string, Uint8Array>) => {
Object.assign(keys, k);
};
// Store the cached secret storage key and return it when `getSecretStorageKey` is called // Store the cached secret storage key and return it when `getSecretStorageKey` is called
let cachedKey: { keyId: string; key: Uint8Array }; let cachedKey: { keyId: string; key: Uint8Array<ArrayBuffer> };
const cacheSecretStorageKey = ( const cacheSecretStorageKey = (
keyId: string, keyId: string,
keyInfo: SecretStorageKeyDescription, keyInfo: SecretStorageKeyDescription,
key: Uint8Array, key: Uint8Array<ArrayBuffer>,
) => { ) => {
cachedKey = { cachedKey = {
keyId, keyId,
@@ -165,11 +155,9 @@ export class Bot extends Client {
}; };
const getSecretStorageKey = () => const getSecretStorageKey = () =>
Promise.resolve<[string, Uint8Array]>([cachedKey.keyId, cachedKey.key]); Promise.resolve<[string, Uint8Array<ArrayBuffer>]>([cachedKey.keyId, cachedKey.key]);
const cryptoCallbacks = { const cryptoCallbacks: CryptoCallbacks = {
getCrossSigningKey,
saveCrossSigningKeys,
cacheSecretStorageKey, cacheSecretStorageKey,
getSecretStorageKey, getSecretStorageKey,
}; };
+5 -5
View File
@@ -25,7 +25,7 @@ import InteractiveAuthDialog from "./components/views/dialogs/InteractiveAuthDia
// during the same single operation. Use `accessSecretStorage` below to scope a // during the same single operation. Use `accessSecretStorage` below to scope a
// single secret storage operation, as it will clear the cached keys once the // single secret storage operation, as it will clear the cached keys once the
// operation ends. // operation ends.
let secretStorageKeys: Record<string, Uint8Array> = {}; let secretStorageKeys: Record<string, Uint8Array<ArrayBuffer>> = {};
let secretStorageKeyInfo: Record<string, SecretStorage.SecretStorageKeyDescription> = {}; let secretStorageKeyInfo: Record<string, SecretStorage.SecretStorageKeyDescription> = {};
let secretStorageBeingAccessed = false; let secretStorageBeingAccessed = false;
@@ -50,8 +50,8 @@ export class AccessCancelledError extends Error {
function makeInputToKey( function makeInputToKey(
keyInfo: SecretStorage.SecretStorageKeyDescription, keyInfo: SecretStorage.SecretStorageKeyDescription,
): (keyParams: KeyParams) => Promise<Uint8Array> { ): (keyParams: KeyParams) => Promise<Uint8Array<ArrayBuffer>> {
return async ({ passphrase, recoveryKey }): Promise<Uint8Array> => { return async ({ passphrase, recoveryKey }): Promise<Uint8Array<ArrayBuffer>> => {
if (passphrase) { if (passphrase) {
return deriveRecoveryKeyFromPassphrase(passphrase, keyInfo.passphrase.salt, keyInfo.passphrase.iterations); return deriveRecoveryKeyFromPassphrase(passphrase, keyInfo.passphrase.salt, keyInfo.passphrase.iterations);
} else if (recoveryKey) { } else if (recoveryKey) {
@@ -68,7 +68,7 @@ async function getSecretStorageKey(
keys: Record<string, SecretStorage.SecretStorageKeyDescription>; keys: Record<string, SecretStorage.SecretStorageKeyDescription>;
}, },
secretName: string, secretName: string,
): Promise<[string, Uint8Array]> { ): Promise<[string, Uint8Array<ArrayBuffer>]> {
const cli = MatrixClientPeg.safeGet(); const cli = MatrixClientPeg.safeGet();
const defaultKeyId = await cli.secretStorage.getDefaultKeyId(); const defaultKeyId = await cli.secretStorage.getDefaultKeyId();
@@ -138,7 +138,7 @@ async function getSecretStorageKey(
function cacheSecretStorageKey( function cacheSecretStorageKey(
keyId: string, keyId: string,
keyInfo: SecretStorage.SecretStorageKeyDescription, keyInfo: SecretStorage.SecretStorageKeyDescription,
key: Uint8Array, key: Uint8Array<ArrayBuffer>,
): void { ): void {
if (secretStorageBeingAccessed) { if (secretStorageBeingAccessed) {
logger.debug(`Caching 4S key ${keyId}`); logger.debug(`Caching 4S key ${keyId}`);
@@ -112,7 +112,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
if (keyFromCustomisations) this.initExtension(keyFromCustomisations); if (keyFromCustomisations) this.initExtension(keyFromCustomisations);
} }
private initExtension(keyFromCustomisations: Uint8Array): void { private initExtension(keyFromCustomisations: Uint8Array<ArrayBuffer>): void {
logger.log("CryptoSetupExtension: Created key via extension, jumping to bootstrap step"); logger.log("CryptoSetupExtension: Created key via extension, jumping to bootstrap step");
this.recoveryKey = { this.recoveryKey = {
privateKey: keyFromCustomisations, privateKey: keyFromCustomisations,
+1 -1
View File
@@ -142,7 +142,7 @@ export class VoiceMessageRecording implements IDestroyable {
this.buffer = concat(this.buffer, buf); this.buffer = concat(this.buffer, buf);
}; };
private get audioBuffer(): Uint8Array { private get audioBuffer(): Uint8Array<ArrayBuffer> {
// We need a clone of the buffer to avoid accidentally changing the position // We need a clone of the buffer to avoid accidentally changing the position
// on the real thing. // on the real thing.
return this.buffer.slice(0); return this.buffer.slice(0);
+7 -3
View File
@@ -180,7 +180,11 @@ export async function encryptMegolmKeyFile(
* @param {String} password password * @param {String} password password
* @return {Promise<[CryptoKey, CryptoKey]>} promise for [aes key, hmac key] * @return {Promise<[CryptoKey, CryptoKey]>} promise for [aes key, hmac key]
*/ */
async function deriveKeys(salt: Uint8Array, iterations: number, password: string): Promise<[CryptoKey, CryptoKey]> { async function deriveKeys(
salt: Uint8Array<ArrayBuffer>,
iterations: number,
password: string,
): Promise<[CryptoKey, CryptoKey]> {
const start = new Date(); const start = new Date();
let key; let key;
@@ -249,7 +253,7 @@ const TRAILER_LINE = "-----END MEGOLM SESSION DATA-----";
* @param {ArrayBuffer} data input file * @param {ArrayBuffer} data input file
* @return {Uint8Array} unbase64ed content * @return {Uint8Array} unbase64ed content
*/ */
function unpackMegolmKeyFile(data: ArrayBuffer): Uint8Array { function unpackMegolmKeyFile(data: ArrayBuffer): Uint8Array<ArrayBuffer> {
// parse the file as a great big String. This should be safe, because there // parse the file as a great big String. This should be safe, because there
// should be no non-ASCII characters, and it means that we can do string // should be no non-ASCII characters, and it means that we can do string
// comparisons to find the header and footer, and feed it into window.atob. // comparisons to find the header and footer, and feed it into window.atob.
@@ -340,7 +344,7 @@ function encodeBase64(uint8Array: Uint8Array): string {
* @param {string} base64 The base64 to decode. * @param {string} base64 The base64 to decode.
* @return {Uint8Array} The decoded data. * @return {Uint8Array} The decoded data.
*/ */
function decodeBase64(base64: string): Uint8Array { function decodeBase64(base64: string): Uint8Array<ArrayBuffer> {
// window.atob returns a unicode string with codepoints in the range 0-255. // window.atob returns a unicode string with codepoints in the range 0-255.
const latin1String = window.atob(base64); const latin1String = window.atob(base64);
// Encode the string as a Uint8Array // Encode the string as a Uint8Array
+2 -2
View File
@@ -297,8 +297,8 @@ export class GroupedArray<K, T> {
} }
} }
export const concat = (...arrays: Uint8Array[]): Uint8Array => { export const concat = (...arrays: Uint8Array<ArrayBuffer>[]): Uint8Array<ArrayBuffer> => {
return arrays.reduce((concatenatedSoFar: Uint8Array, toBeConcatenated: Uint8Array) => { return arrays.reduce((concatenatedSoFar: Uint8Array<ArrayBuffer>, toBeConcatenated: Uint8Array<ArrayBuffer>) => {
const concatenated = new Uint8Array(concatenatedSoFar.length + toBeConcatenated.length); const concatenated = new Uint8Array(concatenatedSoFar.length + toBeConcatenated.length);
concatenated.set(concatenatedSoFar, 0); concatenated.set(concatenatedSoFar, 0);
concatenated.set(toBeConcatenated, concatenatedSoFar.length); concatenated.set(toBeConcatenated, concatenatedSoFar.length);
+2 -2
View File
@@ -48,7 +48,7 @@ export interface EncryptedPickleKey {
* @param {string} deviceId The device ID which owns the pickle key. * @param {string} deviceId The device ID which owns the pickle key.
* @return {Uint8Array} The additional data as a Uint8Array. * @return {Uint8Array} The additional data as a Uint8Array.
*/ */
export function getPickleAdditionalData(userId: string, deviceId: string): Uint8Array { export function getPickleAdditionalData(userId: string, deviceId: string): Uint8Array<ArrayBuffer> {
const additionalData = new Uint8Array(userId.length + deviceId.length + 1); const additionalData = new Uint8Array(userId.length + deviceId.length + 1);
for (let i = 0; i < userId.length; i++) { for (let i = 0; i < userId.length; i++) {
additionalData[i] = userId.charCodeAt(i); additionalData[i] = userId.charCodeAt(i);
@@ -70,7 +70,7 @@ export function getPickleAdditionalData(userId: string, deviceId: string): Uint8
* @returns Data object ready for storing in indexeddb. * @returns Data object ready for storing in indexeddb.
*/ */
export async function encryptPickleKey( export async function encryptPickleKey(
pickleKey: Uint8Array, pickleKey: Uint8Array<ArrayBuffer>,
userId: string, userId: string,
deviceId: string, deviceId: string,
): Promise<EncryptedPickleKey | undefined> { ): Promise<EncryptedPickleKey | undefined> {
+1 -1
View File
@@ -39,7 +39,7 @@ export const HAS_REFRESH_TOKEN_STORAGE_KEY = "mx_has_refresh_token";
* @param pickleKey * @param pickleKey
* @returns AES key * @returns AES key
*/ */
async function pickleKeyToAesKey(pickleKey: string): Promise<Uint8Array> { async function pickleKeyToAesKey(pickleKey: string): Promise<Uint8Array<ArrayBuffer>> {
const pickleKeyBuffer = new Uint8Array(pickleKey.length); const pickleKeyBuffer = new Uint8Array(pickleKey.length);
for (let i = 0; i < pickleKey.length; i++) { for (let i = 0; i < pickleKey.length; i++) {
pickleKeyBuffer[i] = pickleKey.charCodeAt(i); pickleKeyBuffer[i] = pickleKey.charCodeAt(i);
+2 -1
View File
@@ -64,7 +64,8 @@ global.URL.revokeObjectURL = jest.fn();
// polyfilling TextEncoder as it is not available on JSDOM // polyfilling TextEncoder as it is not available on JSDOM
// view https://github.com/facebook/jest/issues/9983 // view https://github.com/facebook/jest/issues/9983
global.TextEncoder = TextEncoder; // XXX: Node's implementation has marginally different types, so we fudge it
(globalThis as any).TextEncoder = TextEncoder;
// @ts-ignore // @ts-ignore
global.TextDecoder = TextDecoder; global.TextDecoder = TextDecoder;
@@ -118,7 +118,7 @@ describe("VoiceMessageRecording", () => {
const encryptedFile = {} as unknown as EncryptedFile; const encryptedFile = {} as unknown as EncryptedFile;
beforeEach(() => { beforeEach(() => {
voiceRecording.onDataAvailable!(testBuf); voiceRecording.onDataAvailable!(testBuf.buffer);
}); });
it("contentLength should return the buffer length", () => { it("contentLength should return the buffer length", () => {
@@ -59,8 +59,8 @@ const TEST_VECTORS = [
], ],
]; ];
function stringToArray(s: string): ArrayBufferLike { function stringToArray(s: string): ArrayBuffer {
return new TextEncoder().encode(s).buffer; return new TextEncoder().encode(s).buffer as ArrayBuffer;
} }
describe("MegolmExportEncryption", function () { describe("MegolmExportEncryption", function () {
+4 -4
View File
@@ -13330,10 +13330,10 @@ typed-array-length@^1.0.7:
possible-typed-array-names "^1.0.0" possible-typed-array-names "^1.0.0"
reflect.getprototypeof "^1.0.6" reflect.getprototypeof "^1.0.6"
typescript@5.8.3: typescript@5.9.3:
version "5.8.3" version "5.9.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.3.tgz#92f8a3e5e3cf497356f4178c34cd65a7f5e8440e" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.3.tgz#5b4f59e15310ab17a216f5d6cf53ee476ede670f"
integrity sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ== integrity sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==
ua-parser-js@1.0.40: ua-parser-js@1.0.40:
version "1.0.40" version "1.0.40"