Skip to content

stages

ts
const stages: object;

Defined in: server/transform/index.ts:10 ↗

Individual document transformation stages.

Type declaration

build

ts
build: object;

build.asset()

ts
asset: (asset, merges?) => Promise<void> = build;

Default HTML builder for supported asset types (images and video).

Parameters
asset

BuiltAsset

merges?

BuiltAsset[]

Returns

Promise<void>

build.CONTAINER_ATTR

ts
CONTAINER_ATTR: string;

build.size()

ts
size: (asset) => object = resolveSize;

Resolves dimensions of the specified asset accounting build preferences and aspect ratio.

Parameters
asset

BuiltAsset

Returns

object

height
ts
height: number;
width
ts
width: number;

build.source()

ts
source: (path) => string = resolveSource;

Resolves serve url for content file with specified full path based on configured root option.

Parameters
path

string

Returns

string

capture

ts
capture: object;

capture.assets()

ts
assets: (content, assets) => void = capture;

Uses regexp defined in options to capture the assets syntax.

Parameters
content

string

assets

CapturedAsset[]

Returns

void

encode

ts
encode: object;

encode.asset()

ts
asset: (asset) => Promise<void> = encode;

Encodes asset content with ffmpeg.

Parameters
asset

EncodedAsset

Returns

Promise<void>

fetch

ts
fetch: object;

fetch.asset()

ts
asset: (asset) => Promise<void> = fetch;

Fetches asset's source content.

Parameters
asset

FetchedAsset

Returns

Promise<void>

probe

ts
probe: object;

probe.asset()

ts
asset: (asset) => Promise<void> = probe;

Probes asset content with ffprobe.

Parameters
asset

ProbedAsset

Returns

Promise<void>

resolve

ts
resolve: object;

resolve.asset()

ts
asset: (asset) => void = resolve;

Resolves asset types supported by default.

Parameters
asset

ResolvedAsset

Returns

void

resolve.spec()

ts
spec: (query) => AssetSpec = resolveSpec;

Resolves spec formatted as URL query parameters.

Parameters
query

string

Returns

AssetSpec

rewrite

ts
rewrite: object;

rewrite.content()

ts
content: (content, assets) => string = rewrite;

Default rewrite procedure.

Parameters
content

string

assets

BuiltAsset[]

Returns

string