Skip to content

TypeScript API / laikacms/assets / variationScore

Function: variationScore() ​

ts
function variationScore(variation, options): object;

Parameters ​

ParameterTypeDescription
variation{ height?: number; mimeType?: string; size?: number; url: string; variant: string; width?: number; }-
variation.height?numberHeight in pixels (if applicable).
variation.mimeType?stringMIME type of the variation (may differ from original). Example: Original is PNG, variation is WebP.
variation.size?numberSize in bytes (if known).
variation.urlstringURL to access this variation. May be a signed URL with expiration. May support the following template variables: - {width}: Width in pixels - {height}: Height in pixels The presence of these variables indicates the variation can be dynamically transformed.
variation.variantstringUnique identifier for this variation. Examples: 'thumbnail', 'small', 'medium', 'large', '100x100', 'webp'
variation.width?numberWidth in pixels (if applicable).
optionsBuildUrlOptions-

Returns ​

object

major ​

ts
major: number;

pixelOversize ​

ts
pixelOversize: number;

pixelUndersize ​

ts
pixelUndersize: number;

Released under the MIT License.