import * as _tanstack_react_query from '@tanstack/react-query';
import { AxiosInstance, AxiosResponse } from 'axios';
import React__default, { ReactNode, CSSProperties, Ref, ForwardRefExoticComponent, RefAttributes, ComponentType } from 'react';
import { IconType } from 'react-icons';
import * as react_jsx_runtime from 'react/jsx-runtime';
import { GridReadyEvent, ColDef, ColGroupDef } from 'ag-grid-community';
import { AgGridReactProps } from 'ag-grid-react';

/**
 * The data from the API
 */
interface NodeColumnData {
    name: string;
    type: string;
    transformation_type?: string;
    change_status?: "added" | "removed" | "modified";
    not_null?: boolean;
    unique?: boolean;
}
interface NodeData {
    id: string;
    unique_id: string;
    name: string;
    schema?: string;
    checksum?: {
        name: string;
        checksum: string;
    };
    raw_code?: string;
    resource_type?: string;
    package_name?: string;
    columns?: Record<string, NodeColumnData | undefined>;
    primary_key?: string;
}
interface ArtifactMetadata {
    dbt_version: string;
    dbt_schema_version: string;
    generated_at: string;
    adapter_type: string;
    env: Record<string, string>;
    invocation_id: string;
}
interface ManifestMetadata extends ArtifactMetadata {
    project_id?: string;
    project_name?: string;
    user_id?: string;
}
interface SQLMeshInfo {
    base_env: string;
    current_env: string;
}
type CatalogMetadata = ArtifactMetadata;
interface LineageData {
    metadata: {
        pr_url: string;
        git_branch?: string;
    };
    nodes: Record<string, NodeData>;
    parent_map: Record<string, string[]>;
    manifest_metadata?: ManifestMetadata | null;
    catalog_metadata?: CatalogMetadata | null;
}
interface LineageDataFromMetadata extends Omit<LineageData, "nodes"> {
    nodes: Record<string, NodeData | undefined>;
}
type LineageDiffData = Record<string, {
    change_status: "added" | "removed" | "modified";
    change: {
        category: "breaking" | "non_breaking" | "partial_breaking" | "unknown";
        columns: Record<string, "added" | "removed" | "modified"> | null;
    } | null;
}>;
interface LineageOutput {
    error?: string;
    data?: LineageData;
}
declare function getLineage(base?: boolean): Promise<LineageData>;
declare function getLineageWithError(base?: boolean): Promise<LineageOutput>;
interface LineageDiffResult {
    base?: LineageData;
    current?: LineageData;
    base_error?: string;
    current_error?: string;
}
declare function getLineageDiff(): Promise<LineageDiffResult>;
interface stateMetadata {
    schema_version: string;
    recce_version: string;
    generated_at: string;
}
interface gitInfo {
    branch?: string;
}
interface pullRequestInfo {
    id?: string | number;
    title?: string;
    url?: string;
    branch?: string;
    base_branch?: string;
}
interface ServerInfoResult {
    state_metadata: stateMetadata;
    adapter_type: string;
    review_mode: boolean;
    cloud_mode: boolean;
    file_mode: boolean;
    filename?: string;
    git?: gitInfo;
    pull_request?: pullRequestInfo;
    sqlmesh?: SQLMeshInfo;
    lineage: {
        base: LineageData;
        current: LineageData;
        diff: LineageDiffData;
    };
    demo: boolean;
    codespace: boolean;
    support_tasks: Record<string, boolean>;
}
declare function getServerInfo(client?: AxiosInstance): Promise<ServerInfoResult>;
interface ModelInfoResult {
    model: {
        base: {
            columns?: Record<string, NodeColumnData>;
            primary_key?: string;
        };
        current: {
            columns?: Record<string, NodeColumnData>;
            primary_key?: string;
        };
    };
}
declare function getModelInfo(model: string): Promise<ModelInfoResult>;

