
import { o as LineageGraphProviderProps } from "./index-CMxFy9tk.js";
import { h as RecceActionProviderProps } from "./index-C-GvORS_.js";
import { AxiosInstance } from "axios";
import * as react27 from "react";
import { ReactNode } from "react";
import * as react_jsx_runtime43 from "react/jsx-runtime";

//#region src/providers/contexts/CheckContext.d.ts
interface Check {
  check_id: string;
  name: string;
  type: string;
  description?: string;
  is_checked?: boolean;
}
interface CheckContextType {
  checks: Check[];
  isLoading: boolean;
  error?: string;
  selectedCheckId?: string;
  onSelectCheck?: (checkId: string) => void;
  onCreateCheck?: (check: Partial<Check>) => Promise<Check>;
  onUpdateCheck?: (checkId: string, updates: Partial<Check>) => Promise<Check>;
  onDeleteCheck?: (checkId: string) => Promise<void>;
  onReorderChecks?: (sourceIndex: number, destIndex: number) => Promise<void>;
  refetchChecks?: () => void;
  /** @remarks Alias of selectedCheckId (OSS backward compatibility). */
  latestSelectedCheckId?: string;
  /** @remarks Alias of onSelectCheck (OSS backward compatibility). */
  setLatestSelectedCheckId?: (checkId: string) => void;
}
interface CheckProviderProps {
  children: ReactNode;
  checks?: Check[];
  isLoading?: boolean;
  error?: string;
  selectedCheckId?: string;
  onSelectCheck?: (checkId: string) => void;
  onCreateCheck?: (check: Partial<Check>) => Promise<Check>;
  onUpdateCheck?: (checkId: string, updates: Partial<Check>) => Promise<Check>;
  onDeleteCheck?: (checkId: string) => Promise<void>;
  onReorderChecks?: (sourceIndex: number, destIndex: number) => Promise<void>;
  refetchChecks?: () => void;
  /** @remarks Alias of selectedCheckId (OSS backward compatibility). */
  latestSelectedCheckId?: string;
  /** @remarks Alias of onSelectCheck (OSS backward compatibility). */
  setLatestSelectedCheckId?: (checkId: string) => void;
}
declare function CheckProvider({
  children,
  checks,
  isLoading,
  error,
  selectedCheckId,
  onSelectCheck,
  onCreateCheck,
  onUpdateCheck,
  onDeleteCheck,
  onReorderChecks,
  refetchChecks,
  latestSelectedCheckId,
  setLatestSelectedCheckId
}: CheckProviderProps): react_jsx_runtime43.JSX.Element;
declare function useCheckContext(): CheckContextType;
//#endregion
//#region src/providers/contexts/QueryContext.d.ts
interface QueryResult {
  columns: string[];
  data: Record<string, unknown>[];
  rowCount: number;
}
interface QueryContextType {
  sql: string;
  isExecuting: boolean;
  error?: string;
  baseResult?: QueryResult;
  currentResult?: QueryResult;
  onSqlChange?: (sql: string) => void;
  onExecute?: (sql: string) => Promise<void>;
  onCancel?: () => void;
  /** @remarks Alias of sql (OSS backward compatibility). */
  sqlQuery?: string;
  /** @remarks Alias of onSqlChange (OSS backward compatibility). */
  setSqlQuery?: (sql: string) => void;
  /** Primary key columns for diff matching */
  primaryKeys?: string[];
  /** Setter for primary keys */
  setPrimaryKeys?: (pks: string[] | undefined) => void;
  /** Whether using custom SQL queries vs model-generated */
  isCustomQueries?: boolean;
  /** Setter for isCustomQueries */
  setCustomQueries?: (isCustom: boolean) => void;
  /** Base SQL query for diff comparison */
  baseSqlQuery?: string;
  /** Setter for base SQL query */
  setBaseSqlQuery?: (sql: string) => void;
}
interface QueryProviderProps {
  children: ReactNode;
  sql?: string;
  isExecuting?: boolean;
  error?: string;
  baseResult?: QueryResult;
  currentResult?: QueryResult;
  onSqlChange?: (sql: string) => void;
  onExecute?: (sql: string) => Promise<void>;
  onCancel?: () => void;
  sqlQuery?: string;
  setSqlQuery?: (sql: string) => void;
  primaryKeys?: string[];
  setPrimaryKeys?: (pks: string[] | undefined) => void;
  isCustomQueries?: boolean;
  setCustomQueries?: (isCustom: boolean) => void;
  baseSqlQuery?: string;
  setBaseSqlQuery?: (sql: string) => void;
}
declare function QueryProvider({
  children,
  sql,
  isExecuting,
  error,
  baseResult,
  currentResult,
  onSqlChange,
  onExecute,
  onCancel,
  sqlQuery,
  setSqlQuery,
  primaryKeys,
  setPrimaryKeys,
  isCustomQueries,
  setCustomQueries,
  baseSqlQuery,
  setBaseSqlQuery
}: QueryProviderProps): react_jsx_runtime43.JSX.Element;
declare function useQueryContext(): QueryContextType;
//#endregion
//#region src/providers/contexts/RoutingContext.d.ts
/**
 * Navigation options for route changes
 */
