Skip to main content

api-reference

Home > @kittl/sdk

sdk package

The Kittl SDK used for interacting with projects within the Kittl UI

Abstract Classes

Abstract Class

Description

BatchClient

Abstract base class for batch operations that allows grouping multiple API calls together for atomic execution and better performance.

Enumerations

Enumeration

Description

BoardLayout

LibraryPresetType

ObjectType

Unit

Interfaces

Interface

Description

AIGeneratorTool

AppContext

Application context provided to extensions, giving them access to the project SDK and UI panel registration methods.

AppStateAPI

API for managing application state including selection, viewport, active tool, and canvas mode.

AppStateSDK

SDK interface for application state operations. Provides access to selection, viewport, active tool, and other UI state management.

AwarenessController

Controller interface for collaborating presence / awareness.

Extensions can: - subscribe to the state store to render live cursors / avatars - use the API to update their own (local) presence

BackgroundImageOptions

BoardAPI

API for creating and managing artboards (design canvases) in the design.

CanvasAPI

API for canvas-related operations. These functions may not have an implementation setup; they require a canvas implementation to register itself as the handler.

CanvasViewportSource

Interface for listening to viewport changes.

ConfigAPI

API for updating design configuration settings.

ContextMenuItem

Defines an item for the Context Menu (right-click menu).

ContextToolbarWidget

Defines a widget for the Context Toolbar that appears when objects are selected.

ContextualPanelBasedOnSelection

Interface for panel items that can be conditionally shown based on selected object types. Used for performance optimization by filtering which components need to check visibility.

CreateLoadingCardInput

Parameters for creating a new loading card placeholder.

DesignAPI

Main API interface for design manipulation operations. Provides access to all design-related APIs including artboards, objects, text, shapes, images, guides, and canvas operations.

DesignProjectSDK

Main SDK interface for design projects. Provides access to design, workspace, and app state APIs.

DesignSDK

SDK interface for design manipulation operations. Provides access to design state and APIs for managing artboards, objects, text, shapes, images, and other design elements.

Extension

Base interface for all SDK extensions. Extensions allow third-party developers to extend the Kittl editor functionality with custom panels, tools, and features.

ExtensionMetadata

Metadata describing an extension, including its unique identifier and manifest information.

ExtensionPanelManager

Manager for registering extension UI components in various panels of the Kittl editor.

FooterToolbarItem

Defines the shape of an item for the Actions Panel (bottom toolbar).

GetExportOptions

Options for exporting.

GetPreviewImageOptions

Options for generating preview images.

GradientObject

GuideAPI

API for creating and managing guides (alignment lines) in the design.

IllustrationAPI

API for adding and updating illustrations in the design.

ImageAPI

API for adding and updating images in the design.

LoadingCardAPI

API for creating and managing loading card placeholders in the design.

NavigationPanelItem

Defines the shape of an item for the Navigation Panel (left sidebar).

ObjectAPI

API for managing design objects, including locking and removal operations.

PanelItem

Base interface for panel items that can be registered in the Kittl editor UI.

PropertiesItem

Defines an item for the Properties Panel (right sidebar).

ReferenceFrameConfig

ReferenceFrameModeKeyFrame

ReferenceFrameModeReference

ReferenceImage

RemoveObjectParams

Parameters for removing an object from the design.

RemoveObjectResult

Return type for the removeObject operation.

RotateObjectParams

Parameters for rotating object.

SetHiddenParams

Parameters for object hiding operations.

SetLockedParams

Parameters for object locking operations.

ShapeAPI

Shape API for creating and managing basic geometric shapes in the design canvas.

This API provides functionality to create and update basic shapes including rectangles, circles (ellipses), stars, and triangles (polygons). All shapes support standard design properties like position, size, rotation, opacity, fill colors, and borders.

**Supported Shape Types:** - rectangle: Standard rectangular shapes with optional corner radius - ellipse: Circular and elliptical shapes - star: Multi-pointed star shapes - polygon: Triangle and other polygon shapes

**Key Features:** - Developer-friendly input mapping (simplified position/size vs internal coordinates) - Automatic scaling based on default shape dimensions - Support for absolute and relative positioning - Configurable visual properties (opacity, rotation, skew, shadows) - Border and fill customization

StateAPI

API for design state operations, including implementing sub-states into the main design.

StructureObjectMeta

TextAPI

API for creating and managing text elements in the design.

TextureOptions

UpdateGuideInput

Parameters for updating an existing guide. Both top and left are allowed because the orientation is not known at this point. An error will be thrown if the wrong coordinate is provided for the guide's orientation.

UpdateLoadingCardInput

Parameters for updating an existing loading card.

VideoAPI

ViewController

Base interface for view controllers that manage state and provide API access.

WithHidden

WithLocked

WithObjectLayout

WorkspaceSDK

SDK interface for workspace operations. Currently minimal but will be expanded.

Variables

Variable

Description

ARRAY_INDICES

Metadata key used to store array indices in CRDT structures for Yjs.

BasicShapeType

Available basic shape types that can be created using the ShapeAPI.

INDICES

Metadata key used for indices in CRDT structures.

MenuSections

Available sections for the Context Menu. Layers are in top to bottom order as they appear in the context menu.

META_PREFIX

Prefix used for all Yjs metadata keys in CRDT structures.

PARENTS_MAP

Metadata key used to store parent relationships in CRDT tree structures for Yjs.

ROOT

Metadata key used to identify the root element in CRDT tree structures for Yjs.

SectionTypes

Available section types for the Actions Panel. These are copy/pasted from editor for now - need to be unified somewhere.

