import { type DbtModelJoinType, type FieldSetDefinition, type LineageGraph, type SupportedDbtAdapter } from './dbt';
import { type CompiledDimension, type CompiledMetric, type Dimension, type Metric, type Source } from './field';
import { type LightdashProjectConfig } from './lightdashProjectConfig';
import { type ParametersValuesMap } from './parameters';
import { type PreAggregateDef } from './preAggregate';
import { type TableBase } from './table';
import { type TimeFrames } from './timeFrames';
export declare enum JoinRelationship {
    ONE_TO_MANY = "one-to-many",
    MANY_TO_ONE = "many-to-one",
    ONE_TO_ONE = "one-to-one",
    MANY_TO_MANY = "many-to-many"
}
export type ExploreJoin = {
    table: string;
    sqlOn: string;
    type?: DbtModelJoinType;
    alias?: string;
    label?: string;
    hidden?: boolean;
    fields?: string[];
    always?: boolean;
    relationship?: JoinRelationship;
    description?: string;
};
export type CompiledExploreJoin = Pick<ExploreJoin, 'table' | 'sqlOn' | 'type' | 'hidden' | 'always' | 'relationship'> & {
    compiledSqlOn: string;
    tablesReferences?: string[];
    parameterReferences?: string[];
};
export type CompiledTable = TableBase & {
    dimensions: Record<string, CompiledDimension>;
    metrics: Record<string, CompiledMetric>;
    lineageGraph: LineageGraph;
    source?: Source | undefined;
    uncompiledSqlWhere?: string;
    parameterReferences?: string[];
    parameters?: LightdashProjectConfig['parameters'];
    sets?: Record<string, FieldSetDefinition>;
};
export declare enum ExploreType {
    VIRTUAL = "virtual",
    DEFAULT = "default",
    PRE_AGGREGATE = "pre_aggregate"
}
export declare enum InlineErrorType {
    METADATA_PARSE_ERROR = "METADATA_PARSE_ERROR",
    NO_DIMENSIONS_FOUND = "NO_DIMENSIONS_FOUND",
    SKIPPED_JOIN = "SKIPPED_JOIN",
    MISSING_TABLE = "MISSING_TABLE",
    FIELD_ERROR = "FIELD_ERROR",
    SET_VALIDATION_ERROR = "SET_VALIDATION_ERROR",
    INVALID_PARAMETER = "INVALID_PARAMETER",
    DUPLICATE_FIELD_NAME = "DUPLICATE_FIELD_NAME",
    MISSING_WAREHOUSE_COLUMN = "MISSING_WAREHOUSE_COLUMN"
}
export type InlineError = {
    type: InlineErrorType;
    message: string;
};
export type PreAggregateSource = {
    sourceExploreName: string;
    preAggregateName: string;
};
export type Explore = {
    name: string;
    label: string;
    tags: string[];
    /** @deprecated Use `groups` instead */
    groupLabel?: string;
    /**
     * Nested groups for the sidebar (max 5 levels). Group keys resolve to
     * labels/descriptions via the project-level `table_groups` config
     * (fetched separately); missing keys fall back to using the key as
     * the label.
     */
    groups?: string[];
    baseTable: string;
    joinedTables: CompiledExploreJoin[];
    tables: {
        [tableName: string]: CompiledTable;
    };
    unfilteredTables?: {
        [tableName: string]: CompiledTable;
    };
    targetDatabase: SupportedDbtAdapter;
    warehouse?: string;
    databricksCompute?: string;
    ymlPath?: string;
    sqlPath?: string;
    type?: ExploreType;
    caseSensitive?: boolean;
    spotlight?: {
        visibility: LightdashProjectConfig['spotlight']['default_visibility'];
        categories?: string[];
        owner?: string;
    };
    aiHint?: string | string[];
    parameters?: LightdashProjectConfig['parameters'];
    /** Project `granularity_labels` overrides, keyed by TimeFrames. Consumed
     *  by the date zoom to relabel standard granularities. */
    granularityLabels?: Partial<Record<TimeFrames, string>>;
    savedParameterValues?: ParametersValuesMap;
    preAggregates?: PreAggregateDef[];
    preAggregateSource?: PreAggregateSource;
    /**
     * Non-fatal warnings from partial compilation.
     * Present when some joins or fields failed to compile but the explore is still usable.
     * Only populated when PARTIAL_COMPILATION_ENABLED=true.
     */
    warnings?: InlineError[];
};
export type ExploreError = Partial<Explore> & Pick<Explore, 'name' | 'label' | 'groupLabel' | 'groups'> & {
    errors: InlineError[];
};
/**
 * Check if an explore is an ExploreError (failed to compile completely).
 * ExploreError has 'errors' field, working Explore does not.
 */
export declare const isExploreError: (explore: Explore | ExploreError) => explore is ExploreError;
type SummaryExploreFields = 'name' | 'label' | 'tags' | 'groupLabel' | 'groups' | 'type' | 'preAggregateSource' | 'aiHint' | 'warnings';
type SummaryExploreErrorFields = 'name' | 'label' | 'tags' | 'groupLabel' | 'groups' | 'type' | 'aiHint' | 'errors';
type SummaryExtraFields = {
    description?: string;
    schemaName: string;
    databaseName: string;
};
export type SummaryExplore = (Pick<Explore, SummaryExploreFields> & SummaryExtraFields) | (Pick<ExploreError, SummaryExploreErrorFields> & Partial<SummaryExtraFields>);
/**
 * Check if a SummaryExplore is from an ExploreError (completely failed to compile).
 * ExploreError has 'errors' field with actual errors, working Explore may have 'warnings'.
 */
export declare const isSummaryExploreError: (summary: SummaryExplore) => summary is Pick<ExploreError, SummaryExploreErrorFields> & Partial<SummaryExtraFields>;
export type Table = TableBase & {
    dimensions: {
        [fieldName: string]: Dimension;
    };
    metrics: {
        [fieldName: string]: Metric;
    };
    lineageGraph: LineageGraph;
    source?: Source;
    parameters?: LightdashProjectConfig['parameters'];
    sets?: Record<string, FieldSetDefinition>;
};
export declare enum CustomViewType {
    VIRTUAL = "virtual",
    WRITE_BACK = "write_back"
}
export {};
//# sourceMappingURL=explore.d.ts.map