interface NavigateOptions {
  /** Replace current history entry instead of pushing */
  replace?: boolean;
  /** Scroll to top after navigation (default: true) */
  scroll?: boolean;
}
/**
 * Configuration for the routing provider
 */
interface RoutingConfig {
  /** Base path prefix for all routes */
  basePath?: string;
  /**
   * Current pathname (provided by consumer's router)
   * If not provided, defaults to empty string
   */
  pathname?: string;
  /**
   * Navigation handler (provided by consumer's router)
   * Called when components need to navigate programmatically
   *
   * @example
   * ```tsx
   * // Next.js App Router
   * const router = useRouter();
   * <RecceProvider
   *   routing={{
   *     pathname: usePathname(),
   *     onNavigate: (path, options) => {
   *       options?.replace ? router.replace(path) : router.push(path);
   *     }
   *   }}
   * />
   * ```
   */
  onNavigate?: (path: string, options?: NavigateOptions) => void;
}
/**
 * Routing context value available to consumers
 */
interface RoutingContextValue {
  /** Base path prefix */
  basePath: string;
  /** Build a full path with base path prefix */
  buildPath: (path: string) => string;
  /** Current pathname (if provided by consumer) */
  pathname: string;
  /** Navigate to a path */
  navigate: (path: string, options?: NavigateOptions) => void;
}
/**
 * Hook to access routing context
 *
 * @returns Routing context with path utilities and navigation
 *
 * @example
 * ```tsx
 * function MyComponent() {
 *   const { pathname, navigate, buildPath } = useRouting();
 *
 *   return (
 *     <button onClick={() => navigate(buildPath('/checks'))}>
 *       Go to Checks
 *     </button>
 *   );
 * }
 * ```
 */
declare function useRouting(): RoutingContextValue;
/**
 * Hook compatible with useAppLocation API
 *
 * Returns a tuple of [pathname, setLocation] for easy migration from
 * the OSS useAppLocation hook.
 *
 * @returns [pathname, navigate] tuple
 *
 * @example
 * ```tsx
 * const [location, setLocation] = useAppLocation();
 * setLocation('/checks?id=123');
 * setLocation('/checks', { replace: true });
 * ```
 */
declare function useAppLocation(): [string, (path: string, options?: NavigateOptions) => void];
//#endregion
//#region src/providers/RecceProvider.d.ts
/**
 * Theme mode selection for RecceProvider.
 */
type ThemeMode = "light" | "dark" | "system";
/**
 * Props for {@link RecceProvider}.
 */
