From 99051e1848140a84945ba1e0a6d96fa15d986c52 Mon Sep 17 00:00:00 2001 From: Vanilagy <1696106+Vanilagy@users.noreply.github.com> Date: Fri, 29 Aug 2025 22:58:30 +0200 Subject: [PATCH] Fix remaining type/doc issues --- packages/mp3-encoder/src/index.ts | 2 +- src/index.ts | 1 + src/source.ts | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/mp3-encoder/src/index.ts b/packages/mp3-encoder/src/index.ts index 539175a..33e4a38 100644 --- a/packages/mp3-encoder/src/index.ts +++ b/packages/mp3-encoder/src/index.ts @@ -136,7 +136,7 @@ class Mp3Encoder extends CustomAudioEncoder { let pos = 0; while (pos <= this.currentBufferOffset - FRAME_HEADER_SIZE) { const word = new DataView(this.buffer.buffer).getUint32(pos, false); - const header = readFrameHeader(word, { pos, fileSize: null }); + const header = readFrameHeader(word, null).header; if (!header) { break; } diff --git a/src/index.ts b/src/index.ts index 9354d29..bd1613a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -97,6 +97,7 @@ export { StreamSource, StreamSourceOptions, BlobSource, + BlobSourceOptions, UrlSource, UrlSourceOptions, } from './source'; diff --git a/src/source.ts b/src/source.ts index 81caa88..86bab34 100644 --- a/src/source.ts +++ b/src/source.ts @@ -93,6 +93,10 @@ export class BufferSource extends Source { } } +/** + * Options for BlobSource. + * @public + */ export type BlobSourceOptions = { /** The maximum number of bytes the cache is allowed to hold in memory. Defaults to 8 MiB. */ maxCacheSize?: number; @@ -149,6 +153,7 @@ export class BlobSource extends Source { /** @internal */ _readers = new WeakMap>(); + /** @internal */ private async _runWorker(worker: ReadWorker) { let reader = this._readers.get(worker); if (!reader) { @@ -317,6 +322,7 @@ export class UrlSource extends Source { return this._orchestrator.read(start, end); } + /** @internal */ private async _runWorker(worker: ReadWorker) { const existing = this._existingResponses.get(worker); @@ -384,6 +390,7 @@ export class UrlSource extends Source { // logic for that has vanished for now. Leaving a comment here if this becomes relevant again. } + /** @internal */ private _getPartialLengthFromRangeResponse(response: Response) { const contentRange = response.headers.get('Content-Range'); if (contentRange) { @@ -509,6 +516,7 @@ export class StreamSource extends Source { return this._orchestrator.read(start, end); } + /** @internal */ private async _runWorker(worker: ReadWorker) { while (worker.currentPos < worker.targetPos && !worker.aborted) { const originalCurrentPos = worker.currentPos;