import type { Writable, Readable } from 'svelte/store'; import type { GraphKey, NodeStore, Node, CSSColorString, XYPair, Dimensions, GroupBoxStore, EdgeStore, GroupKey, Anchor, InputStore, OutputStore, GraphDimensions, Theme } from '.'; import type { ComponentType } from 'svelte'; import type { createBoundsStore } from '../utils/creators/createBoundsStore'; export interface Graph { id: GraphKey; nodes: NodeStore; transforms: GraphTransforms; locked: Writable; bounds: ReturnType; mounted: Writable; center: Readable; maxZIndex: Writable; dimensions: Writable; editable: boolean; direction: 'TD' | 'LR'; cursor: Readable<{ x: number; y: number; }>; groups: Writable; edges: EdgeStore; edge: ComponentType | null; groupBoxes: GroupBoxStore; editing: Writable; activeGroup: Writable; initialNodePositions: Writable; } export interface GraphConfig { editable?: boolean; zoom?: number; direction?: 'TD' | 'LR'; locked?: boolean; theme?: Theme; translation?: { x: number; y: number; }; edge?: ComponentType; } export type LinkingAny = Anchor; export interface LinkingInput { anchor: Anchor; store: InputStore | null; key: string | number | null; } export interface LinkingOutput { anchor: Anchor; store: OutputStore | null; } export interface ConnectingFrom { anchor: Anchor; store: InputStore | OutputStore | null; key: string | number | null; } export type Groups = Record; export interface Bounds { top: Writable; left: Writable; width: Writable; height: Writable; } export type GroupBoxes = Record; export interface GroupBox { group: Writable; dimensions: Dimensions; position: Writable; color: Writable; moving: Writable; locked: Writable; } export interface Group { parent: Writable; nodes: Writable>; } export interface GraphTransforms { translation: Writable; scale: Writable; }