stages
const stages: object;
Individual document transformation stages.
Type declaration
build
build: object;
build.asset()
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
CONTAINER_ATTR: string;
build.size()
size: (asset) => object = resolveSize;
Resolves dimensions of the specified asset accounting build preferences and aspect ratio.
Parameters
• asset: BuiltAsset
Returns
object
height
height: number;
width
width: number;
build.source()
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
capture: object;
capture.assets()
assets: (content, assets) => void = capture;
Uses regexp defined in options to capture the assets syntax.
Parameters
• content: string
• assets: CapturedAsset
[]
Returns
void
encode
encode: object;
encode.asset()
asset: (asset) => Promise<void> = encode;
Encodes asset content with ffmpeg.
Parameters
• asset: EncodedAsset
Returns
Promise
<void
>
fetch
fetch: object;
fetch.asset()
asset: (asset) => Promise<void> = fetch;
Fetches asset's source content.
Parameters
• asset: FetchedAsset
Returns
Promise
<void
>
probe
probe: object;
probe.asset()
asset: (asset) => Promise<void> = probe;
Probes asset content with ffprobe.
Parameters
• asset: ProbedAsset
Returns
Promise
<void
>
resolve
resolve: object;
resolve.asset()
asset: (asset) => void = resolve;
Resolves asset types supported by default.
Parameters
• asset: ResolvedAsset
Returns
void
resolve.spec()
spec: (query) => AssetSpec = resolveSpec;
Resolves spec formatted as URL query parameters.
Parameters
• query: string
Returns
rewrite
rewrite: object;
rewrite.content()
content: (content, assets) => string = rewrite;
Default rewrite procedure.
Parameters
• content: string
• assets: BuiltAsset
[]
Returns
string