import * as _tanstack_react_query from '@tanstack/react-query';
import { d as LineageGraph } from './LineageViewContext-DPVC8ak8.js';
export { u as useLineageViewContext } from './LineageViewContext-DPVC8ak8.js';
import * as react_jsx_runtime from 'react/jsx-runtime';
import React__default, { Dispatch, SetStateAction, ReactNode } from 'react';
import { J as stateMetadata, K as gitInfo, O as pullRequestInfo, M as ManifestMetadata, z as SQLMeshInfo, as as RunsAggregated, b4 as RunType, aB as AxiosQueryParams, aj as SubmitRunTrackProps } from './lineagecheck-BQaKAQzn.js';
import { AxiosInstance } from 'axios';
import '@xyflow/react';
import 'react-icons';
import 'ag-grid-community';
import 'ag-grid-react';

interface RecceInstanceInfo {
    server_mode: "server" | "preview" | "read-only";
    single_env: boolean;
    authed: boolean;
    cloud_instance: boolean;
    lifetime_expired_at?: Date;
    idle_timeout?: number;
    share_url?: string;
    session_id?: string;
    organization_name?: string;
    web_url?: string;
}

declare const useRecceInstanceInfo: () => _tanstack_react_query.UseQueryResult<RecceInstanceInfo, Error>;

declare function useCheckToast(): {
    markedAsApprovedToast: () => void;
};

declare function useClipBoardToast(): {
    successToast: (message: string) => void;
    failToast: (title: string, error: unknown) => void;
};

declare function useValueDiffAlertDialog(): {
    confirm: (nodeCount: number) => Promise<boolean>;
    AlertDialog: react_jsx_runtime.JSX.Element;
};

interface RecceContextProps {
    children: React__default.ReactNode;
}
/**
 * Main context provider for Recce application.
 *
 * For custom API configuration (e.g., recce-cloud), wrap this provider
 * with ApiConfigProvider:
 *
 * ```tsx
 * <ApiConfigProvider
 *   apiPrefix="/api/v2/sessions/abc123"
 *   authToken="eyJ..."
 * >
 *   <RecceContextProvider>
 *     {children}
 *   </RecceContextProvider>
 * </ApiConfigProvider>
 * ```
 *
 * When used without ApiConfigProvider (OSS mode), hooks will use
 * the default axios client with standard /api/* endpoints.
 */
declare function RecceContextProvider({ children }: RecceContextProps): react_jsx_runtime.JSX.Element;

type RecceFeatureMode = "read only" | "metadata only" | null;
interface RecceFeatureToggles {
    mode: RecceFeatureMode;
    disableSaveToFile: boolean;
    disableExportStateFile: boolean;
    disableImportStateFile: boolean;
    disableUpdateChecklist: boolean;
    disableDatabaseQuery: boolean;
    disableViewActionDropdown: boolean;
    disableNodeActionDropdown: boolean;
    disableShare: boolean;
}
interface InstanceInfoType {
    singleEnv: boolean;
    authed: boolean;
    featureToggles: RecceFeatureToggles;
    lifetimeExpiredAt?: Date;
    shareUrl?: string;
    sessionId?: string;
}
declare function RecceInstanceInfoProvider({ children, }: {
    children: React.ReactNode;
}): react_jsx_runtime.JSX.Element;
declare const useRecceInstanceContext: () => InstanceInfoType;

