/** * @license * Copyright 2024 Nuraly, Laabidi Aymen * SPDX-License-Identifier: MIT */ import { ReactiveControllerHost } from 'lit'; import { BaseCanvasController } from './base.controller.js'; import { CanvasHost } from '../interfaces/index.js'; import { WorkflowNode, WorkflowEdge, Position } from '../workflow-canvas.types.js'; import type { UndoController } from './undo.controller.js'; /** * Clipboard data format for workflow nodes and edges */ export interface ClipboardData { type: 'nuraly-workflow-nodes'; version: string; nodes: WorkflowNode[]; edges: WorkflowEdge[]; copyOrigin: Position; } /** * Extended canvas host interface for clipboard controller */ export interface ClipboardHost extends CanvasHost { /** Last mouse position on canvas for paste positioning */ lastMousePosition: Position | null; } /** * Controller for clipboard operations (copy, cut, paste) * Supports both internal clipboard and system clipboard with JSON serialization */ export declare class ClipboardController extends BaseCanvasController { private undoController; /** Internal clipboard for fallback when system clipboard is unavailable */ private internalClipboard; /** * Set the undo controller (called after initialization) */ setUndoController(controller: UndoController): void; /** * Copy selected nodes and their connecting edges to clipboard */ copySelected(): Promise; /** * Cut selected nodes (copy + delete) */ cutSelected(): Promise; /** * Paste nodes from clipboard * @param position Optional position to paste at. If not provided, uses mouse position or canvas center. */ pasteFromClipboard(position?: Position): Promise; /** * Check if there's content available to paste */ hasClipboardContent(): Promise; /** * Serialize the current selection to clipboard data format */ private serializeSelection; /** * Parse clipboard text into ClipboardData * Supports both Nuraly format and raw workflow JSON */ private parseClipboardData; /** * Calculate the center position of a selection of nodes */ private calculateSelectionCenter; /** * Get the position to paste at * Uses mouse position if available, otherwise offsets from copy origin */ private getPastePosition; /** * Delete selected nodes and their connected edges */ private deleteSelected; } //# sourceMappingURL=clipboard.controller.d.ts.map