interface CllInput {
    node_id?: string;
    column?: string;
    change_analysis?: boolean;
    no_cll?: boolean;
    no_upstream?: boolean;
    no_downstream?: boolean;
}
interface ImpactRadiusParams {
    node_id: string;
}
interface CllNodeData {
    id: string;
    name: string;
    source_name: string;
    resource_type: string;
    raw_code?: string;
    change_status?: "added" | "removed" | "modified";
    change_category?: "breaking" | "non_breaking" | "partial_breaking" | "unknown";
    impacted?: boolean;
    columns?: Record<string, NodeColumnData>;
}
interface ColumnLineageData {
    current: {
        nodes: Record<string, CllNodeData>;
        columns: Record<string, NodeColumnData>;
        parent_map: Record<string, Set<string>>;
        child_map: Record<string, Set<string>>;
    };
}
declare function getCll(input: CllInput): Promise<ColumnLineageData>;

interface SubmitRunTrackProps {
    breaking_change_analysis?: boolean;
    source?: "lineage_model_node" | "lineage_column_node";
    [key: string]: unknown;
}
interface SubmitOptions {
    nowait?: boolean;
    trackProps?: SubmitRunTrackProps;
}
declare function submitRun(type: RunType, params?: RunParamTypes, options?: SubmitOptions): Promise<Run | Pick<Run, "run_id">>;
declare function getRun(runId: string): Promise<Run>;
declare function waitRun(runId: string, timeout?: number): Promise<Run>;
declare function cancelRun(runId: string): Promise<AxiosResponse<never, any, {}>>;
declare function submitRunFromCheck(checkId: string, options?: SubmitOptions): Promise<Run | Pick<Run, "run_id">>;
declare function searchRuns(type: string, params?: AxiosQueryParams, limit?: number): Promise<Run[]>;
declare function listRuns(): Promise<Run[]>;
type RunsAggregated = Record<string, Record<"row_count_diff" | "value_diff" | "row_count", {
    run_id: string;
    result: unknown;
}>>;
declare function aggregateRuns(client?: AxiosInstance): Promise<RunsAggregated>;

interface QueryParams extends QueryRunParams, QueryDiffParams, QueryPreviewChangeParams {
}
interface QueryPreviewChangeParams {
    current_model?: string;
    sql_template: string;
    primary_keys?: string[];
}
interface QueryRunParams {
    sql_template: string;
}
interface QueryViewOptions {
    pinned_columns?: string[];
    columnsRenderMode?: Record<string, ColumnRenderMode>;
}
type QueryResult = DataFrame;
interface QueryDiffParams {
    sql_template: string;
    base_sql_template?: string;
    primary_keys?: string[];
}
interface QueryDiffResult {
    base?: DataFrame;
    current?: DataFrame;
    diff?: DataFrame;
}
interface QueryDiffViewOptions {
    changed_only?: boolean;
    primary_keys?: string[];
    pinned_columns?: string[];
    display_mode?: "inline" | "side_by_side";
    columnsRenderMode?: Record<string, ColumnRenderMode>;
}
declare function submitQuery(params: QueryRunParams, options?: SubmitOptions): Promise<Run | Pick<Run, "run_id">>;
declare function submitQueryBase(params: QueryRunParams, options?: SubmitOptions): Promise<Run | Pick<Run, "run_id">>;
declare function submitQueryDiff(params: QueryDiffParams, options?: SubmitOptions): Promise<Run | Pick<Run, "run_id">>;

interface ProfileDiffParams {
    model: string;
    columns?: string[];
}
interface ProfileDiffResult {
    base?: DataFrame;
    current?: DataFrame;
}
interface ProfileDiffViewOptions {
    pinned_columns?: string[];
    display_mode?: "side_by_side" | "inline";
    columnsRenderMode?: Record<string, ColumnRenderMode>;
}
declare function submitProfileDiff(params: ProfileDiffParams, options?: SubmitOptions): Promise<Run | Pick<Run, "run_id">>;
interface TopKDiffParams {
    model: string;
    column_name: string;
    k: number;
}
interface TopKResult {
    values: (string | number | undefined)[];
    counts: number[];
    valids: number;
}
interface TopKDiffResult {
    base: TopKResult;
    current: TopKResult;
}
interface HistogramDiffParams {
    model: string;
    column_name: string;
    column_type: string;
}
interface HistogramResult {
    counts: number[];
    total: number;
}
interface HistogramDiffResult {
    base: HistogramResult;
    current: HistogramResult;
    min: number;
    max: number;
    bin_edges: number[];
    labels?: string[];
}

