/** * Sequence diagram parser. * @module diagrams/sequence/parse */ export type Participant = { id: string; label: string; kind: "participant" | "actor" | "boundary" | "control" | "entity" | "database" | "collections" | "queue"; colors: import("../../syntax/color.mjs").ColorSpec; stereotypes: string[]; /** * Explicit `order` value or declaration index. */ order: number; /** * Event index of `create`. */ createdAt: number | null; /** * Explicitly declared (vs implicit from a message). */ declared: boolean; }; export type MessageArrow = { startHead: string | null; endHead: string | null; lineStyle: "solid" | "dashed"; color: string | null; }; export type SeqEvent = ({ type: "message"; from: string; to: string; text: string; arrow: MessageArrow; number: string | null; parallel: boolean; edge: "left" | "right" | null; edgeSide: "from" | "to" | null; short: boolean; lifecycle: { source: string | null; target: string | null; }; line: number; } | { type: "note"; over: string[]; position: "left" | "right" | "over" | "across"; text: string; shape: "note" | "hnote" | "rnote"; colors: import("../../syntax/color.mjs").ColorSpec; attached: boolean; } | { type: "activate"; id: string; color: string | null; } | { type: "deactivate"; id: string; } | { type: "destroy"; id: string; } | { type: "create"; id: string; } | { type: "divider"; text: string; } | { type: "delay"; text: string; } | { type: "space"; height: number; } | { type: "groupStart"; kind: string; text: string; color: string | null; } | { type: "groupElse"; text: string; color: string | null; } | { type: "groupEnd"; } | { type: "ref"; over: string[]; text: string; }); export type SequenceModel = { meta: import("../../syntax/commons.mjs").DiagramMeta; participants: Map; events: SeqEvent[]; boxes: ParticipantBox[]; hideFootbox: boolean; messageAlign: "left" | "center" | "right"; }; export type ParticipantBox = { text: string; color: string | null; textColor: string | null; members: string[]; }; export type SeqContext = { model: SequenceModel; module: import("../../core/registry.mjs").ModuleContext; autonumber: { on: boolean; value: number; step: number; format: string; }; box: ParticipantBox | null; /** * Stack of callers for `return`. */ activations: string[][]; order: number; /** * `autoactivate on`: calls activate, dashed replies deactivate. */ autoactivate: boolean; }; /** * Locate the message arrow in a line. Quoted text is skipped. * @param {string} line * @returns {{ start: number, end: number, left: string, body: string, right: string } | null} */ export declare function findMessageArrow(line: string): { start: number; end: number; left: string; body: string; right: string; } | null; /** * @param {import("../../core/source.mjs").SourceLine[]} lines * @param {import("../../core/registry.mjs").ModuleContext} module * @returns {SequenceModel} */ export declare function parseSequence(lines: import("../../core/source.mjs").SourceLine[], module: import("../../core/registry.mjs").ModuleContext): SequenceModel;