Skip to content

Api: Types

ryusufe edited this page Nov 24, 2025 · 1 revision

Type Definitions

NodeType

Represents a node in the kit.

interface NodeType<Data = any> {
  id: string;
  x: number;
  y: number;
  width: number;
  height: number;
  data?: NodeData<Data>;
  class?: string;
  style?: JSX.CSSProperties;
}

NodeData

interface NodeData<T = any> {
  label?: string;
  component?: {
    type: string;
    props?: T & { kit?: Kit; node?: NodeType };
  };
}
  • label: Default label text.
  • component: Configuration for rendering a custom component.
    • type: Key matching a component in the components prop.
    • props: Props to pass to the custom component.

ConnectionType

Represents a connection between two nodes.

interface ConnectionType {
  id: string;
  from: ConnectionNode;
  to: ConnectionNode;
  label?: string;
  class?: string;
  style?: JSX.CSSProperties;
}

ConnectionNode

interface ConnectionNode {
  id: string;
  side: "top" | "left" | "bottom" | "right";
}

ViewPort

interface ViewPort {
  x: number;
  y: number;
  zoom: number;
}

Clone this wiki locally