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

Update dependency typescript to v5.6.2 (#4420)

* Update dependency typescript to v5.6.2

* Fix TS errors

* Update minimal version of TS to `5.4.2` since the code is not compliant with an older version.

* Review fixes

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
Co-authored-by: Florian Duros <florianduros@element.io>
This commit is contained in:
renovate[bot]
2024-09-26 08:23:38 +00:00
committed by GitHub
parent f7229bfff0
commit d56fa197d0
5 changed files with 30 additions and 17 deletions

View File

@ -122,7 +122,7 @@
"typedoc-plugin-coverage": "^3.0.0", "typedoc-plugin-coverage": "^3.0.0",
"typedoc-plugin-mdn-links": "^3.0.3", "typedoc-plugin-mdn-links": "^3.0.3",
"typedoc-plugin-missing-exports": "^3.0.0", "typedoc-plugin-missing-exports": "^3.0.0",
"typescript": "^5.3.3" "typescript": "^5.4.2"
}, },
"@casualbot/jest-sonar-reporter": { "@casualbot/jest-sonar-reporter": {
"outputDirectory": "coverage", "outputDirectory": "coverage",

View File

@ -101,9 +101,8 @@ export const makeGeolocationPosition = ({
}: { }: {
timestamp?: number; timestamp?: number;
coords: Partial<GeolocationCoordinates>; coords: Partial<GeolocationCoordinates>;
}): GeolocationPosition => ({ }): GeolocationPosition => {
timestamp: timestamp ?? 1647256791840, const { toJSON, ...coordsJSON } = {
coords: {
accuracy: 1, accuracy: 1,
latitude: 54.001927, latitude: 54.001927,
longitude: -8.253491, longitude: -8.253491,
@ -112,5 +111,16 @@ export const makeGeolocationPosition = ({
heading: null, heading: null,
speed: null, speed: null,
...coords, ...coords,
}, };
}); const posJSON = {
timestamp: timestamp ?? 1647256791840,
coords: {
toJSON: () => coordsJSON,
...coordsJSON,
},
};
return {
toJSON: () => posJSON,
...posJSON,
};
};

View File

@ -147,10 +147,13 @@ export class MockRTCPeerConnection {
} }
constructor() { constructor() {
this.localDescription = { const localDescriptionJSON = {
sdp: DUMMY_SDP, sdp: DUMMY_SDP,
type: "offer", type: "offer" as RTCSdpType,
toJSON: function () {}, };
this.localDescription = {
toJSON: () => localDescriptionJSON,
...localDescriptionJSON,
}; };
this.readyToNegotiate = new Promise<void>((resolve) => { this.readyToNegotiate = new Promise<void>((resolve) => {
@ -265,7 +268,7 @@ export class MockRTCRtpTransceiver {
this.peerConn.needsNegotiation = true; this.peerConn.needsNegotiation = true;
} }
public setCodecPreferences = jest.fn<void, RTCRtpCodecCapability[]>(); public setCodecPreferences = jest.fn<void, RTCRtpCodec[]>();
} }
export class MockMediaStreamTrack { export class MockMediaStreamTrack {

View File

@ -2024,7 +2024,7 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
this.sendVoipEvent(EventType.CallNegotiate, { this.sendVoipEvent(EventType.CallNegotiate, {
lifetime: CALL_TIMEOUT_MS, lifetime: CALL_TIMEOUT_MS,
description: this.peerConn!.localDescription?.toJSON(), description: this.peerConn!.localDescription?.toJSON() as RTCSessionDescription,
[SDPStreamMetadataKey]: this.getLocalSDPStreamMetadata(true), [SDPStreamMetadataKey]: this.getLocalSDPStreamMetadata(true),
}); });
} }
@ -2152,9 +2152,9 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
// clunky because TypeScript can't follow the types through if we use an expression as the key // clunky because TypeScript can't follow the types through if we use an expression as the key
if (this.state === CallState.CreateOffer) { if (this.state === CallState.CreateOffer) {
content.offer = this.peerConn!.localDescription?.toJSON(); content.offer = this.peerConn!.localDescription?.toJSON() as RTCSessionDescription;
} else { } else {
content.description = this.peerConn!.localDescription?.toJSON(); content.description = this.peerConn!.localDescription?.toJSON() as RTCSessionDescription;
} }
content.capabilities = { content.capabilities = {

View File

@ -6378,10 +6378,10 @@ typedoc@^0.26.0:
shiki "^1.16.2" shiki "^1.16.2"
yaml "^2.5.1" yaml "^2.5.1"
typescript@^5.3.3: typescript@^5.4.2:
version "5.5.4" version "5.6.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.2.tgz#d1de67b6bef77c41823f822df8f0b3bcff60a5a0"
integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== integrity sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==
uc.micro@^2.0.0, uc.micro@^2.1.0: uc.micro@^2.0.0, uc.micro@^2.1.0:
version "2.1.0" version "2.1.0"