Skip to content

textmode.export.js / TextmodeExportAPI / toJSONString

Method: toJSONString() ​

ts
toJSONString(options?): string;

Produces the full layer stack as a v4 JSON document string by default.

Parameters ​

ParameterTypeDescription
options?JSONExportOptionsExport options.

Returns ​

string

Serialized JSON string for the selected layer or layer stack.

Examples ​

ts
const json = t.toJSONString({ target: 'selected', layer: t.layers.base, pretty: false, colorMode: 'hex' });
const stackJson = t.toJSONString(); // The full layer stack is the default.