diff --git a/src/input.ts b/src/input.ts index e41631e..8a12fc2 100644 --- a/src/input.ts +++ b/src/input.ts @@ -8,20 +8,20 @@ import { Source } from './source'; * The options for creating an Input object. * @public */ -export type InputOptions = { +export type InputOptions = { /** A list of supported formats. If the source file is not of one of these formats, then it cannot be read. */ formats: InputFormat[]; /** The source from which data will be read. */ - source: Source; + source: S; }; /** * Represents an input media file. This is the root object from which all media read operations start. * @public */ -export class Input { +export class Input { /** @internal */ - _source: Source; + _source: S; /** @internal */ _formats: InputFormat[]; /** @internal */ @@ -31,7 +31,7 @@ export class Input { /** @internal */ _format: InputFormat | null = null; - constructor(options: InputOptions) { + constructor(options: InputOptions) { if (!options || typeof options !== 'object') { throw new TypeError('options must be an object.'); } @@ -65,7 +65,7 @@ export class Input { } /** - * Returns the source from which this input file reads its data. This is the same source that was passed to there + * Returns the source from which this input file reads its data. This is the same source that was passed to the * constructor. */ get source() { diff --git a/src/source.ts b/src/source.ts index 0a457f2..637344b 100644 --- a/src/source.ts +++ b/src/source.ts @@ -14,8 +14,8 @@ export abstract class Source { _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. + * Resolves with the total size of the file in bytes. This function is memoized, meaning only the first call + * will retrieve the size. */ getSize() { return this._sizePromise ??= this._retrieveSize();