Skip to content
2 min read · 479 words

Interface: EngineRegistry

Defined in: src/batteries/media/registry.ts:117

Ordered capability-filtered dispatch over the pipeline's engines.

Extends

Properties

PropertyModifierTypeDescriptionDefined in
enginesreadonlyreadonly MediaEngine[]The resolved engines, in supply order (inspection/debugging).src/batteries/media/registry.ts:119

Methods

convert()

ts
convert(request: ConvertRequest): Promise<ConvertResult>;

Defined in: src/batteries/media/registry.ts:135

Convert via the shortest capable path (direct edge = one hop). The selection rule picks the engine for each executed hop; options are forwarded to every hop (engines ignore keys they don't understand).

Parameters

ParameterTypeDescription
requestConvertRequestThe input bytes, target token, and options.

Returns

Promise<ConvertResult>

The final hop's outputs.


convertTargets()

ts
convertTargets(fromMime: string): readonly string[];

Defined in: src/batteries/media/registry.ts:126

Every format token reachable from fromMime — directly or through a computed path of up to three hops. Drives "supported targets" error messages.

Parameters

ParameterTypeDescription
fromMimestringThe input MIME type.

Returns

readonly string[]


edit()

ts
edit(request: EditRequest): Promise<EditResult>;

Defined in: src/batteries/media/registry.ts:153

Apply one structural document operation. Candidates are engines whose over matches the input and whose ops include the requested op; the selection rule arbitrates between engines of differing fidelity (supply order wins by default).

Parameters

ParameterTypeDescription
requestEditRequestThe op, its args, and the input bytes.

Returns

Promise<EditResult>

The restructured bytes plus optional change counts.


hasConvert()

ts
hasConvert(from?: string, to?: string): boolean;

Defined in: src/batteries/media/validate.ts:34

true when some engine declares a matching convert edge (omit either side for "any").

Parameters

ParameterType
from?string
to?string

Returns

boolean

Inherited from

CapabilityProbe.hasConvert


hasEdit()?

ts
optional hasEdit(mime?: string, op?: string): boolean;

Defined in: src/batteries/media/validate.ts:41

true when some engine declares a matching edit capability (omit both for "any"). Optional so existing probe stubs stay valid; absent means "no edit engines".

Parameters

ParameterType
mime?string
op?string

Returns

boolean

Inherited from

CapabilityProbe.hasEdit


hasMutate()

ts
hasMutate(): boolean;

Defined in: src/batteries/media/validate.ts:36

true when some engine declares a mutate capability.

Returns

boolean

Inherited from

CapabilityProbe.hasMutate


mutate()

ts
mutate(request: MutateRequest): Promise<EngineBytesResult>;

Defined in: src/batteries/media/registry.ts:144

Apply a fused same-format transform. Candidates are engines whose over matches the input, whose ops cover the requested operations, and — when a re-encode is requested — whose encodes include the target.

Parameters

ParameterTypeDescription
requestMutateRequestThe fused operations and input bytes.

Returns

Promise<EngineBytesResult>

The transformed bytes.