/**
 * DiagramContext - Shared state and helper methods for diagram generation
 *
 * Provides centralized access to AST data and helper methods for plugins
 */
import { DiagramContext as IDiagramContext, DiagramOptions, ThemeConfig, MermaidNode, MermaidEdge, Subgraph, MermaidRelation, MermaidLifecycle } from '../types/index.js';
import { SpecVerseAST, ModelSpec, ControllerSpec, ServiceSpec, EventSpec, ViewSpec } from '@specverse/types';
/**
 * Implementation of DiagramContext with helper methods
 */
export declare class DiagramContext implements IDiagramContext {
    ast: SpecVerseAST;
    options: DiagramOptions;
    theme: ThemeConfig;
    nodes: Map<string, MermaidNode>;
    edges: MermaidEdge[];
    subgraphs: Map<string, Subgraph>;
    relations: MermaidRelation[];
    lifecycles: Map<string, MermaidLifecycle>;
    metadata: Map<string, any>;
    constructor(ast: SpecVerseAST, options: DiagramOptions, theme: ThemeConfig);
    /**
     * Add a node to the diagram
     */
    addNode(node: MermaidNode): void;
    /**
     * Get a node by ID
     */
    getNode(id: string): MermaidNode | undefined;
    /**
     * Check if a node exists
     */
    hasNode(id: string): boolean;
    /**
     * Add an edge to the diagram
     */
    addEdge(edge: MermaidEdge): void;
    /**
     * Add multiple edges
     */
    addEdges(edges: MermaidEdge[]): void;
    /**
     * Add a subgraph to the diagram
     */
    addSubgraph(name: string, subgraph: Subgraph): void;
    /**
     * Get a subgraph by name
     */
    getSubgraph(name: string): Subgraph | undefined;
    /**
     * Get all models across all components
     */
    getAllModels(): ModelSpec[];
    /**
     * Get deduplicated relationships across all models
     *
     * Bidirectional relationships (hasMany/belongsTo, hasOne/belongsTo) are represented
     * only once, preventing duplicate lines in diagrams.
     *
     * @returns Array of deduplicated relationships with metadata
     */
    getDeduplicatedRelationships(): Array<{
        from: string;
        to: string;
        relationship: any;
        isCanonical: boolean;
    }>;
    /**
     * Create a canonical signature for a relationship
     *
     * The signature is the same regardless of direction for bidirectional relationships:
     * - Department hasMany Employee → "Department:Employee:one-to-many"
     * - Employee belongsTo Department → "Department:Employee:one-to-many"
     *
     * @private
     */
    private createRelationshipSignature;
    /**
     * Normalize relationship type to canonical form
     *
     * @private
     */
    private normalizeRelationshipType;
    /**
     * Determine if this relationship direction is the canonical one
     *
     * For bidirectional relationships, we prefer:
     * - hasMany over belongsTo (e.g., Department hasMany Employee)
     * - hasOne over belongsTo (e.g., Department hasOne Manager)
     *
     * @private
     */
    private isCanonicalDirection;
    /**
     * Get a model by name
     */
    getModelByName(name: string): ModelSpec | undefined;
    /**
     * Get all controllers across all components
     */
    getAllControllers(): ControllerSpec[];
    /**
     * Get a controller by name
     */
    getControllerByName(name: string): ControllerSpec | undefined;
    /**
     * Get all services across all components
     */
    getAllServices(): ServiceSpec[];
    /**
     * Get a service by name
     */
    getServiceByName(name: string): ServiceSpec | undefined;
    /**
     * Get all events across all components
     */
    getAllEvents(): EventSpec[];
    /**
     * Get an event by name
     */
    getEventByName(name: string): EventSpec | undefined;
    /**
     * Get all views across all components
     */
    getAllViews(): ViewSpec[];
    /**
     * Get all subscribers to a specific event
     */
    getEventSubscribers(eventName: string): Array<ControllerSpec | ServiceSpec | ViewSpec>;
    /**
     * Get all publishers of a specific event
     */
    getEventPublishers(eventName: string): Array<ModelSpec | ControllerSpec | ServiceSpec>;
    /**
     * Get all events published by a component (model, controller, or service)
     */
    getPublishedEvents(component: ModelSpec | ControllerSpec | ServiceSpec): string[];
    /**
     * Get all deployment instances that advertise a capability
     */
    getCapabilityProviders(capability: string): any[];
    /**
     * Get all deployment instances that use a capability
     */
    getCapabilityConsumers(capability: string): any[];
    /**
     * Clear all state (useful for generating multiple diagrams)
     */
    clear(): void;
    /**
     * Clone the context (useful for plugin isolation)
     */
    clone(): DiagramContext;
}
//# sourceMappingURL=DiagramContext.d.ts.map