AssetVariant
type AssetVariant = { bytes: number; createdAt?: string; height?: number; preset: VariantEntryPreset; rungs?: HlsRung[]; sourceFrom?: | VariantPreset | "upload" | "transform-route" | "hls-transcode" | "cdn-probe"; url: string; width?: number;};Defined in: packages/asset-client/dist/index.d.ts:870
Properties
Section titled “Properties”bytes: number;Defined in: packages/asset-client/dist/index.d.ts:884
Byte size of the stored variant file.
createdAt?
Section titled “createdAt?”optional createdAt?: string;Defined in: packages/asset-client/dist/index.d.ts:899
ISO timestamp this variant was written. Absent on pre-trace variants.
height?
Section titled “height?”optional height?: number;Defined in: packages/asset-client/dist/index.d.ts:882
Pixel height. Same caveat as width.
preset
Section titled “preset”preset: VariantEntryPreset;Defined in: packages/asset-client/dist/index.d.ts:876
What this entry IS. Usually a named preset; can also be a
transform-<hash> cache artifact — see VariantEntryPreset before
passing it to getAssetUrl.
rungs?
Section titled “rungs?”optional rungs?: HlsRung[];Defined in: packages/asset-client/dist/index.d.ts:916
preset: "hls" only — the ladder’s rungs, in MASTER ORDER.
The reason this exists: an entry that only says there is a ladder leaves a consumer that plans a composition exactly as blind as no entry at all, because the ceiling of a composition is its weakest ingredient and there is no upscale. Before this field the only way to learn a clip’s real rungs was to fetch the master playlist — or worse, download the asset.
rungs[0] is the rung every client OPENS on (RFC 8216 §6.3.4 for native
HLS; hls.js with startLevel unset uses “the first level in the
manifest”), so the order is a delivery fact — do not sort it in place.
Use hlsLadderAlignment rather than eyeballing segments: a ladder
can be complete and still unable to adapt.
sourceFrom?
Section titled “sourceFrom?”optional sourceFrom?: | VariantPreset | "upload" | "transform-route" | "hls-transcode" | "cdn-probe";Defined in: packages/asset-client/dist/index.d.ts:897
Where the bytes for this variant came from. Useful for quality
traceability — a thumb with sourceFrom: "original" is the
canonical case, while sourceFrom: "lg" means it was derived
from an already-encoded WebP (slight quality compounding).
"upload"→ first-write at/assets/process. The bytes came straight from the client’s PUT.VariantPreset→ regenerated from that preset’s variant.
Absent on variants written before the trace field existed.
url: string;Defined in: packages/asset-client/dist/index.d.ts:878
Public CDN URL of this variant.
width?
Section titled “width?”optional width?: number;Defined in: packages/asset-client/dist/index.d.ts:880
Pixel width. Absent for original-only assets where image processing was skipped, or for video presets.