interface RowCount {
    name?: string;
    curr: number | null;
}
interface RowCountDiff {
    name?: string;
    base: number | null;
    curr: number | null;
}
interface QueryRowCountResult {
    runId: string;
    result: RowCountDiffResult;
}
declare function fetchModelRowCount(modelName: string): Promise<RowCountDiff>;
declare function queryModelRowCount(modelName: string): Promise<RowCountDiff>;
declare function queryRowCount(modelNames: string[]): Promise<QueryRowCountResult>;

interface RowCountParams {
    node_names: string[];
}
type RowCountResult = Record<string, RowCount>;
interface RowCountDiffParams {
    node_names: string[];
}
type RowCountDiffResult = Record<string, RowCountDiff>;
declare function submitRowCountDiff(params: RowCountDiffParams, options?: SubmitOptions): Promise<Run | Pick<Run, "run_id">>;

interface ValueDiffResult {
    summary: {
        total: number;
        added: number;
        removed: number;
    };
    data: DataFrame;
}
interface ValueDiffParams {
    model: string;
    primary_key: string | string[];
    columns?: string[];
}
declare function submitValueDiff(params: ValueDiffParams, options?: SubmitOptions): Promise<Run | Pick<Run, "run_id">>;
type ValueDiffDetailResult = DataFrame;
type ValueDiffDetailParams = ValueDiffParams;
interface ValueDiffDetailViewOptions {
    changed_only?: boolean;
    pinned_columns?: string[];
    display_mode?: "inline" | "side_by_side";
    columnsRenderMode?: Record<string, ColumnRenderMode>;
}
declare function submitValueDiffDetail(params: ValueDiffParams, options?: SubmitOptions): Promise<Run | Pick<Run, "run_id">>;

type AxiosQueryParams = Record<string, string | string[] | number | number[] | undefined>;
type RowDataTypes = number | string | boolean | null | undefined;
type RowData = RowDataTypes[];
type RowObjectType = Record<string, RowDataTypes> & {
    __status: "added" | "removed" | "modified" | undefined;
    _index?: number;
};
type ColumnType = "number" | "integer" | "text" | "boolean" | "date" | "datetime" | "timedelta" | "unknown";
type ColumnRenderMode = "raw" | "percent" | "delta" | 2;
interface DataFrame {
    columns: {
        key: string;
        name: string;
        type: ColumnType;
    }[];
    data: RowData[];
    limit?: number;
    more?: boolean;
}

