Board kit command
stroke.add
Draw a stroke
Draws a freehand stroke through at least two points, with optional ink colour, weight and opacity.
- Kit
- Board 0.1.0 (.kboard)
- Changes the document
- yes
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
page | string | no | The page's id; the shown page when absent |
points | number[][] | yes | The stroke's points, at least two |
style | object | no |
Call through board_run
text
board_run {
"path": "<file>.kboard",
"steps": [{ "command": "stroke.add", "params": { "points": <number[][]> } }]
}The required parameters, with placeholders for their types: not a tested example. Optional: page, style. board_run answers the step’s result in completed[i].result.
Result
The kit gives no result schema for this command.
Parameter schema
json
{
"additionalProperties": false,
"properties": {
"page": {
"description": "The page's id; the shown page when absent",
"type": "string",
"x-khp-types": [
"Page"
]
},
"points": {
"description": "The stroke's points, at least two",
"items": {
"items": {
"description": "Coordinate",
"maximum": 1000000,
"minimum": -1000000,
"type": "number"
},
"type": "array"
},
"type": "array"
},
"style": {
"additionalProperties": false,
"properties": {
"dashStyle": {
"description": "Solid (default), dashed or dotted",
"enum": [
"solid",
"dashed",
"dotted"
],
"type": "string"
},
"opacity": {
"description": "0 to 1",
"maximum": 1,
"minimum": 0,
"type": "number"
},
"strokeColor": {
"description": "Ink colour: one of ink, gray, purple, green, orange, red, yellow, blue, white or #rrggbb",
"type": "string"
},
"strokeSize": {
"description": "Line weight",
"enum": [
"s",
"m",
"l",
"xl"
],
"type": "string"
}
},
"type": "object"
}
},
"required": [
"points"
],
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (board_commands through @kition/[email protected], built from KitionAI/kition-board@e78c190). As data: commands.jsonl.