/** * C4 Diagram Wrapper Class * * Provides a fluent API for building, mutating, and querying C4 diagrams. */ import { DiagramWrapper } from './diagram-wrapper.js'; import type { C4AST, C4Boundary, C4BoundaryType, C4Component, C4Container, C4DeploymentNode, C4DiagramType, C4Direction, C4Element, C4ElementStyle, C4Person, C4Relationship, C4RelationshipStyle, C4RelationType, C4System } from './types/c4.js'; import type { RenderOptions } from './types/render-options.js'; /** * Options for adding a person */ export interface AddPersonOptions { label?: string; description?: string; sprite?: string; tags?: string; link?: string; external?: boolean; } /** * Options for adding a system */ export interface AddSystemOptions { label?: string; description?: string; sprite?: string; tags?: string; link?: string; external?: boolean; variant?: 'default' | 'db' | 'queue'; } /** * Options for adding a container */ export interface AddContainerOptions { label?: string; technology?: string; description?: string; sprite?: string; tags?: string; link?: string; external?: boolean; variant?: 'default' | 'db' | 'queue'; } /** * Options for adding a component */ export interface AddComponentOptions { label?: string; technology?: string; description?: string; sprite?: string; tags?: string; link?: string; external?: boolean; variant?: 'default' | 'db' | 'queue'; } /** * Options for adding a boundary */ export interface AddBoundaryOptions { label?: string; tags?: string; link?: string; } /** * Options for adding a deployment node */ export interface AddDeploymentNodeOptions { label?: string; technology?: string; description?: string; sprite?: string; tags?: string; link?: string; variant?: 'default' | 'left' | 'right'; } /** * Options for adding a relationship */ export interface AddRelationshipOptions { label?: string; technology?: string; description?: string; sprite?: string; tags?: string; link?: string; type?: C4RelationType; } /** * Query for finding elements */ export interface FindElementsQuery { type?: C4Element['type']; alias?: string; aliasContains?: string; labelContains?: string; } /** * Query for finding relationships */ export interface FindRelationshipsQuery { from?: string; to?: string; type?: C4RelationType; labelContains?: string; } /** * C4 Diagram wrapper class */ export declare class C4 extends DiagramWrapper { private constructor(); /** * Create an empty C4 diagram */ static create(diagramType?: C4DiagramType): C4; /** * Wrap an existing C4 AST */ static from(ast: C4AST): C4; /** * Parse a C4 diagram from Mermaid syntax */ static parse(text: string): C4; /** * Render the diagram to Mermaid syntax */ render(options?: RenderOptions): string; /** * Create a deep clone of this diagram */ clone(): C4; /** * Get the diagram type */ get diagramType(): C4DiagramType; /** * Set the diagram type */ setDiagramType(type: C4DiagramType): this; /** * Get the title */ get title(): string | undefined; /** * Set the title */ setTitle(title: string): this; /** * Get the direction */ get direction(): C4Direction | undefined; /** * Set the direction */ setDirection(direction: C4Direction): this; /** * Get all top-level elements */ get elements(): readonly C4Element[]; /** * Get the count of top-level elements */ get elementCount(): number; /** * Add a person */ addPerson(alias: string, options?: AddPersonOptions): this; /** * Add a system */ addSystem(alias: string, options?: AddSystemOptions): this; /** * Add a container */ addContainer(alias: string, options?: AddContainerOptions): this; /** * Add a component */ addComponent(alias: string, options?: AddComponentOptions): this; /** * Add a boundary */ addBoundary(alias: string, boundaryType?: C4BoundaryType, options?: AddBoundaryOptions): this; /** * Add a deployment node */ addDeploymentNode(alias: string, options?: AddDeploymentNodeOptions): this; /** * Add an element to a boundary or deployment node */ addToBoundary(boundaryAlias: string, element: C4Element): this; /** * Find a boundary by alias */ private findBoundary; /** * Get an element by alias */ getElement(alias: string): C4Element | undefined; /** * Find elements matching a query */ findElements(query: FindElementsQuery): C4Element[]; /** * Remove an element by alias */ removeElement(alias: string): this; /** * Get all relationships */ get relationships(): readonly C4Relationship[]; /** * Get the count of relationships */ get relationshipCount(): number; /** * Add a relationship */ addRelationship(from: string, to: string, options?: AddRelationshipOptions): this; /** * Find relationships matching a query */ findRelationships(query: FindRelationshipsQuery): C4Relationship[]; /** * Get relationships from a specific element */ getRelationshipsFrom(alias: string): C4Relationship[]; /** * Get relationships to a specific element */ getRelationshipsTo(alias: string): C4Relationship[]; /** * Remove a relationship */ removeRelationship(from: string, to: string): this; /** * Add an element style */ addElementStyle(elementName: string, style: Omit): this; /** * Add a relationship style */ addRelationshipStyle(from: string, to: string, style: Omit): this; /** * Get all people */ getPeople(): C4Person[]; /** * Get all systems */ getSystems(): C4System[]; /** * Get all containers */ getContainers(): C4Container[]; /** * Get all components */ getComponents(): C4Component[]; /** * Get all boundaries */ getBoundaries(): C4Boundary[]; /** * Get all deployment nodes */ getDeploymentNodes(): C4DeploymentNode[]; } //# sourceMappingURL=c4.d.ts.map