interface EnvInfo {
    stateMetadata?: stateMetadata;
    adapterType?: string;
    git?: gitInfo;
    pullRequest?: pullRequestInfo;
    dbt?: {
        base: ManifestMetadata | undefined | null;
        current: ManifestMetadata | undefined | null;
    };
    sqlmesh?: SQLMeshInfo | null;
}
interface LineageGraphContextType {
    lineageGraph?: LineageGraph;
    envInfo?: EnvInfo;
    reviewMode?: boolean;
    cloudMode?: boolean;
    fileMode?: boolean;
    fileName?: string;
    isDemoSite: boolean;
    isCodespace?: boolean;
    isLoading?: boolean;
    error?: string;
    supportTasks?: Record<string, boolean>;
    retchLineageGraph?: () => void;
    isActionAvailable: (actionName: string) => boolean;
    runsAggregated?: RunsAggregated;
    refetchRunsAggregated?: () => void;
}
interface LineageGraphProps {
    children: React__default.ReactNode;
}
declare function LineageGraphContextProvider({ children }: LineageGraphProps): react_jsx_runtime.JSX.Element;
declare const useLineageGraphContext: () => LineageGraphContextType;
declare const useRunsAggregated: () => [RunsAggregated | undefined, () => void];

interface ShareStateProps {
    shareUrl?: string;
    isLoading: boolean;
    error?: string;
    handleShareClick: () => Promise<void>;
}
declare function RecceShareStateContextProvider({ children, }: {
    children: React__default.ReactNode;
}): react_jsx_runtime.JSX.Element;
declare const useRecceShareStateContext: () => ShareStateProps;

interface QueryContext {
    sqlQuery: string;
    setSqlQuery: (sqlQuery: string) => void;
    primaryKeys: string[] | undefined;
    setPrimaryKeys: (primaryKeys: string[] | undefined) => void;
    isCustomQueries: boolean;
    setCustomQueries: (isCustomQueries: boolean) => void;
    baseSqlQuery?: string;
    setBaseSqlQuery?: (baseSqlQuery: string) => void;
}
interface QueryContextProps {
    children: React__default.ReactNode;
}
declare function RecceQueryContextProvider({ children }: QueryContextProps): react_jsx_runtime.JSX.Element;
declare const useRecceQueryContext: () => QueryContext;
interface RowCountStateContext {
    isNodesFetching: string[];
    setIsNodesFetching: (nodes: string[]) => void;
}
interface RowCountStateContextProps {
    children: React__default.ReactNode;
}
declare function RowCountStateContextProvider({ children, }: RowCountStateContextProps): react_jsx_runtime.JSX.Element;
declare const useRowCountStateContext: () => RowCountStateContext;

interface RecceActionOptions {
    showForm: boolean;
    showLast?: boolean;
    trackProps?: SubmitRunTrackProps;
}
interface RecceActionContextType {
    runAction: (type: RunType, params?: AxiosQueryParams, actionOptions?: RecceActionOptions) => void;
    runId?: string;
    showRunId: (runId: string, refreshHistory?: boolean) => void;
    isRunResultOpen: boolean;
    closeRunResult: () => void;
    isHistoryOpen: boolean;
    closeHistory: () => void;
    showHistory: () => void;
    setHistoryOpen: Dispatch<SetStateAction<boolean>>;
    clearRunResult: () => void;
}
interface RecceActionContextProviderProps {
    children: React__default.ReactNode;
}
declare function RecceActionContextProvider({ children, }: RecceActionContextProviderProps): react_jsx_runtime.JSX.Element;
declare const useRecceActionContext: () => RecceActionContextType;

interface CheckContext {
    latestSelectedCheckId: string;
    setLatestSelectedCheckId: (selectCheckId: string) => void;
}
interface CheckContextProps {
    children: React__default.ReactNode;
}
declare function RecceCheckContextProvider({ children }: CheckContextProps): react_jsx_runtime.JSX.Element;
declare const useRecceCheckContext: () => CheckContext;

/**
 * Context for sharing idle timeout state across components
 *
 * IMPORTANT: The countdown is based on the last SUCCESSFUL keep-alive API call,
 * NOT on user activity. This ensures the countdown accurately reflects the
 * server's idle timeout state.
 */
