Skip to content

textmode.export.js / TextmodeExportAPI / toJSON

Method: toJSON()

ts
toJSON(options?): TextmodeDocumentJSON;

Produces the selected layer or layer stack as structured JSON data.

Parameters

ParameterTypeDescription
options?JSONExportOptionsExport options.

Returns

TextmodeDocumentJSON

The JSON document representing the selected layer or layer stack.

Example

ts
const layer = t.toJSON({ layer: t.layers.base, colorMode: 'hex', includeMetadata: true });
const stack = t.toJSON({ target: 'all' });