Skip to content

Commit

Permalink
Update dependency typescript to v5.6.2 (#4420)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Sep 26, 2024
1 parent f7229bf commit d56fa19
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"typedoc-plugin-coverage": "^3.0.0",
"typedoc-plugin-mdn-links": "^3.0.3",
"typedoc-plugin-missing-exports": "^3.0.0",
"typescript": "^5.3.3"
"typescript": "^5.4.2"
},
"@casualbot/jest-sonar-reporter": {
"outputDirectory": "coverage",
Expand Down
20 changes: 15 additions & 5 deletions spec/test-utils/beacon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ export const makeGeolocationPosition = ({
}: {
timestamp?: number;
coords: Partial<GeolocationCoordinates>;
}): GeolocationPosition => ({
timestamp: timestamp ?? 1647256791840,
coords: {
}): GeolocationPosition => {
const { toJSON, ...coordsJSON } = {
accuracy: 1,
latitude: 54.001927,
longitude: -8.253491,
Expand All @@ -112,5 +111,16 @@ export const makeGeolocationPosition = ({
heading: null,
speed: null,
...coords,
},
});
};
const posJSON = {
timestamp: timestamp ?? 1647256791840,
coords: {
toJSON: () => coordsJSON,
...coordsJSON,
},
};
return {
toJSON: () => posJSON,
...posJSON,
};
};
11 changes: 7 additions & 4 deletions spec/test-utils/webrtc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,13 @@ export class MockRTCPeerConnection {
}

constructor() {
this.localDescription = {
const localDescriptionJSON = {
sdp: DUMMY_SDP,
type: "offer",
toJSON: function () {},
type: "offer" as RTCSdpType,
};
this.localDescription = {
toJSON: () => localDescriptionJSON,
...localDescriptionJSON,
};

this.readyToNegotiate = new Promise<void>((resolve) => {
Expand Down Expand Up @@ -265,7 +268,7 @@ export class MockRTCRtpTransceiver {
this.peerConn.needsNegotiation = true;
}

public setCodecPreferences = jest.fn<void, RTCRtpCodecCapability[]>();
public setCodecPreferences = jest.fn<void, RTCRtpCodec[]>();
}

export class MockMediaStreamTrack {
Expand Down
6 changes: 3 additions & 3 deletions src/webrtc/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,7 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap

this.sendVoipEvent(EventType.CallNegotiate, {
lifetime: CALL_TIMEOUT_MS,
description: this.peerConn!.localDescription?.toJSON(),
description: this.peerConn!.localDescription?.toJSON() as RTCSessionDescription,
[SDPStreamMetadataKey]: this.getLocalSDPStreamMetadata(true),
});
}
Expand Down Expand Up @@ -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
if (this.state === CallState.CreateOffer) {
content.offer = this.peerConn!.localDescription?.toJSON();
content.offer = this.peerConn!.localDescription?.toJSON() as RTCSessionDescription;
} else {
content.description = this.peerConn!.localDescription?.toJSON();
content.description = this.peerConn!.localDescription?.toJSON() as RTCSessionDescription;
}

content.capabilities = {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6378,10 +6378,10 @@ typedoc@^0.26.0:
shiki "^1.16.2"
yaml "^2.5.1"

typescript@^5.3.3:
version "5.5.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba"
integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==
typescript@^5.4.2:
version "5.6.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.2.tgz#d1de67b6bef77c41823f822df8f0b3bcff60a5a0"
integrity sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==

uc.micro@^2.0.0, uc.micro@^2.1.0:
version "2.1.0"
Expand Down

0 comments on commit d56fa19

Please sign in to comment.