
import { Ot as RunsAggregated, en as LineageDataFromMetadata, i as RecceServerFlags, tn as LineageDiffData } from "./instanceInfo-D9Pe6gIo.js";
import { c as LineageGraphNode, i as LineageGraph, l as LineageGraphNodes, o as LineageGraphContextType, r as EnvInfo, s as LineageGraphEdge, u as LineageViewContextType } from "./types-O5C1mYdz.js";
import * as _tanstack_react_query5 from "@tanstack/react-query";
import * as react44 from "react";
import { ReactNode } from "react";
import * as react_jsx_runtime70 from "react/jsx-runtime";

//#region src/contexts/lineage/utils.d.ts
/**
 * Height of a column node in pixels
 * Must match COLUMN_NODE_HEIGHT in columns/LineageColumnNode.tsx
 */
declare const COLUMN_HEIGHT = 24;
/**
 * Map of node IDs to their column sets
 */
type NodeColumnSetMap = Record<string, Set<string>>;
/**
 * Get the union of multiple sets
 */
declare function union<T>(...sets: Set<T>[]): Set<T>;
/**
 * Get the intersection of multiple sets
 */
declare function intersect<T>(...sets: Set<T>[]): Set<T>;
/**
 * Get a set of neighbor nodes up to a certain degree
 */
declare function getNeighborSet(nodeIds: string[], getNeighbors: (id: string) => string[], degree?: number): Set<string>;
/**
 * Build a LineageGraph from base and current lineage data
 *
 * @param base - Base lineage data (before changes)
 * @param current - Current lineage data (after changes)
 * @param diff - Optional diff data for change status
 * @returns Processed LineageGraph structure
 *
 * @example
 * ```tsx
 * const lineageGraph = buildLineageGraph(
 *   serverInfo.lineage.base,
 *   serverInfo.lineage.current,
 *   serverInfo.lineage.diff
 * );
 * ```
 */
declare function buildLineageGraph(base: LineageDataFromMetadata, current: LineageDataFromMetadata, diff?: LineageDiffData): LineageGraph;
/**
 * Select upstream nodes from the given node IDs
 *
 * @param lineageGraph - The lineage graph
 * @param nodeIds - Starting node IDs
 * @param degree - Maximum degree of separation (default: 1000)
 * @returns Set of upstream node IDs
 */
declare function selectUpstream(lineageGraph: LineageGraph, nodeIds: string[], degree?: number): Set<string>;
/**
 * Select downstream nodes from the given node IDs
 *
 * @param lineageGraph - The lineage graph
 * @param nodeIds - Starting node IDs
 * @param degree - Maximum degree of separation (default: 1000)
 * @returns Set of downstream node IDs
 */
declare function selectDownstream(lineageGraph: LineageGraph, nodeIds: string[], degree?: number): Set<string>;
/**
 * Convert a LineageGraph to React Flow nodes and edges
 *
 * This is a simplified version that converts the graph structure.
 * For full column-level lineage support, use the OSS implementation.
 *
 * @param lineageGraph - The lineage graph to convert
 * @param selectedNodes - Optional filter for which nodes to include
 * @returns Tuple of [nodes, edges]
 */
declare function toReactFlowBasic(lineageGraph: LineageGraph, selectedNodes?: string[]): [LineageGraphNode[], LineageGraphEdge[]];
/**
 * Apply dagre layout to nodes and edges
 *
 * NOTE: This function requires @dagrejs/dagre to be installed.
 * Import and call it as follows:
 *
 * @example
 * ```tsx
 * import dagre from '@dagrejs/dagre';
 * import { layoutWithDagre } from '@datarecce/ui';
 *
 * const [nodes, edges] = toReactFlowBasic(lineageGraph);
 * layoutWithDagre(dagre, nodes, edges);
 * ```
 *
 * @param dagre - The dagre library instance
 * @param nodes - Nodes to layout
 * @param edges - Edges for layout
 * @param direction - Layout direction (default: "LR" for left-to-right)
 */
declare function layoutWithDagre(dagre: any, nodes: LineageGraphNodes[], edges: LineageGraphEdge[], direction?: string): void;
//#endregion
//#region src/contexts/lineage/LineageGraphContext.d.ts
/**
 * Props for LineageGraphProvider
 *
 * This is a props-driven provider - pass data from your data fetching layer.
 * The provider does NOT fetch data internally; consumers handle data fetching
 * and pass the results via props.
 */
