/** * DiagramWrapper Base Class * * Abstract base class for diagram wrapper classes. * Provides common functionality for building, mutating, and querying diagrams. * * Each diagram type (Flowchart, Sequence, Class, etc.) extends this base class * and implements diagram-specific operations. */ import type { RenderOptions } from './types/render-options.js'; /** * Base interface for all diagram ASTs */ export interface BaseDiagramAST { type: string; title?: string; accDescription?: string; } /** * Abstract base class for diagram wrappers. * * @typeParam T - The specific AST type this wrapper manages */ export declare abstract class DiagramWrapper { protected ast: T; protected constructor(ast: T); /** * Render the diagram to Mermaid syntax * @param options - Render options */ abstract render(options?: RenderOptions): string; /** * Create a deep clone of this diagram. * Note: Returns the concrete type, not `this`, to avoid TypeScript polymorphic this issues. */ abstract clone(): DiagramWrapper; /** * Get the underlying AST */ toAST(): T; /** * Get the diagram type */ get type(): string; /** * Get the diagram title */ get title(): string | undefined; /** * Set the diagram title */ set title(value: string | undefined); /** * Get the accessibility description */ get accDescription(): string | undefined; /** * Set the accessibility description */ set accDescription(value: string | undefined); } /** * Helper type for extracting the AST type from a DiagramWrapper subclass */ export type ASTOf> = W extends DiagramWrapper ? T : never; //# sourceMappingURL=diagram-wrapper.d.ts.map