Object API Reference
kittl.design.object — generic object utilities.
Scope: design:state:read (read methods) · design:state:write (mutations)
getObject(params)
Retrieves a design object by ID.
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the object to retrieve |
Returns: SdkResultAsync<NormalizedObject>
setLockedState(params)
Locks or unlocks an object.
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Object ID |
locked | boolean | Yes | true to lock, false to unlock |
setHiddenState(params)
Shows or hides an object.
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Object ID |
hidden | boolean | Yes | true to hide, false to show |
rotateObject(params)
Rotates an object by a relative angle.
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Object ID |
angle | number | Yes | Degrees to rotate (positive = clockwise) |
origin | { x: OriginX, y: OriginY } | No | Rotation origin (default: { x: 'center', y: 'center' }) |
removeObject(params)
Removes an object from the design.
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the object to remove |
getAllByFilter(predicate)
Returns all objects matching a predicate function.
| Parameter | Type | Description |
|---|---|---|
predicate | (object: NormalizedObject) => boolean | Filter function |
Returns: SdkResultAsync<NormalizedObject[]>
rename(params)
Renames an object.
| Property | Type | Required | Description |
|---|---|---|---|
objectId | string | Yes | Object ID |
newName | string | Yes | New name |
_dangerouslyUpdate(updateParams)
Applies a low-level patch to a serialized object. Pass the required id and any fields from Partial<Omit<SerializedObject, 'id'>>. The SDK result contains { id: string }. Prefer the specific shape, text, image, or other object APIs when they cover the change.
See the published ObjectAPI declaration for this method's exact patch type.
getColors(params)
Reads an object's color entries. Added in SDK 0.0.9.
| Property | Type | Required | Description |
|---|---|---|---|
objectId | string | Yes | Object ID |
The SDK result contains SDKColorEntry[]. Each entry has a key and a color value, which can be null.
setColors(params)
Sets color entries on an object. Added in SDK 0.0.9.
| Property | Type | Required | Description |
|---|---|---|---|
objectId | string | Yes | Object ID |
colorEntries | SDKColorEntry[] | Yes | Color entries to set |
The call returns an SDK result with no payload. See SDKColorEntry and SDKColor for solid colors and gradients.