/**
 * 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.
 */
/**
 * Collect a branch subtree: every node reachable from `branchHead` following the
 * `downstream` chain, descending into each node's nested branches (children whose
 * `upstream` is that node and which carry a `branchIndex`). Keyed by node id.
 *
 * Verbatim port of v1's `findBranchNodes` (`client/RemoveNodeContext.tsx`). The
 * linked-list fields (`upstream`/`downstream`) are assumed already wired by
 * `linkNodes`.
 */
export declare function collectBranchNodes(nodes: any[], branchHead: any): Map<any, any>;
/**
 * Find the nodes (excluding the target itself) that reference `target`'s output —
 * the set v1 blocks deletion on ("The result of this node has been referenced by
 * other nodes …"). `candidates` is the pool to scan: for a **leaf** node delete
 * it's all other nodes (`$jobsMapByNodeKey` only, `includeScopes: false`); for a
 * **branching** node delete it's the related/downstream subtree
 * (`includeScopes: true`).
 */
export declare function findNodesReferencing(candidates: any[], target: {
    key: string;
}, { includeScopes }?: {
    includeScopes?: boolean;
}): any[];
