import type { Dimension } from "@metabase/embedding-sdk-react/dist/frontend/src/metabase-lib/v1/Dimension";
import DimensionOptions from "@metabase/embedding-sdk-react/dist/frontend/src/metabase-lib/v1/DimensionOptions";
import type { AggregationOperator } from "@metabase/embedding-sdk-react/dist/frontend/src/metabase-lib/v1/deprecated-types";
import type { Aggregation, DatabaseId, DatasetQuery, Filter, StructuredDatasetQuery, StructuredQuery as StructuredQueryObject, TableId } from "@metabase/embedding-sdk-react/dist/frontend/src/metabase-types/api";
import type Question from "../Question";
import type Database from "../metadata/Database";
import type Field from "../metadata/Field";
import type Segment from "../metadata/Segment";
import type Table from "../metadata/Table";
import AtomicQuery from "./AtomicQuery";
import AggregationWrapper from "./structured/Aggregation";
import FilterWrapper from "./structured/Filter";
type DimensionFilterFn = (dimension: Dimension) => boolean;
export type FieldFilterFn = (filter: Field) => boolean;
export declare const STRUCTURED_QUERY_TEMPLATE: {
    database: null;
    type: string;
    query: {
        "source-table": null;
    };
};
export interface FilterSection {
    name: string;
    icon: string;
    items: (DimensionOption | SegmentOption)[];
}
export interface DimensionOption {
    dimension: Dimension;
}
export interface SegmentOption {
    name: string;
    filter: ["segment", number];
    icon: string;
    query: StructuredQuery;
}
/**
 * A wrapper around an MBQL (`query` type @type {DatasetQuery}) object
 */
declare class StructuredQuery extends AtomicQuery {
    static isDatasetQueryType(datasetQuery: DatasetQuery): boolean;
    _structuredDatasetQuery: StructuredDatasetQuery;
    /**
     * Creates a new StructuredQuery based on the provided DatasetQuery object
     */
    constructor(question: Question, datasetQuery?: DatasetQuery);
    private getMLv2Query;
    /**
     * @returns all tables in the currently selected database that can be used.
     */
    tables(): Table[] | null | undefined;
    /**
     * @returns the currently selected database ID, if any is selected.
     * @deprecated Use MLv2
     */
    _databaseId(): DatabaseId | null | undefined;
    /**
     * @returns the currently selected database metadata, if a database is selected and loaded.
     * @deprecated Use MLv2
     */
    _database(): Database | null | undefined;
    /**
     * @returns the underlying MBQL query object
     */
    legacyQuery(): StructuredQueryObject;
    setQuery(query: StructuredQueryObject): StructuredQuery;
    updateQuery(fn: (q: StructuredQueryObject) => StructuredQueryObject): StructuredQuery;
    /**
     * @returns the table ID, if a table is selected.
     * @deprecated Use MLv2
     */
    private _sourceTableId;
    /**
     * @returns a new query with the provided Table ID set.
     */
    setSourceTableId(tableId: TableId): StructuredQuery;
    /**
     * @returns the table object, if a table is selected and loaded.
     */
    table: () => Table | null;
    hasAggregations(): boolean;
    /**
     * @returns alias for addAggregation
     */
    aggregate(aggregation: Aggregation): StructuredQuery;
    /**
     * @returns alias for addFilter
     */
    filter(filter: Filter | FilterWrapper): StructuredQuery;
    /**
     * @returns an array of MBQL @type {Aggregation}s.
     */
    aggregations: () => AggregationWrapper[];
    /**
     * @returns an array of aggregation options for the currently selected table
     */
    aggregationOperators: () => AggregationOperator[];
    aggregationOperatorsLookup: () => Record<string, AggregationOperator>;
    aggregationOperator(short: string): AggregationOperator;
    /**
     * @returns the field options for the provided aggregation
     */
    aggregationFieldOptions(agg: string | AggregationOperator): DimensionOptions;
    /**
     * @returns true if the aggregation can be removed
     */
    canRemoveAggregation(): boolean;
    /**
     * @returns true if the query has no aggregation
     */
    isBareRows(): boolean;
    /**
     * @returns true if the query has no aggregation
     */
    isRaw(): boolean;
    formatExpression(expression: any, { quotes, ...options }?: {
        quotes?: {
            identifierQuoteDefault: string;
            literalQuoteDefault: string;
        } | undefined;
    }): string;
    /**
     * @returns {StructuredQuery} new query with the provided MBQL @type {Aggregation} added.
     */
    addAggregation(_aggregation: Aggregation): StructuredQuery;
    /**
     * @returns {StructuredQuery} new query with the MBQL @type {Aggregation} updated at the provided index.
     */
    updateAggregation(_index: number, _aggregation: Aggregation): StructuredQuery;
    /**
     * @returns {StructuredQuery} new query with the aggregation at the provided index removed.
     */
    removeAggregation(_index: number): StructuredQuery;
    /**
     * @returns An array of MBQL @type {Filter}s.
     */
    filters: () => FilterWrapper[];
    filterFieldOptionSections(filter?: (Filter | FilterWrapper) | null | undefined, { includeSegments }?: {
        includeSegments?: boolean | undefined;
    }, includeAppliedSegments?: boolean): import("../DimensionOptions/types").DimensionOptionsSection[];
    /**
     * @returns @type {DimensionOptions} that can be used in filters.
     */
    filterDimensionOptions(): DimensionOptions;
    /**
     * @returns @type {Segment}s that can be used as filters.
     */
    filterSegmentOptions(filter?: Filter | FilterWrapper, includeAppliedSegments?: boolean): Segment[];
    /**
     *  @returns @type {Segment}s that are currently applied to the question
     */
    segments: () => (Segment | null | undefined)[];
    /**
     * @returns whether a new filter can be added or not
     */
    canAddFilter(): boolean;
    /**
     * @returns {StructuredQuery} new query with the provided MBQL @type {Filter} added.
     */
    addFilter(_filter: Filter | FilterWrapper): StructuredQuery;
    /**
     * @returns {StructuredQuery} new query with the MBQL @type {Filter} updated at the provided index.
     */
    updateFilter(_index: number, _filter: Filter | FilterWrapper): StructuredQuery;
    /**
     * @returns {StructuredQuery} new query with the filter at the provided index removed.
     */
    removeFilter(_index: number): StructuredQuery;
    dimensionOptions(dimensionFilter?: DimensionFilterFn): DimensionOptions;
    fieldOptions(fieldFilter?: FieldFilterFn): DimensionOptions;
    dimensions(): Dimension[];
    tableDimensions: () => Dimension[];
    aggregationDimensions: () => import("@metabase/embedding-sdk-react/dist/frontend/src/metabase-lib/v1/Dimension").AggregationDimension[];
    columnDimensions: () => Dimension[];
    columnNames: () => any[];
    columns: () => any[];
    setDatasetQuery(datasetQuery: DatasetQuery): StructuredQuery;
    _updateQuery(updateFunction: (query: StructuredQueryObject, ...args: any[]) => StructuredQueryObject, args?: any[]): StructuredQuery;
}
export default StructuredQuery;
