Skip to content

Interface: SessionOptions ​

Defined in: packages/core/src/session.ts:30

Properties ​

assets? ​

optional assets?: AssetResolver

Defined in: packages/core/src/session.ts:53

Fonts and images referenced by the log. Defaults to the plugins' declarations with relative urls.


limits? ​

optional limits?: object

Defined in: packages/core/src/session.ts:44

How much of the original stays in the browser. Default 16 megapixels and 50e6 bytes, enough for a camera JPEG of 60 megapixels. An image above maxClientMegapixels is not resident: the preview works on a working copy, and export fails with NOT_RESIDENT: the host renders the original elsewhere. An image above maxClientBytes does not load at all (TOO_LARGE). The megapixel limit reaches the renderer with every load, so a shared worker follows the session that loads into it.

maxClientBytes? ​

optional maxClientBytes?: number

maxClientMegapixels? ​

optional maxClientMegapixels?: number


plugins ​

plugins: readonly AnyPlugin[]

Defined in: packages/core/src/session.ts:31


preview? ​

optional preview?: object

Defined in: packages/core/src/session.ts:45

debounceMs? ​

optional debounceMs?: number

enabled? ​

optional enabled?: boolean


renderer? ​

optional renderer?: Renderer

Defined in: packages/core/src/session.ts:33

Defaults to an InlineRenderer built from plugins. Pass a WorkerRenderer in browsers.


saveFile? ​

optional saveFile?: (bytes, filename, mimeType) => void | Promise<void>

Defined in: packages/core/src/session.ts:58

How download hands bytes to the user. Defaults to an <a download> click in browsers; required elsewhere.

Parameters ​

bytes ​

Uint8Array

filename ​

string

mimeType ​

string

Returns ​

void | Promise<void>


workingCopy? ​

optional workingCopy?: object

Defined in: packages/core/src/session.ts:51

The preview image. The session always decodes the original in WebAssembly and downscales it itself. maxSide is the longest side for the default renderer. Default 2048. A renderer passed in uses its own setting.

maxSide? ​

optional maxSide?: number