/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */
/**
 * Canvas copy/paste, shared by BOTH canvases (ADR-0003). Copy a node to the
 * clipboard; an add-slot becomes a paste zone; pasting into a position where the
 * node's variable references are no longer in scope prompts to strip them (or
 * keep, with a warning). Pastes via `flow_nodes.duplicate`.
 *
 * The provider's runtime-neutral dependencies (`api`, `t`, antd `modal`/`message`)
 * resolve identically in either runtime (flow-engine `ctx.api`, `useT`,
 * `App.useApp`). The two genuinely runtime-specific bits — the canvas flow data
 * (`{ workflow, nodes, refresh }`) and the `executed` flag — are read through an
 * injected `useCanvasRuntime` hook so each canvas supplies its own source: the
 * modern canvas reads its `FlowContext` + `workflow.executed`, the legacy canvas
 * its own `FlowContext` + `versionStats.executed`. v1 imports this provider from
 * here (the allowed `v1 → v2` direction) and passes its own runtime hook, so a
 * single implementation serves both.
 */
import React from 'react';
type ClipboardNode = {
    sourceId?: number;
    sourceKey?: string;
    type: string;
    title?: string;
    config?: Record<string, any>;
};
type PasteImpactItem = {
    key: string;
    title: string;
};
type PasteImpact = {
    status: 'safe' | 'warning' | 'disabled';
    impactedSelf: PasteImpactItem[];
    impactedDependents: PasteImpactItem[];
};
type NodeClipboardContextValue = {
    clipboard: ClipboardNode | null;
    copyNode: (node: any) => void;
    clearClipboard: () => void;
    getPasteImpact: (target: any) => PasteImpact;
    pasteNode: (target: any) => Promise<void>;
};
/** The per-canvas runtime data the provider needs but that differs by runtime —
 *  injected via `NodeClipboardContextProvider`'s `useCanvasRuntime` prop. */
export type CanvasClipboardRuntime = {
    workflow: any;
    nodes: any[] | undefined;
    refresh?: () => void;
    executed: boolean;
};
export declare function useNodeClipboardContext(): NodeClipboardContextValue;
export declare function NodeClipboardContextProvider(props: {
    children: React.ReactNode;
    /** Injected per-canvas runtime source. Defaults to the modern canvas's. The
     *  legacy canvas passes its own (v1 `FlowContext` + `versionStats.executed`). */
    useCanvasRuntime?: () => CanvasClipboardRuntime;
}): React.JSX.Element;
export {};
