From 8288bf7a671499a4a0c831a9073b9c3ab60a6e66 Mon Sep 17 00:00:00 2001 From: Yonatan Bendahan Date: Tue, 15 Apr 2025 15:13:34 +0300 Subject: [PATCH] add docs --- src/source.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/source.ts b/src/source.ts index aa6365f..0a457f2 100644 --- a/src/source.ts +++ b/src/source.ts @@ -13,6 +13,10 @@ export abstract class Source { /** @internal */ _sizePromise: Promise | null = null; + /** + * Returns promise that resolves with the size of the file. + * If the size is not known, it will be retrieved from the source. + */ getSize() { return this._sizePromise ??= this._retrieveSize(); }