1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-07-31 15:24:23 +03:00

Update to Node 22 LTS (#4832)

Switch typescript lib to es2024 and make necessary type changes

Fixes https://github.com/matrix-org/matrix-js-sdk/issues/4796

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2025-05-08 14:38:18 +01:00
committed by GitHub
parent bb9280ad6b
commit d24c5d8b2b
5 changed files with 7 additions and 6 deletions

View File

@ -3,7 +3,7 @@
"version": "37.5.0", "version": "37.5.0",
"description": "Matrix Client-Server SDK for Javascript", "description": "Matrix Client-Server SDK for Javascript",
"engines": { "engines": {
"node": ">=20.0.0" "node": ">=22.0.0"
}, },
"scripts": { "scripts": {
"prepack": "yarn build", "prepack": "yarn build",

View File

@ -1604,7 +1604,7 @@ function sha256(commitmentStr: string): string {
return encodeUnpaddedBase64(createHash("sha256").update(commitmentStr, "utf8").digest()); return encodeUnpaddedBase64(createHash("sha256").update(commitmentStr, "utf8").digest());
} }
function encodeUnpaddedBase64(uint8Array: ArrayBuffer | Uint8Array): string { function encodeUnpaddedBase64(uint8Array: ArrayLike<number>): string {
return Buffer.from(uint8Array).toString("base64").replace(/=+$/g, ""); return Buffer.from(uint8Array).toString("base64").replace(/=+$/g, "");
} }
@ -1638,7 +1638,7 @@ function buildReadyMessage(
} }
/** build an m.key.verification.start to-device message suitable for the m.reciprocate.v1 flow, originating from the dummy device */ /** build an m.key.verification.start to-device message suitable for the m.reciprocate.v1 flow, originating from the dummy device */
function buildReciprocateStartMessage(transactionId: string, sharedSecret: ArrayBuffer) { function buildReciprocateStartMessage(transactionId: string, sharedSecret: ArrayLike<number>) {
return { return {
type: "m.key.verification.start", type: "m.key.verification.start",
content: { content: {

View File

@ -89,7 +89,7 @@ export class EncryptionManager implements IEncryptionManager {
private transport: IKeyTransport, private transport: IKeyTransport,
private statistics: Statistics, private statistics: Statistics,
private onEncryptionKeysChanged: ( private onEncryptionKeysChanged: (
keyBin: Uint8Array<ArrayBufferLike>, keyBin: Uint8Array,
encryptionKeyIndex: number, encryptionKeyIndex: number,
participantId: string, participantId: string,
) => void, ) => void,

View File

@ -417,7 +417,7 @@ export class MatrixRTCSession extends TypedEventEmitter<
() => this.memberships, () => this.memberships,
transport, transport,
this.statistics, this.statistics,
(keyBin: Uint8Array<ArrayBufferLike>, encryptionKeyIndex: number, participantId: string) => { (keyBin: Uint8Array, encryptionKeyIndex: number, participantId: string) => {
this.emit(MatrixRTCSessionEvent.EncryptionKeyChanged, keyBin, encryptionKeyIndex, participantId); this.emit(MatrixRTCSessionEvent.EncryptionKeyChanged, keyBin, encryptionKeyIndex, participantId);
}, },
this.logger, this.logger,

View File

@ -9,7 +9,8 @@
"noEmit": true, "noEmit": true,
"declaration": true, "declaration": true,
"strict": true, "strict": true,
"allowImportingTsExtensions": true "allowImportingTsExtensions": true,
"lib": ["es2024"]
}, },
"include": ["./src/**/*.ts", "./spec/**/*.ts"] "include": ["./src/**/*.ts", "./spec/**/*.ts"]
} }