import { AnchorPoint, Point } from '../../util/canvas-util'; import { Side } from '../../util/svg-util'; import { CollabTimestamp, CollabTimestampSet } from '../collab/primitives'; export declare const DAGA_FILE_VERSION = 1; /** * Representation of a diagram model in a serialized format. * @public * @see DiagramModel */ export interface DagaModel { id?: string; /** User version */ version?: string; name: string; description?: string; type: string; /** Serialization file format version for tooling */ typeVersion: number; createdAt: Date; updatedAt: Date; nodes: DagaNode[]; connections: DagaConnection[]; objects?: DagaObject[]; data: { [key: string]: unknown; }; collabMeta?: { logicalClock: number; dataTimestamps: CollabTimestampSet; }; } export interface DagaNode { id: string; type: string; children?: DagaNode[]; sections?: DagaSection[]; ports?: DagaPort[]; decorators?: DagaDecorator[]; label: string; coords: Point; width: number; height: number; data: { [key: string]: unknown; }; collabMeta?: { removed: boolean; selfRemoved: boolean; selfRemovedTimestamp: CollabTimestamp | null; geometryTimestamp: CollabTimestamp | null; dataTimestamps: CollabTimestampSet; label?: { removed: boolean; selfRemoved: boolean; selfRemovedTimestamp: CollabTimestamp | null; textTimestamp: CollabTimestamp | null; }; }; } export interface DagaSection { id: string; ports?: DagaPort[]; decorators?: DagaDecorator[]; label: string; indexXInNode: number; indexYInNode: number; coords: Point; width: number; height: number; collabMeta?: { removed: boolean; selfRemoved: boolean; selfRemovedTimestamp: CollabTimestamp | null; label?: { removed: boolean; selfRemoved: boolean; selfRemovedTimestamp: CollabTimestamp | null; textTimestamp: CollabTimestamp | null; }; }; } export interface DagaPort { id: string; type?: string; coords: Point; connectionPoint?: Point; direction: Side; label: string; collabMeta?: { removed: boolean; selfRemoved: boolean; selfRemovedTimestamp: CollabTimestamp | null; label?: { removed: boolean; selfRemoved: boolean; selfRemovedTimestamp: CollabTimestamp | null; textTimestamp: CollabTimestamp | null; }; }; } export interface DagaConnection { id: string; type: string; start: string; end: string; startLabel: string; middleLabel: string; endLabel: string; points: Point[]; data: { [key: string]: unknown; }; collabMeta?: { removed: boolean; selfRemoved: boolean; selfRemovedTimestamp: CollabTimestamp | null; dataTimestamps: CollabTimestampSet; }; } export interface DagaObject { id: string; coords: Point; width: number; height: number; priority: number; svg: string; collabMeta?: { removed: boolean; selfRemoved: boolean; }; } export interface DagaDecorator { id: string; coords: Point; width: number; height: number; priority: number; anchorPoints: [AnchorPoint, AnchorPoint]; svg: string; collabMeta?: { removed: boolean; selfRemoved: boolean; }; }