interface SchemaDiffParams {
    node_id?: string | string[];
    select?: string;
    exclude?: string;
    packages?: string[];
    view_mode?: "all" | "changed_models";
}
interface LineageDiffParams {
    select?: string;
    exclude?: string;
    packages?: string[];
    view_mode?: "all" | "changed_models";
}
type RunParamTypes = QueryRunParams | QueryDiffParams | ValueDiffParams | SchemaDiffParams | ProfileDiffParams | RowCountParams | RowCountDiffParams | LineageDiffParams | TopKDiffParams | HistogramDiffParams | undefined;
interface BaseRun {
    type: RunType;
    run_id: string;
    run_at: string;
    name?: string;
    check_id?: string;
    progress?: {
        message?: string;
        percentage?: number;
    };
    error?: string;
    status?: "finished" | "failed" | "cancelled" | "running";
}
type Run = (BaseRun & {
    type: "simple";
    params?: undefined;
    result?: undefined;
}) | (BaseRun & {
    type: "sandbox";
    params?: undefined;
    result?: undefined;
}) | (BaseRun & {
    type: "query";
    params?: QueryRunParams;
    result?: QueryResult;
}) | (BaseRun & {
    type: "query_base";
    params?: QueryRunParams;
    result?: QueryResult;
}) | (BaseRun & {
    type: "query_diff";
    params?: QueryDiffParams;
    result?: QueryDiffResult;
}) | (BaseRun & {
    type: "value_diff";
    params?: ValueDiffParams;
    result?: ValueDiffResult;
}) | (BaseRun & {
    type: "value_diff_detail";
    params?: ValueDiffDetailParams;
    result?: ValueDiffDetailResult;
}) | (BaseRun & {
    type: "schema_diff";
    params?: SchemaDiffParams;
    result?: undefined;
}) | (BaseRun & {
    type: "profile";
    params?: ProfileDiffParams;
    result?: ProfileDiffResult;
}) | (BaseRun & {
    type: "profile_diff";
    params?: ProfileDiffParams;
    result?: ProfileDiffResult;
}) | (BaseRun & {
    type: "row_count";
    params?: RowCountParams;
    result?: RowCountResult;
}) | (BaseRun & {
    type: "row_count_diff";
    params?: RowCountDiffParams;
    result?: RowCountDiffResult;
}) | (BaseRun & {
    type: "lineage_diff";
    params?: LineageDiffParams;
    result?: LineageDiffResult;
}) | (BaseRun & {
    type: "top_k_diff";
    params?: TopKDiffParams;
    result?: TopKDiffResult;
}) | (BaseRun & {
    type: "histogram_diff";
    params?: HistogramDiffParams;
    result?: HistogramDiffResult;
});
declare function isSimpleRun(run: Run): run is Extract<Run, {
    type: "simple";
}>;
declare function isQueryRun(run: Run): run is Extract<Run, {
    type: "query";
}>;
declare function isQueryBaseRun(run: Run): run is Extract<Run, {
    type: "query_base";
}>;
declare function isQueryDiffRun(run: Run): run is Extract<Run, {
    type: "query_diff";
}>;
declare function isValueDiffRun(run: Run): run is Extract<Run, {
    type: "value_diff";
}>;
declare function isValueDiffDetailRun(run: Run): run is Extract<Run, {
    type: "value_diff_detail";
}>;
declare function isSchemaDiffRun(run: Run): run is Extract<Run, {
    type: "schema_diff";
}>;
declare function isProfileRun(run: Run): run is Extract<Run, {
    type: "profile";
}>;
declare function isProfileDiffRun(run: Run): run is Extract<Run, {
    type: "profile_diff";
}>;
declare function isRowCountRun(run: Run): run is Extract<Run, {
    type: "row_count";
}>;
declare function isRowCountDiffRun(run: Run): run is Extract<Run, {
    type: "row_count_diff";
}>;
declare function isLineageDiffRun(run: Run): run is Extract<Run, {
    type: "lineage_diff";
}>;
declare function isTopKDiffRun(run: Run): run is Extract<Run, {
    type: "top_k_diff";
}>;
declare function isHistogramDiffRun(run: Run): run is Extract<Run, {
    type: "histogram_diff";
}>;

interface RunFormProps<PT> {
    params: Partial<PT>;
    onParamsChanged: (params: Partial<PT>) => void;
    setIsReadyToExecute: (isReadyToExecute: boolean) => void;
}
interface RunResultViewProps<VO = ViewOptionTypes> {
    run: Run;
    viewOptions?: VO;
    onViewOptionsChanged?: (viewOptions: VO) => void;
}

interface DiffViewOptions {
    changed_only?: boolean;
}
interface RunToolbarProps<VO> extends RunResultViewProps<VO> {
    warnings?: string[];
    children?: ReactNode;
}
declare const RunToolbar: ({ warnings, children, }: RunToolbarProps<DiffViewOptions>) => react_jsx_runtime.JSX.Element;

/**
 * Handle type for accessing AG Grid API and DOM element (for screenshots)
 */
interface DataGridHandle {
    api: GridReadyEvent["api"] | null;
    /** DOM element for screenshot functionality */
    element: HTMLElement | null;
}
/**
 * Props for ScreenshotDataGrid component
 *
 * Supports both new AG Grid style props (columnDefs/rowData) and
 * legacy react-data-grid style props (columns/rows) for backward compatibility
 */
