/**
 * 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 remove-node flow, shared by BOTH canvases (ADR-0003, doc §9.6). A leaf
 * node deletes after the variable-reference safety check (blocked when another
 * node still references its result, else a confirm); a branching node opens a
 * "keep which branch" modal, then runs the same safety check over the kept-branch
 * + downstream subtree before deleting. Deletes via `flow_nodes.destroy` + refresh.
 *
 * This aligns the modern canvas to v1: the previous v2 implementation deleted
 * immediately and skipped the reference guard entirely. The check logic is the
 * shared pure `findNodesReferencing` / `collectBranchNodes`; the runtime-specific
 * bits (`api`, `nodes`, `refresh`, the instruction registry for branch labels)
 * are read through an injected `useCanvasRuntime` so v1 can re-import this single
 * provider and pass its own runtime (the allowed v1 → v2 direction).
 */
import React from 'react';
type RemoveNodeContextValue = {
    /** Request deletion of a node — runs the safety check and confirm/keep-branch
     *  flow, then deletes. Mirrors v1's `RemoveButton.onRemove`. */
    requestRemove: (node: any) => void;
};
/** Per-canvas runtime the provider needs but that differs by runtime — injected
 *  via `RemoveNodeContextProvider`'s `useCanvasRuntime` prop. */
export type CanvasRemoveRuntime = {
    api: any;
    nodes: any[] | undefined;
    refresh?: () => void;
    /** Resolve an instruction by type — for the branch-label `branching` metadata. */
    getInstruction: (type: string) => any;
};
export declare function useRemoveNodeContext(): RemoveNodeContextValue;
export declare function RemoveNodeContextProvider(props: {
    children: React.ReactNode;
    /** Injected per-canvas runtime source. Defaults to the modern canvas's; the
     *  legacy canvas passes its own (v1 `FlowContext` + `usePlugin` registry). */
    useCanvasRuntime?: () => CanvasRemoveRuntime;
}): React.JSX.Element;
export {};
