From c06478c581a498449e0fc0f37f2b5c850101e09b Mon Sep 17 00:00:00 2001 From: lukasIO Date: Wed, 1 Oct 2025 09:34:33 +0200 Subject: [PATCH 1/3] Fix TS 5.9 generic Uint8Array declaration when inferred --- package.json | 2 +- src/e2ee/worker/sifPayload.ts | 16 ++++++++++------ src/room/track/LocalTrack.ts | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 75c3f6aa62..99967f3f8e 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "format": "prettier --write src examples/**/*.ts", "format:check": "prettier --check src examples/**/*.ts", "ci:publish": "pnpm build:clean && pnpm compat && changeset publish", - "downlevel-dts": "downlevel-dts ./dist/ ./dist/ts4.2 --to=4.2", + "downlevel-dts": "downlevel-dts ./dist/src ./dist/ts4.2 --to=4.2", "compat": "eslint --no-eslintrc --config ./.eslintrc.dist.cjs ./dist/livekit-client.umd.js", "size-limit": "size-limit" }, diff --git a/src/e2ee/worker/sifPayload.ts b/src/e2ee/worker/sifPayload.ts index f86e9ca06d..09f0baf41f 100644 --- a/src/e2ee/worker/sifPayload.ts +++ b/src/e2ee/worker/sifPayload.ts @@ -2,25 +2,29 @@ import type { VideoCodec } from '../..'; // Payload definitions taken from https://github.com/livekit/livekit/blob/master/pkg/sfu/downtrack.go#L104 -export const VP8KeyFrame8x8 = new Uint8Array([ +export const VP8KeyFrame8x8: Uint8Array = new Uint8Array([ 0x10, 0x02, 0x00, 0x9d, 0x01, 0x2a, 0x08, 0x00, 0x08, 0x00, 0x00, 0x47, 0x08, 0x85, 0x85, 0x88, 0x85, 0x84, 0x88, 0x02, 0x02, 0x00, 0x0c, 0x0d, 0x60, 0x00, 0xfe, 0xff, 0xab, 0x50, 0x80, ]); -export const H264KeyFrame2x2SPS = new Uint8Array([ +export const H264KeyFrame2x2SPS: Uint8Array = new Uint8Array([ 0x67, 0x42, 0xc0, 0x1f, 0x0f, 0xd9, 0x1f, 0x88, 0x88, 0x84, 0x00, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0xc8, 0x3c, 0x60, 0xc9, 0x20, ]); -export const H264KeyFrame2x2PPS = new Uint8Array([0x68, 0x87, 0xcb, 0x83, 0xcb, 0x20]); +export const H264KeyFrame2x2PPS: Uint8Array = new Uint8Array([0x68, 0x87, 0xcb, 0x83, 0xcb, 0x20]); -export const H264KeyFrame2x2IDR = new Uint8Array([ +export const H264KeyFrame2x2IDR: Uint8Array = new Uint8Array([ 0x65, 0x88, 0x84, 0x0a, 0xf2, 0x62, 0x80, 0x00, 0xa7, 0xbe, ]); -export const H264KeyFrame2x2 = [H264KeyFrame2x2SPS, H264KeyFrame2x2PPS, H264KeyFrame2x2IDR]; +export const H264KeyFrame2x2: Uint8Array[] = [ + H264KeyFrame2x2SPS, + H264KeyFrame2x2PPS, + H264KeyFrame2x2IDR, +]; -export const OpusSilenceFrame = new Uint8Array([ +export const OpusSilenceFrame: Uint8Array = new Uint8Array([ 0xf8, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/src/room/track/LocalTrack.ts b/src/room/track/LocalTrack.ts index c6171a6c2a..5e632f36a0 100644 --- a/src/room/track/LocalTrack.ts +++ b/src/room/track/LocalTrack.ts @@ -670,7 +670,7 @@ export default abstract class LocalTrack< } /** @internal */ - getPreConnectBuffer() { + getPreConnectBuffer(): ReadableStream | undefined { return this.localTrackRecorder?.byteStream; } From 635fef06e95e97ab8b06b00e30997b44d7cdbbd2 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Wed, 1 Oct 2025 09:42:02 +0200 Subject: [PATCH 2/3] Create fifty-shoes-act.md --- .changeset/fifty-shoes-act.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fifty-shoes-act.md diff --git a/.changeset/fifty-shoes-act.md b/.changeset/fifty-shoes-act.md new file mode 100644 index 0000000000..47950fe5e1 --- /dev/null +++ b/.changeset/fifty-shoes-act.md @@ -0,0 +1,5 @@ +--- +"livekit-client": patch +--- + +Fix TS 5.9 generic Uint8Array declaration when inferred From cf147f97c922d769ff20c5663a9a68225e3cbbb4 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Wed, 1 Oct 2025 09:51:35 +0200 Subject: [PATCH 3/3] fix ts versions output path --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 99967f3f8e..4676e608ed 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,10 @@ "typesVersions": { "<4.8": { "./dist/src/index.d.ts": [ - "./dist/ts4.2/src/index.d.ts" + "./dist/ts4.2/index.d.ts" ], "./dist/src/e2ee/worker/e2ee.worker.d.ts": [ - "./dist/ts4.2/dist/src/e2ee/worker/e2ee.worker.d.ts" + "./dist/ts4.2/e2ee/worker/e2ee.worker.d.ts" ] } },