ToolbarSections

Available sections for the Context Toolbar.

Type Aliases

Type Alias

Description

AbsolutePosition

Absolute position specification using exact pixel coordinates.

ActiveTool

Represents the currently active tool in the editor (artboard, move, pen, comment, shape, etc.).

AddIllustrationParams

Parameters for adding a new illustration to the design.

AddImageParams

Parameters for adding a new image to the design.

AddTextParams

Parameters for adding a new text element to the design.

AddVideoParams

Parameters for adding a new video to the design.

APIOptions

Generic options for API operations that control how state changes are processed and tracked.

**Execution Modes:** - **Batch Mode**: Uses batchClient to accumulate operations without immediate state updates. Operations are executed on a working copy and committed together for better performance. - **Direct Mode**: Immediately applies changes to the state store with specified origin and history tracking. - **Default Mode**: When undefined, uses standard UI origin with tracked history.

**Change Tracking:** - origin: Identifies the source of changes (UI, Canvas, CRDT, Volatile) for state synchronization - historyOrigin: Controls whether changes appear in undo/redo history (Tracked/Untracked)

AppState

Application state interface containing selection, viewport, active tool, and other UI state.

TODO: The comments on every property in this interface is a carry over from V1 AppStateStore. Some of these comments are related to some optimization techniques and will be verified and updated accordingly when we build Extensions

AwarenessState

Awareness state holds the presence information for all collaborators.

AwarenessStateApi

Public API for updating the local user's awareness state.

This API only affects the local user; remote users are provided by the collaboration backend via AwarenessState.

BasicShapeType

Type representing a basic shape type.

CanvasMode

Mode that affects overall canvas interaction - we hard code some here that we know will exist but there's no reason you can't use custom here too as we do allow Strings when its used in AppState.

CloneArtboardParams

Parameters for cloning an existing artboard.

CrdtBoards

CRDT-enhanced board type that includes array indices metadata for collaborative editing.

CrdtDesignState

TODO: generate these docs in https://app.clickup.com/t/86c697rw1

CrdtFill

CRDT-enhanced fill type that includes array indices metadata for collaborative editing.

CrdtGroupStructures

CRDT-enhanced group structure type that includes metadata for tree structure and array indices.

CrdtSerializedObject

CRDT-enhanced serialized object type that uses CrdtFill for collaborative editing.

CreateBoardParams

Parameters for creating a new artboard.

CreateElementWithPositionAndSize

Configuration for creating elements (images, artboards) with position and size specifications.

**Positioning System:** - **Absolute**: Exact pixel coordinates from canvas origin - **Relative**: Positioned relative to existing artboards with automatic spacing - **Centered**: Automatically centered within current viewport

**Artboard Targeting:** - If artboard is specified, element is placed within that artboard - If not specified, the system automatically determines the best artboard based on position - May create a new floating artboard if no suitable artboard exists

**Viewport Scaling:** - When applyViewportScale is true, element size is adjusted based on current zoom level - Useful for maintaining visual consistency across different zoom levels - Formula: actualScale = (elementSize / originalSize) / zoomLevel

CreateGuideInput

Parameters for creating a new guide.

CreateShapeInput

Input parameters for creating a new shape.

DesignApiOptions

Options for Design API operations, controlling execution mode and change tracking.

This type allows Design API methods to be executed in different contexts: - Batch mode for grouping multiple operations - Direct mode with change tracking for undo/redo functionality - Default mode with standard UI origin and tracked history

Dimensions

Element dimensions in pixels.

ElementLocation

Location reference point for relative positioning ('origin' or 'center').

ID

MenuSections

Type representing a context menu section.

ModelType

NormalizedBasicShapeObject

NormalizedBoard

NormalizedDesignState

NormalizedGuideObject

NormalizedIllustrationImageObject

NormalizedIllustrationObject

NormalizedLoadingCardObject

NormalizedObject

NormalizedRichTextObject

NormalizedVideoObject

OrientationConditional

Conditional type for guide orientation and position.

OriginX

Horizontal origin for rotation transformations. Determines the horizontal anchor point around which the object rotates.

OriginY

Vertical origin for rotation transformations. Determines the vertical anchor point around which the object rotates.

ProjectSDK

Base interface for project SDKs. Currently empty but will be expanded in the future.

ReferenceFrameMode

RelativePosition

Relative position specification for positioning relative to other elements or viewport.

RelativeToObject

Position element relative to another element or artboard.

RelativeToViewport

Position element relative to window's viewport coordinates.

SectionTypes

Type representing a section type in the Actions Panel.

SingleUser

Presence information for a single user in a collaborative session.

StandardisedGenerateFunction

The type for the generate function for the AI generator tool. This is the function that will be called when the user submits their generation request.

ToolbarSections

Type representing a toolbar section.

UpdateArtboardBackgroundParams

Parameters for updating the background image properties of an existing artboard.

UpdateArtboardParams

Parameters for updating artboard properties. Allows partial updates to any artboard property including nested artboard options.

UpdateIllustrationParams

Parameters for updating an existing illustration.

UpdateImageParams

Parameters for updating an existing image.

UpdateShapeInput

Input parameters for updating an existing shape. Shape type cannot be changed.

UpdateTextParams

Parameters for updating an existing text element.

UpdateVideoParams

Parameters for updating an existing video in the design.

Viewport

Represents the viewport of the canvas, including coordinates and zoom level. The coordinates are represented as a transformation matrix.

ViewportEventPayload

Payload for viewport change events.

WorkspaceAPI

API for workspace operations. Currently empty but will be expanded in the future.