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

Parameters of page.inspect
NameTypeRequiredDescription
idinteger | stringnoA page's id (inspect's `pages[].id`): that page's layers; or a layer's id: that layer and the layers in it.
indexintegernoThe page to list, counted from 0 (its `index` in inspect's `pages`).

Call through design_run

text
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

Result of page.inspect
NameTypeRequiredDescription
idintegeryesThe page's id, or the layer's.
indexintegeryesThe page's index, counted from 0.
layersany[]yesThe page's top-level layers (a layer: itself), topmost first, each with its children.
namestringyes
pageintegeryesThe id of the page listed, or of the layer's page.
truncatedbooleanyesWhether more layers than the 500 listed are there.
Result JSON Schema
json
{
  "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

json
{
  "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.