import type { Writable } from 'svelte/store'; import type { AnchorStore, CSSDimensionString, InitialDimensions, Connections, Direction } from '.'; import type { XYPair, NodeKey, Dimensions, CSSColorString, GroupKey } from '.'; import type { ComponentType } from 'svelte'; export interface Node { id: NodeKey; rotation: Writable; position: Writable; moving: Writable; label: Writable; dimensions: Dimensions; inputs: Writable; outputs: Writable; anchors: AnchorStore; group: Writable; collapsed: Writable; resizingWidth: Writable; resizingHeight: Writable; rotating: Writable; editable: Writable; locked: Writable; recalculateAnchors: (direction?: Direction) => void; resizable: Writable; zIndex: Writable; edge: ComponentType | null; direction: Writable<'TD' | 'LR'>; borderRadius: Writable; borderWidth: Writable; connections: Writable; bgColor: Writable; borderColor: Writable; selectionColor: Writable; textColor: Writable; } export interface NodeConfig { id?: string | number; dimensions?: InitialDimensions; position?: { x: number; y: number; }; direction?: 'TD' | 'LR'; zIndex?: number; label?: string; group?: GroupKey; editable?: boolean; resizable?: boolean; inputs?: number; outputs?: number; locked?: boolean; selectionColor?: CSSColorString; component?: ComponentType; width?: number; height?: number; header?: true; props?: object; borderColor?: CSSColorString; bgColor?: CSSColorString; useDefaults?: boolean; borderRadius?: number; borderWidth?: number; rotation?: number; textColor?: CSSColorString; connections?: Connections; edge?: ComponentType; } export type UserDimension = number | CSSDimensionString; export type WritableNode = Writable;