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(); }