interface ScreenshotDataGridProps<TData = RowObjectType> extends Omit<AgGridReactProps<TData>, "theme" | "rowClass"> {
    /** Container style */
    style?: CSSProperties;
    /** Additional CSS class for container */
    className?: string;
    /** Empty state renderer (legacy) */
    renderers?: {
        noRowsFallback?: React__default.ReactNode;
    };
    /** Legacy: Column definitions (maps to columnDefs) */
    columns?: (ColDef<TData> | ColGroupDef<TData>)[];
    /** Legacy: Row data (maps to rowData) */
    rows?: TData[];
    /** Legacy: Default column options (maps to defaultColDef) */
    defaultColumnOptions?: ColDef<TData>;
}
declare const ScreenshotDataGrid: <TData = RowObjectType>(props: ScreenshotDataGridProps<TData> & {
    ref?: Ref<DataGridHandle>;
}) => React__default.ReactNode;

interface ProfileDiffFormParams {
    model: string;
    primary_key?: string | (string | undefined)[];
    columns?: string[];
}
type ProfileDiffFormProp = RunFormProps<ProfileDiffFormParams>;
declare function ProfileDiffForm({ params, onParamsChanged, setIsReadyToExecute, }: ProfileDiffFormProp): react_jsx_runtime.JSX.Element;

interface ValueDiffFormParams {
    model: string;
    primary_key?: string | (string | undefined)[];
    columns?: string[];
}
type ValueDiffFormProp = RunFormProps<ValueDiffFormParams>;
declare function ValueDiffForm({ params, onParamsChanged, setIsReadyToExecute, }: ValueDiffFormProp): react_jsx_runtime.JSX.Element;

type ViewOptionTypes = LineageDiffViewOptions | DiffViewOptions | QueryViewOptions | QueryDiffViewOptions | ProfileDiffViewOptions | ValueDiffDetailViewOptions;
type RunType = "simple" | "query" | "query_base" | "query_diff" | "value_diff" | "value_diff_detail" | "schema_diff" | "profile" | "profile_diff" | "row_count" | "row_count_diff" | "lineage_diff" | "top_k_diff" | "histogram_diff" | "sandbox";
type RefTypes = React__default.Ref<DataGridHandle> | React__default.Ref<HTMLDivElement>;
type RunFormParamTypes = ProfileDiffFormParams | ValueDiffFormParams | TopKDiffParams | HistogramDiffParams | AxiosQueryParams;
interface RegistryEntry<PT = RefTypes, VO = ViewOptionTypes> {
    title: string;
    icon: IconType;
    RunResultView?: ForwardRefExoticComponent<RunResultViewProps<VO> & RefAttributes<PT>>;
    RunForm?: ComponentType<RunFormProps<RunFormParamTypes>>;
}

interface Check<PT = unknown, VO = unknown> {
    check_id: string;
    name: string;
    description?: string;
    type: RunType;
    params?: PT;
    view_options?: VO;
    is_checked?: boolean;
    is_preset?: boolean;
    last_run?: Run;
}
interface CreateCheckBody {
    name?: string;
    description?: string;
    run_id?: string;
    type?: RunType;
    params?: Record<string, string | boolean>;
    view_options?: Record<string, string | boolean>;
    track_props?: Record<string, string | boolean>;
}
declare function createSimpleCheck(): Promise<Check>;
declare function createCheckByRun(runId: string, viewOptions?: Record<string, unknown>): Promise<Check>;
declare function listChecks(): Promise<Check[]>;
declare function useChecks(enabled: boolean): _tanstack_react_query.UseQueryResult<Check<unknown, unknown>[], Error>;
declare function getCheck(checkId: string): Promise<Check<RunParamTypes>>;
declare function updateCheck(checkId: string, payload: Partial<Check>): Promise<Check>;
declare function deleteCheck(checkId: string): Promise<Pick<Check<unknown, unknown>, "check_id">>;
declare function reorderChecks(order: {
    source: number;
    destination: number;
}): Promise<AxiosResponse<unknown, any, {}>>;
declare function markAsPresetCheck(checkId: string): Promise<void>;

