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