/**
 * Visual Workspace
 *
 * Extended canvas system for creating rich visual workspaces with
 * elements like diagrams, charts, code blocks, and images.
 */
import { EventEmitter } from 'events';
/**
 * Visual element types
 */
export type VisualElementType = 'text' | 'code' | 'image' | 'chart' | 'diagram' | 'markdown' | 'table' | 'shape' | 'connection';
/**
 * Position in the workspace
 */
export interface Position {
    x: number;
    y: number;
}
/**
 * Size of an element
 */
export interface Size {
    width: number;
    height: number;
}
/**
 * Element style options
 */
export interface VisualElementStyle {
    backgroundColor?: string;
    borderColor?: string;
    borderWidth?: number;
    borderStyle?: 'solid' | 'dashed' | 'dotted' | 'none';
    borderRadius?: number;
    opacity?: number;
    shadow?: boolean;
    fontSize?: number;
    fontColor?: string;
    fontFamily?: string;
    textAlign?: 'left' | 'center' | 'right';
    padding?: number;
}
/**
 * Base visual element
 */
export interface VisualElement {
    id: string;
    type: VisualElementType;
    position: Position;
    size: Size;
    zIndex: number;
    locked: boolean;
    visible: boolean;
    label?: string;
    style?: VisualElementStyle;
    content: unknown;
    createdAt: Date;
    updatedAt: Date;
}
/**
 * Text element content
 */
export interface TextContent {
    text: string;
    rich?: boolean;
}
/**
 * Code element content
 */
export interface CodeContent {
    code: string;
    language: string;
    showLineNumbers?: boolean;
    highlightLines?: number[];
}
/**
 * Image element content
 */
export interface ImageContent {
    url?: string;
    data?: string;
    alt?: string;
    fit: 'contain' | 'cover' | 'fill' | 'none';
}
/**
 * Chart types
 */
export type ChartType = 'line' | 'bar' | 'pie' | 'scatter' | 'area' | 'radar';
/**
 * Chart element content
 */
export interface ChartContent {
    chartType: ChartType;
    data: {
        labels: string[];
        datasets: Array<{
            label: string;
            data: number[];
            color?: string;
        }>;
    };
    options?: {
        title?: string;
        showLegend?: boolean;
        showGrid?: boolean;
        animation?: boolean;
    };
}
/**
 * Diagram types
 */
export type DiagramType = 'flowchart' | 'sequence' | 'class' | 'mindmap' | 'gantt' | 'er';
/**
 * Diagram element content
 */
export interface DiagramContent {
    diagramType: DiagramType;
    source: string;
    format: 'mermaid' | 'plantuml' | 'dot';
    rendered?: string;
}
/**
 * Shape types
 */
export type ShapeType = 'rectangle' | 'circle' | 'ellipse' | 'triangle' | 'diamond' | 'arrow';
/**
 * Shape element content
 */
export interface ShapeContent {
    shapeType: ShapeType;
    fill?: string;
    stroke?: string;
    strokeWidth?: number;
    text?: string;
}
/**
 * Connection element content
 */
export interface ConnectionContent {
    fromElement: string;
    toElement: string;
    fromAnchor?: 'top' | 'right' | 'bottom' | 'left' | 'center';
    toAnchor?: 'top' | 'right' | 'bottom' | 'left' | 'center';
    lineType?: 'straight' | 'curved' | 'orthogonal';
    arrowStart?: boolean;
    arrowEnd?: boolean;
    label?: string;
}
/**
 * Workspace configuration
 */
export interface WorkspaceConfig {
    name: string;
    width: number;
    height: number;
    backgroundColor: string;
    gridSize: number;
    showGrid: boolean;
    snapToGrid: boolean;
    zoom: number;
    panOffset: Position;
    maxHistory: number;
}
/**
 * Default workspace configuration
 */
export declare const DEFAULT_WORKSPACE_CONFIG: WorkspaceConfig;
/**
 * Visual workspace
 */
export interface VisualWorkspace {
    id: string;
    config: WorkspaceConfig;
    elements: VisualElement[];
    selectedIds: string[];
    createdAt: Date;
    updatedAt: Date;
    version: number;
}
/**
 * History entry for undo/redo
 */
export interface WorkspaceHistoryEntry {
    action: 'add' | 'update' | 'delete' | 'move' | 'resize';
    elementIds: string[];
    previousState: Partial<VisualElement>[];
    newState: Partial<VisualElement>[];
    timestamp: Date;
}
/**
 * Manages visual workspaces
 */
export declare class VisualWorkspaceManager extends EventEmitter {
    private workspaces;
    private history;
    private historyIndex;
    /**
     * Create a new workspace
     */
    createWorkspace(config?: Partial<WorkspaceConfig>): VisualWorkspace;
    /**
     * Get a workspace by ID
     */
    getWorkspace(workspaceId: string): VisualWorkspace | undefined;
    /**
     * Get all workspaces
     */
    getAllWorkspaces(): VisualWorkspace[];
    /**
     * Delete a workspace
     */
    deleteWorkspace(workspaceId: string): boolean;
    /**
     * Add an element to workspace
     */
    addElement(workspaceId: string, type: VisualElementType, content: unknown, position: Position, size: Size, style?: VisualElementStyle): VisualElement;
    /**
     * Update an element
     */
    updateElement(workspaceId: string, elementId: string, updates: Partial<VisualElement>): VisualElement | null;
    /**
     * Delete an element
     */
    deleteElement(workspaceId: string, elementId: string): boolean;
    /**
     * Move an element
     */
    moveElement(workspaceId: string, elementId: string, position: Position): VisualElement | null;
    /**
     * Resize an element
     */
    resizeElement(workspaceId: string, elementId: string, size: Size): VisualElement | null;
    /**
     * Snap position to grid
     */
    private snapToGrid;
    /**
     * Snap size to grid
     */
    private snapSizeToGrid;
    /**
     * Add history entry
     */
    private addHistoryEntry;
    /**
     * Undo last action
     */
    undo(workspaceId: string): boolean;
    /**
     * Redo last undone action
     */
    redo(workspaceId: string): boolean;
    /**
     * Render workspace to terminal
     */
    renderToTerminal(workspaceId: string, width?: number, height?: number): string;
    /**
     * Export workspace to JSON
     */
    exportToJSON(workspaceId: string): string;
    /**
     * Import workspace from JSON
     */
    importFromJSON(json: string): VisualWorkspace;
    /**
     * Shutdown
     */
    shutdown(): void;
}
export declare function getVisualWorkspaceManager(): VisualWorkspaceManager;
export declare function resetVisualWorkspaceManager(): void;
export default VisualWorkspaceManager;