interface LineageDiffViewOptions {
    view_mode?: "changed_models" | "all";
    node_ids?: string[];
    packages?: string[];
    select?: string;
    exclude?: string;
    column_level_lineage?: CllInput;
}
declare function createLineageDiffCheck(viewOptions: LineageDiffViewOptions): Promise<Check>;

export { type RowCountDiff as $, type CatalogMetadata as A, type LineageDataFromMetadata as B, type Check as C, type LineageDiffData as D, getLineage as E, getLineageWithError as F, type LineageDiffResult as G, getLineageDiff as H, type ImpactRadiusParams as I, type stateMetadata as J, type gitInfo as K, type LineageData as L, type ManifestMetadata as M, type NodeColumnData as N, type pullRequestInfo as O, ProfileDiffForm as P, type QueryParams as Q, RunToolbar as R, ScreenshotDataGrid as S, type ServerInfoResult as T, getServerInfo as U, ValueDiffForm as V, type ModelInfoResult as W, getModelInfo as X, type LineageDiffViewOptions as Y, createLineageDiffCheck as Z, type RowCount as _, type QueryPreviewChangeParams as a, type RunResultViewProps as a$, type QueryRowCountResult as a0, fetchModelRowCount as a1, queryModelRowCount as a2, queryRowCount as a3, type ProfileDiffParams as a4, type ProfileDiffResult as a5, type ProfileDiffViewOptions as a6, submitProfileDiff as a7, type TopKDiffParams as a8, type TopKResult as a9, submitValueDiffDetail as aA, type AxiosQueryParams as aB, type RowDataTypes as aC, type RowData as aD, type RowObjectType as aE, type ColumnType as aF, type ColumnRenderMode as aG, type DataFrame as aH, type SchemaDiffParams as aI, type LineageDiffParams as aJ, type RunParamTypes as aK, type Run as aL, isSimpleRun as aM, isQueryRun as aN, isQueryBaseRun as aO, isQueryDiffRun as aP, isValueDiffRun as aQ, isValueDiffDetailRun as aR, isSchemaDiffRun as aS, isProfileRun as aT, isProfileDiffRun as aU, isRowCountRun as aV, isRowCountDiffRun as aW, isLineageDiffRun as aX, isTopKDiffRun as aY, isHistogramDiffRun as aZ, type RunFormProps as a_, type TopKDiffResult as aa, type HistogramDiffParams as ab, type HistogramResult as ac, type HistogramDiffResult as ad, type RowCountParams as ae, type RowCountResult as af, type RowCountDiffParams as ag, type RowCountDiffResult as ah, submitRowCountDiff as ai, type SubmitRunTrackProps as aj, type SubmitOptions as ak, submitRun as al, getRun as am, waitRun as an, cancelRun as ao, submitRunFromCheck as ap, searchRuns as aq, listRuns as ar, type RunsAggregated as as, aggregateRuns as at, type ValueDiffResult as au, type ValueDiffParams as av, submitValueDiff as aw, type ValueDiffDetailResult as ax, type ValueDiffDetailParams as ay, type ValueDiffDetailViewOptions as az, type QueryRunParams as b, type DataGridHandle as b0, type ViewOptionTypes as b1, type RegistryEntry as b2, type RefTypes as b3, type RunType as b4, type RunFormParamTypes as b5, type QueryViewOptions as c, type QueryResult as d, type QueryDiffParams as e, type QueryDiffResult as f, type QueryDiffViewOptions as g, submitQueryBase as h, submitQueryDiff as i, type CreateCheckBody as j, createSimpleCheck as k, createCheckByRun as l, listChecks as m, getCheck as n, updateCheck as o, deleteCheck as p, markAsPresetCheck as q, reorderChecks as r, submitQuery as s, type CllInput as t, useChecks as u, type CllNodeData as v, type ColumnLineageData as w, getCll as x, type NodeData as y, type SQLMeshInfo as z };
