textmode.export.js / TextmodeExportAPI / toJSON
Method: toJSON()
ts
toJSON(options?): TextmodeDocumentJSON;Produces the selected layer or layer stack as structured JSON data.
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | JSONExportOptions | Export options. |
Returns
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' });