Design kit command
file.export
Export
Exports layers (default the selection, else the page) as PNG, JPEG, SVG, PDF, WebP, Android Vector Drawable or the whole .fig, at a scale with print options; answers the data.
- Kit
- Design 0.1.0 (.kdesign)
- Changes the document
- no
- Acts on
ids(a list of ids), which a run step’sonfills
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
bleed | number | string | no | |
bleedMarks | boolean | no | |
cmyk | boolean | no | |
cropMarks | boolean | no | |
format | "png" | "jpg" | "svg" | "pdf" | "webp" | "xml" | "fig" | no | |
ids | (integer | string)[] | no | default selection, else the page |
scale | number | no | |
size | number | no | 2x|512w|512h or {by: scale|width|height, value}: a scale, or a width or height in pixels; one of several alternative parameters |
svgIdAttribute | boolean | no | |
vdCompat | boolean | no |
Call through design_run
text
design_run {
"path": "<file>.kdesign",
"steps": [{ "command": "file.export" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: bleed, bleedMarks, cmyk, cropMarks, format, ids, scale, size, svgIdAttribute, vdCompat. design_run answers the step’s result in completed[i].result.
Result
| Name | Type | Required | Description |
|---|---|---|---|
data | string | no | |
format | string | no |
Result JSON Schema
json
{
"additionalProperties": true,
"properties": {
"data": {
"type": "string"
},
"format": {
"type": "string"
}
},
"type": "object"
}Parameter schema
json
{
"additionalProperties": false,
"properties": {
"bleed": {
"oneOf": [
{
"type": "number"
},
{
"type": "string"
}
]
},
"bleedMarks": {
"type": "boolean"
},
"cmyk": {
"type": "boolean"
},
"cropMarks": {
"type": "boolean"
},
"format": {
"enum": [
"png",
"jpg",
"svg",
"pdf",
"webp",
"xml",
"fig"
],
"type": "string"
},
"ids": {
"description": "default selection, else the page",
"items": {
"description": "an id",
"oneOf": [
{
"type": "integer"
},
{
"type": "string"
}
]
},
"type": "array",
"x-khp-types": [
"Node"
]
},
"scale": {
"type": "number"
},
"size": {
"description": "2x|512w|512h or {by: scale|width|height, value}: a scale, or a width or height in pixels; one of several alternative parameters",
"type": "number"
},
"svgIdAttribute": {
"type": "boolean"
},
"vdCompat": {
"type": "boolean"
}
},
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (design_commands through @kition/[email protected], built from KitionAI/kition-design@abc7e16). As data: commands.jsonl.