interface LineageGraphProviderProps {
  children: ReactNode;
  /** The processed lineage graph data */
  lineageGraph?: LineageGraph;
  /** Environment information (git, dbt, sqlmesh metadata) */
  envInfo?: EnvInfo;
  /** Whether in review mode (read-only checks) */
  reviewMode?: boolean;
  /** Whether in cloud mode (recce cloud) */
  cloudMode?: boolean;
  /** Whether in file mode (loading from file) */
  fileMode?: boolean;
  /** The state file name if in file mode */
  fileName?: string;
  /** Whether this is the demo site */
  isDemoSite?: boolean;
  /** Whether running in GitHub Codespace */
  isCodespace?: boolean;
  /** Loading state */
  isLoading?: boolean;
  /** Error message if loading failed */
  error?: string;
  /** Supported task types from server */
  supportTasks?: Record<string, boolean>;
  /** Callback to refetch the lineage graph */
  onRefetchLineageGraph?: () => void;
  /** Pre-aggregated run results by model */
  runsAggregated?: RunsAggregated;
  /** Callback to refetch aggregated runs */
  onRefetchRunsAggregated?: () => void;
}
/**
 * Provider for LineageGraph context.
 *
 * This is a props-driven provider designed for library consumers.
 * Pass data from your data fetching layer (e.g., TanStack Query).
 *
 * @example
 * ```tsx
 * const { data, isLoading, error, refetch } = useQuery({
 *   queryKey: ['lineage'],
 *   queryFn: fetchLineageData,
 * });
 *
 * <LineageGraphProvider
 *   lineageGraph={data?.lineageGraph}
 *   envInfo={data?.envInfo}
 *   isLoading={isLoading}
 *   error={error?.message}
 *   onRefetchLineageGraph={refetch}
 * >
 *   <LineageView />
 * </LineageGraphProvider>
 * ```
 */
declare function LineageGraphProvider({
  children,
  lineageGraph,
  envInfo,
  reviewMode,
  cloudMode,
  fileMode,
  fileName,
  isDemoSite,
  isCodespace,
  isLoading,
  error,
  supportTasks,
  onRefetchLineageGraph,
  runsAggregated,
  onRefetchRunsAggregated
}: LineageGraphProviderProps): react_jsx_runtime70.JSX.Element;
/**
 * Hook to access the LineageGraph context.
 *
 * @returns LineageGraphContextType with lineage data and utilities
 * @throws Warning in dev mode if used outside provider (returns default context)
 */
declare function useLineageGraphContext(): LineageGraphContextType;
/**
 * Hook to access aggregated runs data.
 * Convenience wrapper around useLineageGraphContext.
 *
 * @returns Tuple of [runsAggregated, refetchRunsAggregated]
 */
declare function useRunsAggregated(): [RunsAggregated | undefined, (() => void) | undefined];
//#endregion
//#region src/contexts/lineage/LineageViewContext.d.ts
declare const LineageViewContext: react44.Context<LineageViewContextType | undefined>;
declare const useLineageViewContextSafe: () => LineageViewContextType;
declare const useLineageViewContext: () => LineageViewContextType | undefined;
//#endregion
//#region src/contexts/lineage/useRecceServerFlag.d.ts
/**
 * Hook to fetch server-side feature flags.
 *
 * Uses TanStack Query to cache and manage flag state.
 * Works both inside RecceProvider (uses configured client) and outside (uses default axios).
 *
 * @returns TanStack Query result with RecceServerFlags data
 */
declare function useRecceServerFlag(): _tanstack_react_query5.UseQueryResult<RecceServerFlags, Error>;
//#endregion
export { toReactFlowBasic as _, LineageGraphProvider as a, useRunsAggregated as c, buildLineageGraph as d, getNeighborSet as f, selectUpstream as g, selectDownstream as h, useLineageViewContextSafe as i, COLUMN_HEIGHT as l, layoutWithDagre as m, LineageViewContext as n, LineageGraphProviderProps as o, intersect as p, useLineageViewContext as r, useLineageGraphContext as s, useRecceServerFlag as t, NodeColumnSetMap as u, union as v };
//# sourceMappingURL=index-BEuy4ayk.d.ts.map