/**
 * Core type definitions for the Unified Diagram Engine
 *
 * Provides interfaces for diagram generation, plugins, context, and styling
 */
import { SpecVerseAST, ModelSpec, ControllerSpec, ServiceSpec, EventSpec, ViewSpec } from '@specverse/types';
/**
 * Available diagram types
 */
export type DiagramType = 'event-flow-layered' | 'event-flow-sequence' | 'event-flow-swimlane' | 'class-diagram' | 'er-diagram' | 'profile-attachment' | 'lifecycle' | 'mvc-architecture' | 'service-architecture' | 'component-dependencies' | 'deployment-topology' | 'capability-flow' | 'environment-comparison' | 'manifest-mapping' | 'technology-stack' | 'capability-bindings' | 'api-routes' | 'security-architecture' | 'monitoring-observability';
/**
 * Output format for diagrams
 */
export type OutputFormat = 'mermaid' | 'plantuml' | 'graphviz';
/**
 * Diagram generation options
 */
export interface DiagramOptions {
    includeAttributes?: boolean;
    includeRelationships?: boolean;
    includeLifecycles?: boolean;
    includeBehaviors?: boolean;
    includeProfiles?: boolean;
    includeControllers?: boolean;
    includeServices?: boolean;
    includeEvents?: boolean;
    includeImports?: boolean;
    includeExports?: boolean;
    includeCapabilities?: boolean;
    includeScaling?: boolean;
    theme?: string;
    title?: string;
    direction?: 'TB' | 'TD' | 'BT' | 'LR' | 'RL';
    layerStyle?: 'horizontal' | 'vertical';
    components?: string[];
    models?: string[];
    events?: string[];
    [key: string]: any;
}
/**
 * Color palette for themes
 */
export interface ColorPalette {
    model: string;
    profile: string;
    controller: string;
    service: string;
    event: string;
    view: string;
    domainEvent: string;
    appEvent: string;
    lifecycle: string;
    deployment: string;
    manifest: string;
    component: string;
    implementation: string;
    technology: string;
    capability: string;
}
/**
 * Shape configuration for nodes
 */
export interface ShapeConfig {
    model: 'rectangle' | 'rounded' | 'stadium' | 'cylinder';
    controller: 'rectangle' | 'rounded' | 'hexagon';
    service: 'rectangle' | 'rounded' | 'circle';
    event: 'diamond' | 'rounded' | 'hexagon';
    view: 'rectangle' | 'rounded' | 'trapezoid';
}
/**
 * Layout configuration
 */
export interface LayoutConfig {
    rankDir: 'TB' | 'TD' | 'BT' | 'LR' | 'RL';
    nodeSpacing: number;
    rankSpacing: number;
    edgeSpacing: number;
}
/**
 * Complete theme configuration
 */
export interface ThemeConfig {
    name: string;
    description?: string;
    colors: ColorPalette;
    shapes: ShapeConfig;
    layout: LayoutConfig;
}
/**
 * Mermaid node representation
 */
export interface MermaidNode {
    id: string;
    label: string;
    type: 'model' | 'profile' | 'controller' | 'service' | 'event' | 'view' | 'deployment' | 'manifest' | 'component' | 'implementation' | 'technology' | 'capability' | 'domainEvent' | 'appEvent';
    shape?: string;
    color?: string;
    attributes?: string[];
    methods?: string[];
    metadata?: Record<string, any>;
}
/**
 * Mermaid edge representation
 */
export interface MermaidEdge {
    from: string;
    to: string;
    type: 'solid' | 'dashed' | 'dotted';
    label?: string;
    arrow?: 'single' | 'double' | 'none';
    style?: string;
    metadata?: Record<string, any>;
}
/**
 * Mermaid subgraph representation
 */
export interface Subgraph {
    id: string;
    label: string;
    nodes: string[];
    direction?: 'TB' | 'TD' | 'BT' | 'LR' | 'RL';
    style?: string;
}
/**
 * Mermaid relationship (for ER diagrams)
 */
export interface MermaidRelation {
    from: string;
    to: string;
    type: 'hasMany' | 'hasOne' | 'belongsTo' | 'manyToMany';
    label?: string;
    cascade?: boolean;
    through?: string;
    fromCardinality?: string;
    toCardinality?: string;
    metadata?: Record<string, any>;
}
/**
 * Lifecycle state
 */
export interface MermaidState {
    id?: string;
    name: string;
    label?: string;
    type?: 'start' | 'end' | 'normal';
    metadata?: Record<string, any>;
}
/**
 * Lifecycle transition
 */
export interface MermaidTransition {
    from: string;
    to: string;
    action?: string;
    condition?: string;
    label?: string;
}
/**
 * Lifecycle diagram
 */
export interface MermaidLifecycle {
    name: string;
    states: MermaidState[];
    transitions: MermaidTransition[];
}
/**
 * Sequence diagram element
 */
export interface MermaidSequence {
    type: 'participant' | 'message' | 'note' | 'activate' | 'deactivate';
    participant?: string;
    label?: string;
    from?: string;
    to?: string;
    message?: string;
    activate?: boolean;
    placement?: 'over' | 'left' | 'right';
    participants?: string[];
}
/**
 * Complete Mermaid diagram
 */
export interface MermaidDiagram {
    type: 'graph' | 'erDiagram' | 'sequenceDiagram' | 'stateDiagram' | 'classDiagram';
    direction?: 'TB' | 'TD' | 'BT' | 'LR' | 'RL';
    title?: string;
    nodes: MermaidNode[];
    edges: MermaidEdge[];
    subgraphs: Subgraph[];
    relations?: MermaidRelation[];
    lifecycles?: MermaidLifecycle[];
    states?: MermaidState[];
    sequences?: MermaidSequence[];
    metadata?: Record<string, any>;
}
/**
 * Diagram context - shared state during diagram generation
 */
export interface DiagramContext {
    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>;
    getAllModels(): ModelSpec[];
    getAllControllers(): ControllerSpec[];
    getAllServices(): ServiceSpec[];
    getAllViews(): ViewSpec[];
    getAllEvents(): EventSpec[];
    getDeduplicatedRelationships(): Array<{
        from: string;
        to: string;
        relationship: any;
        isCanonical: boolean;
    }>;
}
/**
 * Validation result
 */
export interface ValidationResult {
    valid: boolean;
    errors: string[];
    warnings: string[];
}
/**
 * Plugin interface - all diagram plugins must implement this
 */
export interface DiagramPlugin {
    /**
     * Plugin metadata
     */
    name: string;
    version: string;
    description: string;
    supportedTypes: DiagramType[];
    /**
     * Generate diagram from context
     */
    generate(context: DiagramContext, type: DiagramType): MermaidDiagram;
    /**
     * Validate AST before generation
     */
    validate(ast: SpecVerseAST): ValidationResult;
    /**
     * Get default options for this plugin
     */
    getDefaultOptions(): Partial<DiagramOptions>;
}
/**
 * Diagram generator configuration
 */
export interface DiagramGeneratorConfig {
    plugins: DiagramPlugin[];
    theme?: string | ThemeConfig;
    outputFormat?: OutputFormat;
}
//# sourceMappingURL=index.d.ts.map