Design kit command
page.inspect
List page layers
Lists the layers of any page (by id or index), or one layer and the layers in it (by its id), without going to that page: each with its id, name, type, `index` (its place among its siblings, 0 the first child: the bottom unless its frame stacks the first on top) and `z` (its place in paint order, 0 at the bottom), topmost first as the Layers panel shows them.
- Kit
- Design 0.1.0 (.kdesign)
- Changes the document
- no
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | string | no | A page's id (inspect's `pages[].id`): that page's layers; or a layer's id: that layer and the layers in it. |
index | integer | no | The page to list, counted from 0 (its `index` in inspect's `pages`). |
Call through design_run
design_run {
"path": "<file>.kdesign",
"steps": [{ "command": "page.inspect" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: id, index. design_run answers the step’s result in completed[i].result.
Result
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The page's id, or the layer's. |
index | integer | yes | The page's index, counted from 0. |
layers | any[] | yes | The page's top-level layers (a layer: itself), topmost first, each with its children. |
name | string | yes | |
page | integer | yes | The id of the page listed, or of the layer's page. |
truncated | boolean | yes | Whether more layers than the 500 listed are there. |
Result JSON Schema
{
"additionalProperties": false,
"properties": {
"id": {
"description": "The page's id, or the layer's.",
"type": "integer"
},
"index": {
"description": "The page's index, counted from 0.",
"type": "integer"
},
"layers": {
"description": "The page's top-level layers (a layer: itself), topmost first, each with its children.",
"items": {},
"type": "array"
},
"name": {
"type": "string"
},
"page": {
"description": "The id of the page listed, or of the layer's page.",
"type": "integer"
},
"truncated": {
"description": "Whether more layers than the 500 listed are there.",
"type": "boolean"
}
},
"required": [
"id",
"index",
"layers",
"name",
"page",
"truncated"
],
"type": "object"
}Parameter schema
{
"additionalProperties": false,
"properties": {
"id": {
"description": "A page's id (inspect's `pages[].id`): that page's layers; or a layer's id: that layer and the layers in it.",
"oneOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"x-khp-types": [
"Node"
]
},
"index": {
"description": "The page to list, counted from 0 (its `index` in inspect's `pages`).",
"type": "integer"
}
},
"returns": "{id, index, name, page, layers: [{id, name, type, index, z, hidden?, children?, childCount?}], truncated}",
"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.