interface RecceProviderProps {
  children: ReactNode;
  /**
   * API configuration - simple config OR custom client.
   */
  api: {
    baseUrl: string;
    headers?: Record<string, string>;
    timeout?: number;
  } | {
    client: AxiosInstance;
  };
  /**
   * Theme mode.
   *
   * @defaultValue "system"
   */
  theme?: ThemeMode;
  /**
   * Routing configuration
   *
   * @example
   * ```tsx
   * // With Next.js App Router
   * const router = useRouter();
   * const pathname = usePathname();
   *
   * <RecceProvider
   *   routing={{
   *     basePath: '/app',
   *     pathname,
   *     onNavigate: (path, options) => {
   *       options?.replace ? router.replace(path) : router.push(path);
   *     }
   *   }}
   * />
   * ```
   */
  routing?: {
    basePath?: string;
    pathname?: string;
    onNavigate?: (path: string, options?: {
      replace?: boolean;
      scroll?: boolean;
    }) => void;
  };
  /**
   * TanStack Query client configuration.
   */
  queryClient?: {
    staleTime?: number;
    gcTime?: number;
  };
  /**
   * Run action configuration
   * Props for RecceActionProvider - manages run execution and result display
   */
  runActions?: {
    /** Handler called when a run action is requested */
    onRunAction?: RecceActionProviderProps["onRunAction"];
    /** Handler called when a run result should be shown */
    onShowRunId?: RecceActionProviderProps["onShowRunId"];
    /** Initial run ID to display */
    initialRunId?: string;
    /** Initial state for history panel */
    initialHistoryOpen?: boolean;
  };
  /**
   * Lineage graph configuration
   * Props for LineageGraphProvider - manages lineage visualization
   */
  lineage?: {
    /** The processed lineage graph data */
    lineageGraph?: LineageGraphProviderProps["lineageGraph"];
    /** Environment information (git, dbt, sqlmesh metadata) */
    envInfo?: LineageGraphProviderProps["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?: LineageGraphProviderProps["runsAggregated"];
    /** Callback to refetch aggregated runs */
    onRefetchRunsAggregated?: () => void;
  };
  /**
   * Check management configuration
   * Props for CheckProvider - manages check CRUD operations
   */
  checks?: {
    /** List of checks */
    checks?: Check[];
    /** Loading state */
    isLoading?: boolean;
    /** Error message */
    error?: string;
    /** Currently selected check ID */
    selectedCheckId?: string;
    /** Handler for check selection */
    onSelectCheck?: CheckProviderProps["onSelectCheck"];
    /** Handler for check creation */
    onCreateCheck?: CheckProviderProps["onCreateCheck"];
    /** Handler for check updates */
    onUpdateCheck?: CheckProviderProps["onUpdateCheck"];
    /** Handler for check deletion */
    onDeleteCheck?: CheckProviderProps["onDeleteCheck"];
    /** Handler for check reordering */
    onReorderChecks?: CheckProviderProps["onReorderChecks"];
    /** Callback to refetch checks */
    refetchChecks?: () => void;
  };
  /**
   * Query editor configuration
   * Props for QueryProvider - manages SQL query execution
   */
  query?: {
    /** Current SQL query */
    sql?: string;
    /** Whether query is executing */
    isExecuting?: boolean;
    /** Error message */
    error?: string;
    /** Query result for base environment */
    baseResult?: QueryResult;
    /** Query result for current environment */
    currentResult?: QueryResult;
    /** Handler for SQL changes */
    onSqlChange?: QueryProviderProps["onSqlChange"];
    /** Handler for query execution */
    onExecute?: QueryProviderProps["onExecute"];
    /** Handler for query cancellation */
    onCancel?: QueryProviderProps["onCancel"];
  };
  /**
   * Feature flags - control which contexts are enabled
   * Set to false to skip a context entirely (reduces overhead if unused)
   */
  features?: {
    /** Enable RecceInstanceInfoProvider (instance info and feature toggles) */
    enableInstance?: boolean;
    /** Enable IdleTimeoutProvider (session timeout and keep-alive) */
    enableIdleTimeout?: boolean;
    /** Enable LineageGraphProvider (lineage visualization) */
    enableLineage?: boolean;
    /** Enable RecceActionProvider (run execution) */
    enableRunActions?: boolean;
    /** Enable CheckProvider (check management) */
    enableChecks?: boolean;
    /** Enable QueryProvider (SQL query editor) */
    enableQuery?: boolean;
  };
}
/**
 * RecceProvider - The single entry point for @datarecce/ui
 *
 * This provider orchestrates ALL Recce contexts in the correct order.
 * It follows a props-driven design - pass your data and callbacks, no internal fetching.
 *
 * **Architecture:**
 * - Foundation layer: QueryClient → API → Theme → Routing
 * - Data layer: Instance → Idle → Lineage → RunActions
 * - UI layer: Checks → Query
 *
 * **Feature Flags:**
 * Use `features` prop to disable unused contexts and reduce overhead.
 *
 * @example
 * ```tsx
 * // Minimal setup (only API + Theme)
 * <RecceProvider api={{ baseUrl: "/api" }}>
 *   <MyApp />
 * </RecceProvider>
 *
 * // Full setup with all features
 * <RecceProvider
 *   api={{ baseUrl: "/api" }}
 *   theme="dark"
 *   lineage={{
 *     lineageGraph: data.lineageGraph,
 *     envInfo: data.envInfo,
 *     onRefetchLineageGraph: refetch,
 *   }}
 *   runActions={{
 *     onRunAction: handleRunAction,
 *     onShowRunId: handleShowRun,
 *   }}
 *   checks={{
 *     checks: checksData,
 *     onCreateCheck: createCheck,
 *     onUpdateCheck: updateCheck,
 *   }}
 *   features={{
 *     enableLineage: true,
 *     enableRunActions: true,
 *     enableChecks: true,
 *   }}
 * >
 *   <MyApp />
 * </RecceProvider>
 * ```
 */
declare function RecceProvider({
  children,
  api,
  theme,
  routing,
  queryClient: queryClientConfig,
  runActions,
  lineage,
  checks,
  query,
  features
}: RecceProviderProps): react27.ReactElement<unknown, string | react27.JSXElementConstructor<any>>;
//#endregion
//#region src/types/index.d.ts
declare const TYPES_API_VERSION = "0.1.0";
//#endregion
export { CheckProviderProps as _, RoutingConfig as a, useRouting as c, QueryProviderProps as d, QueryResult as f, CheckProvider as g, CheckContextType as h, NavigateOptions as i, QueryContextType as l, Check as m, RecceProvider as n, RoutingContextValue as o, useQueryContext as p, RecceProviderProps as r, useAppLocation as s, TYPES_API_VERSION as t, QueryProvider as u, useCheckContext as v };
//# sourceMappingURL=index-ZQVNLsef.d.ts.map