import type { AnimationOptions } from '../../animations/types'; import type { BaseNodeStyleProps } from '../../elements/nodes'; import type { Graph } from '../../runtime/graph'; import type { NodeData } from '../data'; import type { AnimationStage } from './animation'; import type { PaletteOptions } from './palette'; /** * 节点配置项 * * Node spec */ export interface NodeOptions { /** * 节点类型 * * Node type */ type?: string | ((this: Graph, datum: NodeData) => string); /** * 节点样式 * * Node style */ style?: NodeStyle | ((this: Graph, data: NodeData) => NodeStyle) | { [K in keyof NodeStyle]: NodeStyle[K] | ((this: Graph, data: NodeData) => NodeStyle[K]); }; /** * 节点状态样式 * * Node state style */ state?: Record NodeStyle) | { [K in keyof NodeStyle]: NodeStyle[K] | ((this: Graph, data: NodeData) => NodeStyle[K]); }>; /** * 节点动画 * * Node animation */ animation?: false | Record; /** * 色板 * * Palette */ palette?: PaletteOptions; } export interface StaticNodeOptions { style?: NodeStyle; state?: Record; animation?: false | Record; palette?: PaletteOptions; } export interface NodeStyle extends Partial { [key: string]: unknown; }