Skip to content

EncodeOptions

ts
type EncodeOptions = object;

Defined in: server/config/options.ts:56 ↗

Configures assets encoding.

Properties

cover

ts
cover: 
  | {
  specs: EncodeSpecMap;
  suffix: string;
 }
  | null;

Defined in: server/config/options.ts:70 ↗

Configure cover generation. By default, a tiny blurred webp cover is generated from source content and embedded as base64-encoded data for image HTML, which is shown while the source content is lazy-loading; specify null to disable cover generation.

Type declaration

{ specs: EncodeSpecMap; suffix: string; }

specs

ts
specs: EncodeSpecMap;

Encode parameters mapped by source content MIME type; matched in order.

suffix

ts
suffix: string;

Tag to append to the names of generated cover files; @cover by default.

null


dense

ts
dense: 
  | {
  factor: number;
  specs: EncodeSpecMap;
  suffix: string;
 }
  | null;

Defined in: server/config/options.ts:92 ↗

Configure dense files generation, that is variants with x the resolution of the main content shown on high-dpi displays. Dense variants are generated when either global or per-asset spec "width" option is specified with value less than the source content width by x or more; x is configured via 'factor' parameter; assign null to disable dense generation.

Type declaration

{ factor: number; specs: EncodeSpecMap; suffix: string; }

factor

ts
factor: number;

When width of the source content is larger by the specified factor compared to the scaled-down main content (due to per-asset or global width threshold, if any), dense variant will be generated; 2 by default.

specs

ts
specs: EncodeSpecMap;

Encode parameters mapped by source content MIME type; matched in order.

suffix

ts
suffix: string;

Tag to append to the names of generated dense files; @dense by default.

null


main

ts
main: object;

Defined in: server/config/options.ts:61 ↗

Configure main encoded file generation, ie file to replace source content in the built HTML.

specs

ts
specs: EncodeSpecMap;

Encode parameters mapped by source content MIME type; matched in order.

suffix

ts
suffix: string;

Tag to append to the names of generated main files; @main by default.


root

ts
root: string;

Defined in: server/config/options.ts:59 ↗

Local directory to store encoded content and generated files, such as covers; ./public/imgit/encoded by default.


safe

ts
safe: 
  | {
  specs: EncodeSpecMap;
  suffix: string;
  types: (string | Readonly<RegExp>)[];
 }
  | null;

Defined in: server/config/options.ts:78 ↗

Configure safe files generation, that is fallbacks used in case source content is not considered compatible with legacy or any browsers, such as AVIF or PSD; specify null to disable.

Type declaration

{ specs: EncodeSpecMap; suffix: string; types: (string | Readonly<RegExp>)[]; }

specs

ts
specs: EncodeSpecMap;

Encode parameters mapped by source content MIME type; matched in order.

suffix

ts
suffix: string;

Tag to append to the names of generated safe files; @safe by default.

types

ts
types: (string | Readonly<RegExp>)[];

MIME content types considered safe or compatible with most browsers. When source asset content is not of the specified type, will create a fallback content with a compatible type; otherwise will use source content for fallback.

null