/* * This file is part of the kernelstudio package. * * (c) 2014-2026 zlin * * For the full copyright and license information, please view the LICENSE file * that was distributed with this source code. */ import type { NullableString } from '@/types'; import type { NodeSetting } from '@/views/decision/types'; export interface DraggableElement { id: number | null, key?: NullableString, name: NullableString, description: NullableString, category: NullableString, draggable: boolean, parent?: DraggableElement, children: DraggableElement[] [key: string]: unknown; } export type ElementStatus = 'default' | 'success' | 'failed' | 'running' | string | null export interface ElementPosition { x: number; y: number; } export interface ElementVariable { key: NullableString; name: NullableString; value: NullableString; defaults: NullableString; unit: NullableString; } export interface BaseElement { id: number; key: NullableString; type: NullableString; status: ElementStatus; } export interface TaskNodeRect { width?: number; height?: number; x?: number; y?: number; } export interface TaskNodeElement extends BaseElement { template: number; name: NullableString; description: NullableString; width: number; height: number; position: ElementPosition; inputs: any; outputs: any; variables: ElementVariable[]; parameters: Record; children?: TaskNodeElement[], [key: string]: unknown; } export interface SettingTaskNodeElement extends TaskNodeElement { settings: NodeSetting[]; } export interface EdgeNodeElement extends BaseElement { source: NullableString; target: NullableString; attrs: Record; router: Record; connector: any; } export interface NodeGraph { edges: EdgeNodeElement[]; nodes: TaskNodeElement[]; }