Skip to content

Commit 84b1a6f

Browse files
authored
Fix TS 5.7 generic Uint8Array declaration when inferred (#1668)
1 parent 23b32ec commit 84b1a6f

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

.changeset/fifty-shoes-act.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"livekit-client": patch
3+
---
4+
5+
Fix TS 5.9 generic Uint8Array declaration when inferred

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
"typesVersions": {
2626
"<4.8": {
2727
"./dist/src/index.d.ts": [
28-
"./dist/ts4.2/src/index.d.ts"
28+
"./dist/ts4.2/index.d.ts"
2929
],
3030
"./dist/src/e2ee/worker/e2ee.worker.d.ts": [
31-
"./dist/ts4.2/dist/src/e2ee/worker/e2ee.worker.d.ts"
31+
"./dist/ts4.2/e2ee/worker/e2ee.worker.d.ts"
3232
]
3333
}
3434
},
@@ -50,7 +50,7 @@
5050
"format": "prettier --write src examples/**/*.ts",
5151
"format:check": "prettier --check src examples/**/*.ts",
5252
"ci:publish": "pnpm build:clean && pnpm compat && changeset publish",
53-
"downlevel-dts": "downlevel-dts ./dist/ ./dist/ts4.2 --to=4.2",
53+
"downlevel-dts": "downlevel-dts ./dist/src ./dist/ts4.2 --to=4.2",
5454
"compat": "eslint --no-eslintrc --config ./.eslintrc.dist.cjs ./dist/livekit-client.umd.js",
5555
"size-limit": "size-limit"
5656
},

src/e2ee/worker/sifPayload.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,29 @@ import type { VideoCodec } from '../..';
22

33
// Payload definitions taken from https://github.com/livekit/livekit/blob/master/pkg/sfu/downtrack.go#L104
44

5-
export const VP8KeyFrame8x8 = new Uint8Array([
5+
export const VP8KeyFrame8x8: Uint8Array = new Uint8Array([
66
0x10, 0x02, 0x00, 0x9d, 0x01, 0x2a, 0x08, 0x00, 0x08, 0x00, 0x00, 0x47, 0x08, 0x85, 0x85, 0x88,
77
0x85, 0x84, 0x88, 0x02, 0x02, 0x00, 0x0c, 0x0d, 0x60, 0x00, 0xfe, 0xff, 0xab, 0x50, 0x80,
88
]);
99

10-
export const H264KeyFrame2x2SPS = new Uint8Array([
10+
export const H264KeyFrame2x2SPS: Uint8Array = new Uint8Array([
1111
0x67, 0x42, 0xc0, 0x1f, 0x0f, 0xd9, 0x1f, 0x88, 0x88, 0x84, 0x00, 0x00, 0x03, 0x00, 0x04, 0x00,
1212
0x00, 0x03, 0x00, 0xc8, 0x3c, 0x60, 0xc9, 0x20,
1313
]);
1414

15-
export const H264KeyFrame2x2PPS = new Uint8Array([0x68, 0x87, 0xcb, 0x83, 0xcb, 0x20]);
15+
export const H264KeyFrame2x2PPS: Uint8Array = new Uint8Array([0x68, 0x87, 0xcb, 0x83, 0xcb, 0x20]);
1616

17-
export const H264KeyFrame2x2IDR = new Uint8Array([
17+
export const H264KeyFrame2x2IDR: Uint8Array = new Uint8Array([
1818
0x65, 0x88, 0x84, 0x0a, 0xf2, 0x62, 0x80, 0x00, 0xa7, 0xbe,
1919
]);
2020

21-
export const H264KeyFrame2x2 = [H264KeyFrame2x2SPS, H264KeyFrame2x2PPS, H264KeyFrame2x2IDR];
21+
export const H264KeyFrame2x2: Uint8Array[] = [
22+
H264KeyFrame2x2SPS,
23+
H264KeyFrame2x2PPS,
24+
H264KeyFrame2x2IDR,
25+
];
2226

23-
export const OpusSilenceFrame = new Uint8Array([
27+
export const OpusSilenceFrame: Uint8Array = new Uint8Array([
2428
0xf8, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2529
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2630
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

src/room/track/LocalTrack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ export default abstract class LocalTrack<
670670
}
671671

672672
/** @internal */
673-
getPreConnectBuffer() {
673+
getPreConnectBuffer(): ReadableStream<Uint8Array> | undefined {
674674
return this.localTrackRecorder?.byteStream;
675675
}
676676

0 commit comments

Comments
 (0)