/** * Class Diagram Wrapper Class * * A unified API for building, mutating, and querying class diagrams. * Provides a fluent interface that wraps the ClassDiagramAST. */ import { DiagramWrapper } from './diagram-wrapper.js'; import type { ClassDefinition, ClassDiagramAST, ClassDirection, ClassMember, ClassRelation, LineType, RelationType } from './types/class.js'; import type { RenderOptions } from './types/render-options.js'; /** Options for adding a class */ export interface AddClassOptions { label?: string; annotation?: string; } /** Options for adding a member */ export interface AddMemberOptions { visibility?: '+' | '-' | '#' | '~'; type?: 'method' | 'attribute'; } /** Options for adding a relation */ export interface AddRelationOptions { label?: string; labelFrom?: string; labelTo?: string; lineType?: LineType; } /** * A fluent wrapper for ClassDiagramAST that supports building, mutating, and querying. */ export declare class ClassDiagram extends DiagramWrapper { private constructor(); /** Create a new empty class diagram */ static create(direction?: ClassDirection): ClassDiagram; /** Create from an existing AST */ static from(ast: ClassDiagramAST): ClassDiagram; /** Parse Mermaid syntax into a ClassDiagram */ static parse(input: string): ClassDiagram; render(options?: RenderOptions): string; clone(): ClassDiagram; get direction(): ClassDirection; get classCount(): number; get relationCount(): number; get classes(): Map; setDirection(direction: ClassDirection): this; /** Add a class */ addClass(id: string, options?: AddClassOptions): this; /** Remove a class and optionally its relations */ removeClass(id: string, options?: { removeRelations?: boolean; }): this; /** Rename a class */ renameClass(id: string, newId: string): this; /** Get a class by ID */ getClass(id: string): ClassDefinition | undefined; /** Check if class exists */ hasClass(id: string): boolean; /** Set class label */ setClassLabel(id: string, label: string): this; /** Add annotation to class */ addAnnotation(id: string, annotation: string): this; /** Remove annotation from class */ removeAnnotation(id: string, annotation: string): this; /** Add a member (attribute or method) to a class */ addMember(classId: string, text: string, options?: AddMemberOptions): this; /** Add an attribute to a class */ addAttribute(classId: string, text: string, visibility?: '+' | '-' | '#' | '~'): this; /** Add a method to a class */ addMethod(classId: string, text: string, visibility?: '+' | '-' | '#' | '~'): this; /** Get members of a class */ getMembers(classId: string): ClassMember[]; /** Remove a member from a class */ removeMember(classId: string, text: string): this; /** Add a relation between classes */ addRelation(from: string, to: string, relationType: RelationType, options?: AddRelationOptions): this; /** Add inheritance relation (A extends B) */ addInheritance(child: string, parent: string, options?: AddRelationOptions): this; /** Add composition relation */ addComposition(whole: string, part: string, options?: AddRelationOptions): this; /** Add aggregation relation */ addAggregation(whole: string, part: string, options?: AddRelationOptions): this; /** Add dependency relation */ addDependency(from: string, to: string, options?: AddRelationOptions): this; /** Add association (simple line) */ addAssociation(from: string, to: string, options?: AddRelationOptions): this; /** Get all relations */ getRelations(): ClassRelation[]; /** Get relations for a class */ getRelationsFor(classId: string): ClassRelation[]; /** Remove a relation */ removeRelation(from: string, to: string): this; /** Add a namespace */ addNamespace(name: string, classIds?: string[]): this; /** Add class to namespace */ addToNamespace(namespace: string, classId: string): this; /** Remove class from namespace */ removeFromNamespace(namespace: string, classId: string): this; /** Get namespace for a class */ getNamespaceFor(classId: string): string | undefined; /** Add a note */ addNote(text: string, forClass?: string): this; /** Get all notes */ getNotes(): Array<{ text: string; forClass?: string; }>; /** Define a class style */ defineStyle(name: string, styles: string[]): this; /** Apply style to a class */ applyStyle(classId: string, styleName: string): this; /** Find classes by criteria */ findClasses(query: { hasAnnotation?: string; hasStyle?: string; inNamespace?: string; }): ClassDefinition[]; /** Get all subclasses of a class (direct inheritance) */ getSubclasses(classId: string): string[]; /** Get parent class (direct inheritance) */ getParentClass(classId: string): string | undefined; /** Get all ancestors (transitive inheritance) */ getAncestors(classId: string): string[]; /** Get all descendants (transitive inheritance) */ getDescendants(classId: string): string[]; } //# sourceMappingURL=class-diagram.d.ts.map