Design kit command
inspect.componentCode
Component code
Answers a component's code in a language with its properties as parameters.
- Kit
- Design 0.1.0 (.kdesign)
- Changes the document
- no
- Acts on
id(one id), which a run step’sonfills
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | string | no | an id; component, set or instance; default the selection |
language | "react" | "leptos" | "vue" | "swiftui" | "compose" | "arkui" | no | default react |
Call through design_run
text
design_run {
"path": "<file>.kdesign",
"steps": [{ "command": "inspect.componentCode" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: id, language. design_run answers the step’s result in completed[i].result.
Result
| Name | Type | Required | Description |
|---|---|---|---|
component | any | no | |
connected | object | no | |
definition | any | no | |
name | any | no | |
properties | any[] | no | |
set | any | no | |
usage | any | no |
Result JSON Schema
json
{
"additionalProperties": true,
"properties": {
"component": {},
"connected": {
"additionalProperties": true,
"type": "object"
},
"definition": {},
"name": {},
"properties": {
"type": "array"
},
"set": {},
"usage": {}
},
"type": "object"
}Parameter schema
json
{
"additionalProperties": false,
"properties": {
"id": {
"description": "an id; component, set or instance; default the selection",
"oneOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"x-khp-types": [
"Node"
]
},
"language": {
"description": "default react",
"enum": [
"react",
"leptos",
"vue",
"swiftui",
"compose",
"arkui"
],
"type": "string"
}
},
"returns": "{component, name, set, properties: [{name, param, type, default, value? (instances)}], definition, usage? (instances; the connected snippet when the component is connected to code), connected: {importPath, name, template, import, code} | null}",
"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.