Skip to content
Type

OutputOptions

The options for creating an Output object.

ts
type OutputOptions<F extends OutputFormat = OutputFormat, T extends Target = Target> = {
	format: F;
	target: T | PathedTarget<T>;
	initTarget?: T | (() => MaybePromise<T>);
	onFinalize?: () => MaybePromise<unknown>;
};

See PathedTarget, MaybePromise, OutputFormat, and Target.

Used by

Properties

format

ts
format: F;

The format of the output file.

target

ts
target: T | PathedTarget<T>;

The target to which the file will be written.

See PathedTarget.

initTarget

ts
initTarget?: T | (() => MaybePromise<T>);

Optional; the target to which the track initialization data will be written. Most formats do not make use of this, but some do, such as CmafOutputFormat.

When this is a function, it will only be called if an init target is needed.

See MaybePromise.

Events

onFinalize

ts
onFinalize?: (() => unknown);

Optional; a callback to be called at the end of Output.finalize. Can be used to run logic once the output has completed. If a promise is returned, it will be awaited internally by Output.finalize.

Released under the Mozilla Public License 2.0.