/** * Sequence Diagram Wrapper Class * * A unified API for building, mutating, and querying sequence diagrams. * Provides a fluent interface that wraps the SequenceAST. */ import { DiagramWrapper } from './diagram-wrapper.js'; import type { RenderOptions } from './types/render-options.js'; import type { NotePlacement, SequenceArrowType, SequenceAST, SequenceBox, SequenceMessage, SequenceNote } from './types/sequence.js'; /** Options for adding an actor/participant */ export interface AddActorOptions { alias?: string; type?: 'participant' | 'actor'; } /** Options for adding a message */ export interface AddMessageOptions { arrow?: SequenceArrowType; activate?: boolean; deactivate?: boolean; } /** Options for adding a note */ export interface AddNoteOptions { placement?: NotePlacement; } /** * A fluent wrapper for SequenceAST that supports building, mutating, and querying. */ export declare class Sequence extends DiagramWrapper { private constructor(); /** Create a new empty sequence diagram */ static create(title?: string): Sequence; /** Create from an existing AST */ static from(ast: SequenceAST): Sequence; /** Parse Mermaid syntax into a Sequence */ static parse(input: string): Sequence; render(options?: RenderOptions): string; clone(): Sequence; get title(): string | undefined; get actorCount(): number; get statementCount(): number; get actors(): Map; setTitle(title: string): this; /** Add a participant */ addParticipant(id: string, name?: string, options?: AddActorOptions): this; /** Add an actor (stick figure) */ addActor(id: string, name?: string, options?: AddActorOptions): this; /** Remove an actor and optionally their messages */ removeActor(id: string, options?: { removeMessages?: boolean; }): this; /** Rename an actor */ renameActor(id: string, newName: string): this; /** Get an actor by ID */ getActor(id: string): { id: string; name: string; type: 'participant' | 'actor'; } | undefined; /** Check if actor exists */ hasActor(id: string): boolean; /** Add a message between actors */ addMessage(from: string, to: string, text: string, options?: AddMessageOptions): this; /** Get all messages */ getMessages(): SequenceMessage[]; /** Get messages from a specific actor */ getMessagesFrom(actorId: string): SequenceMessage[]; /** Get messages to a specific actor */ getMessagesTo(actorId: string): SequenceMessage[]; /** Get messages between two actors */ getMessagesBetween(actor1: string, actor2: string): SequenceMessage[]; /** Add a note */ addNote(actors: string | string[], text: string, options?: AddNoteOptions): this; /** Get all notes */ getNotes(): SequenceNote[]; /** Activate an actor */ activate(actor: string): this; /** Deactivate an actor */ deactivate(actor: string): this; /** Add a loop block */ addLoop(text: string, buildFn: (seq: Sequence) => void): this; /** Add an alt block with sections */ addAlt(sections: Array<{ condition: string; build: (seq: Sequence) => void; }>): this; /** Add an opt block */ addOpt(text: string, buildFn: (seq: Sequence) => void): this; /** Add a par block with sections */ addPar(sections: Array<{ text: string; build: (seq: Sequence) => void; }>): this; /** Add a critical block */ addCritical(text: string, buildFn: (seq: Sequence) => void, options?: Array<{ text: string; build: (seq: Sequence) => void; }>): this; /** Add a break block */ addBreak(text: string, buildFn: (seq: Sequence) => void): this; /** Add a rect (highlight) block */ addRect(color: string, buildFn: (seq: Sequence) => void): this; /** Add a box grouping for actors */ addBox(text: string | undefined, actorIds: string[], color?: string): this; /** Get all boxes */ getBoxes(): SequenceBox[]; /** Enable autonumbering */ autonumber(start?: number, step?: number): this; /** Disable autonumbering */ autonumberOff(): this; /** Find actors by type */ findActors(query: { type?: 'participant' | 'actor'; }): Array<{ id: string; name: string; type: 'participant' | 'actor'; }>; /** Find messages by criteria */ findMessages(query: { from?: string; to?: string; textContains?: string; arrow?: SequenceArrowType; }): SequenceMessage[]; /** Get all actors that communicate with a given actor */ getCommunicatingActors(actorId: string): string[]; /** Recursively filter statements */ private filterStatements; } //# sourceMappingURL=sequence.d.ts.map