import { DynamicViewFlow, scalar, StepPath } from '@likec4/core'; import { TreeNodeData } from '@mantine/core'; import { DiagramContext } from '../../state/types'; export interface OutlineTreeNodeStep extends TreeNodeData { readonly value: StepPath; readonly nodeProps: Readonly<{ readonly type: 'step'; /** Global step number (1-based) across all flows */ readonly stepnum: number; /** Title of the source actor */ readonly source: string; /** Title of the target actor */ readonly target: string; /** Relationship label, if any */ readonly label: string | null; readonly notes: scalar.MarkdownOrString | null; }>; } export interface OutlineTreeNodeFlow extends TreeNodeData { readonly value: StepPath; readonly nodeProps: Readonly<{ readonly type: DynamicViewFlow.SubFlowType; /** Friendly title of the sub-flow, if defined */ readonly title: string | undefined; }>; children: OutlineTreeNodeData[]; } export type OutlineTreeNodeData = OutlineTreeNodeStep | OutlineTreeNodeFlow; export type OutlineTreeNodes = OutlineTreeNodeData[]; /** * Type guard narrowing a tree node to a sub-flow node. * (The discriminant lives on the nested `nodeProps.type`, so an explicit guard * is needed for reliable narrowing.) */ export declare function isOutlineFlowNode(node: OutlineTreeNodeData): node is OutlineTreeNodeFlow; export declare function useTreeData(flow: DynamicViewFlow, collapsed: DiagramContext['collapsedSequenceFlows']): OutlineTreeNodes;