Skip to content

textmode.export.js / TextmodeExportAPI / toJSONString

Method: toJSONString()

ts
toJSONString(options?): string;

Produces the selected layer or layer stack as a JSON string.

Parameters

ParameterTypeDescription
options?JSONExportOptionsExport options.

Returns

string

Serialized JSON string for the selected layer or layer stack.

Example

ts
const json = t.toJSONString({ layer: t.layers.base, pretty: false, colorMode: 'hex' });
const stackJson = t.toJSONString({ target: 'all' });