interface IdleTimeoutContextType {
    /** Remaining seconds until timeout (null if idle timeout not enabled) */
    remainingSeconds: number | null;
    /** Idle timeout value from server in seconds (null if not configured) */
    idleTimeout: number | null;
    /** Whether idle timeout is enabled */
    isEnabled: boolean;
    /** Mark as disconnected - stops countdown and keep-alive */
    setDisconnected: () => void;
    /** Reset connection state - restarts countdown and keep-alive after successful reconnect */
    resetConnection: () => void;
    /** Whether the connection is disconnected */
    isDisconnected: boolean;
}
/**
 * Provider for idle timeout state
 *
 * The countdown is based on lastServerSyncTime (when keep-alive API was last
 * successfully sent), not on user activity. This provides accurate server state.
 */
declare function IdleTimeoutProvider({ children }: {
    children: ReactNode;
}): react_jsx_runtime.JSX.Element;
/**
 * Hook to access idle timeout context
 * @throws Error if used outside IdleTimeoutProvider
 */
declare function useIdleTimeout(): IdleTimeoutContextType;

/**
 * API Configuration Context
 *
 * Provides configurable API endpoint prefix and authentication token
 * for use with recce-cloud or other custom API backends.
 *
 * Default behavior (OSS):
 * - apiPrefix: "" (uses /api/* paths directly)
 * - authToken: undefined (no auth header)
 *
 * Cloud usage example:
 * - apiPrefix: "/api/v2/sessions/abc123" (replaces /api with this prefix)
 * - authToken: "eyJ..." (adds Authorization: Bearer header)
 */
interface ApiConfig {
    /**
     * API endpoint prefix to replace `/api` in all requests.
     * For OSS: "" (empty string, uses default /api/* paths)
     * For Cloud: "/api/v2/sessions/<session_id>" (replaces /api with this)
     */
    apiPrefix: string;
    /**
     * Optional authentication token for API requests.
     * When provided, adds "Authorization: Bearer <token>" header.
     */
    authToken?: string;
    /**
     * Optional base URL override.
     * When provided, overrides the PUBLIC_API_URL for this context.
     */
    baseUrl?: string;
}
interface ApiConfigContextType extends ApiConfig {
    /**
     * Pre-configured axios instance with interceptors for
     * API prefix replacement and auth token injection.
     */
    apiClient: AxiosInstance;
}
interface ApiConfigProviderProps extends Partial<ApiConfig> {
    children: React__default.ReactNode;
}
declare function ApiConfigProvider({ children, apiPrefix, authToken, baseUrl, }: ApiConfigProviderProps): react_jsx_runtime.JSX.Element;
/**
 * Hook to access the API configuration and configured axios client.
 *
 * When used outside ApiConfigProvider, returns default config with
 * standard axiosClient (for OSS backward compatibility).
 *
 * @returns ApiConfigContextType with apiPrefix, authToken, and apiClient
 */
declare function useApiConfig(): ApiConfigContextType;
/**
 * Hook to get the configured axios client.
 * Convenience wrapper around useApiConfig().apiClient
 *
 * @returns AxiosInstance configured with API prefix and auth token
 */
declare function useApiClient(): AxiosInstance;
/**
 * Safe version of useApiConfig that returns null if outside provider.
 * Useful for components that need to detect if ApiConfigProvider is present.
 */
declare function useApiConfigSafe(): ApiConfigContextType | null;

export { type ApiConfig, ApiConfigProvider, IdleTimeoutProvider, LineageGraphContextProvider, RecceActionContextProvider, RecceCheckContextProvider, RecceContextProvider, RecceInstanceInfoProvider, RecceQueryContextProvider, RecceShareStateContextProvider, RowCountStateContextProvider, useApiClient, useApiConfig, useApiConfigSafe, useCheckToast, useClipBoardToast, useIdleTimeout, useLineageGraphContext, useRecceActionContext, useRecceCheckContext, useRecceInstanceContext, useRecceInstanceInfo, useRecceQueryContext, useRecceShareStateContext, useRowCountStateContext, useRunsAggregated, useValueDiffAlertDialog };
