/**
 * derive-graph.ts
 *
 * Pure client-side derivation: domain Maps → React Flow nodes + edges.
 * All edges are derived from domain relationships (repositoryPath matching,
 * parentNodeId) — never stored independently.
 */
import type { Edge } from '@xyflow/react';
import type { CanvasNodeType } from '../components/features/features-canvas/index.js';
import type { FeatureNodeData } from '../components/common/feature-node/index.js';
import type { RepositoryNodeData } from '../components/common/repository-node/index.js';
import type { ApplicationNodeData } from '../components/common/application-node/application-node-config.js';
/** A feature node entry stored in the domain Map. */
export interface FeatureEntry {
    nodeId: string;
    data: FeatureNodeData;
    /** If set, this feature connects to a parent feature via a dependency edge (no repo→feature edge). */
    parentNodeId?: string;
    /**
     * If set, this feature was launched scoped to an Application. Matched against
     * ApplicationEntry.data.id to derive an app→feature dependency edge instead of
     * the default repo→feature edge.
     */
    applicationId?: string;
}
/** A repository node entry stored in the domain Map. */
export interface RepoEntry {
    nodeId: string;
    data: RepositoryNodeData;
}
/** An application node entry stored in the domain Map. */
export interface ApplicationEntry {
    nodeId: string;
    data: ApplicationNodeData;
}
/** Stable callbacks passed by the consumer, injected into derived node data. */
export interface GraphCallbacks {
    /** Called when the user triggers an action on a feature node (e.g., adds a sub-feature). */
    onNodeAction?: (nodeId: string) => void;
    /** Called when the user opens settings/details on a feature node. */
    onNodeSettings?: (nodeId: string) => void;
    /** Called when the user deletes a feature. */
    onFeatureDelete?: (featureId: string, cleanup?: boolean, cascadeDelete?: boolean, closePr?: boolean) => void;
    /** Called when the user clicks the "+" add-feature button on a repo node. */
    onRepositoryAdd?: (repoNodeId: string) => void;
    /** Called when the user clicks a repo node to navigate to its detail page. */
    onRepositoryClick?: (repoNodeId: string) => void;
    /** Called when the user deletes a repository. */
    onRepositoryDelete?: (repositoryId: string, options?: {
        deleteFromDisk?: boolean;
    }) => void;
    /** Called when the user retries a failed feature. */
    onRetryFeature?: (featureId: string) => void;
    /** Called when the user starts a pending feature. */
    onStartFeature?: (featureId: string) => void;
    /** Called when the user stops a running feature. */
    onStopFeature?: (featureId: string) => void;
    /** Called when the user archives a feature. */
    onArchiveFeature?: (featureId: string) => void;
    /** Called when the user unarchives a feature. */
    onUnarchiveFeature?: (featureId: string) => void;
    /** Called when the user clicks an application node to navigate to its detail page. */
    onApplicationClick?: (applicationId: string) => void;
    /** Called when the user deletes an application. */
    onApplicationDelete?: (applicationId: string) => void;
    /** Called when the user triggers "New SDD feature" on an application node —
     *  the consumer is expected to navigate to the create drawer pre-scoped to
     *  this application in spec mode. */
    onApplicationCreateSddFeature?: (applicationId: string) => void;
}
/**
 * Derives React Flow nodes and edges from domain Maps.
 *
 * - Feature nodes without a parentNodeId → repo→feature edge (matched by repositoryPath)
 * - Feature nodes without a parentNodeId but with no matching repo → virtual repo node
 * - Feature nodes with a parentNodeId → dependency edge (parentNodeId→nodeId)
 * - Pending feature nodes (creating state) from pendingMap → same rules, no action callbacks
 * - Callbacks are injected into node data via closures
 */
export declare function deriveGraph(featureMap: Map<string, FeatureEntry>, repoMap: Map<string, RepoEntry>, pendingMap: Map<string, FeatureEntry>, callbacks?: GraphCallbacks, applicationMap?: Map<string, ApplicationEntry>): {
    nodes: CanvasNodeType[];
    edges: Edge[];
};
//# sourceMappingURL=derive-graph.d.ts.map