import StructuredQuery from "@metabase/embedding-sdk-react/dist/frontend/src/metabase-lib/v1/queries/StructuredQuery";
import type AtomicQuery from "@metabase/embedding-sdk-react/dist/frontend/src/metabase-lib/v1/queries/AtomicQuery";
import type BaseQuery from "@metabase/embedding-sdk-react/dist/frontend/src/metabase-lib/v1/queries/Query";
import Metadata from "@metabase/embedding-sdk-react/dist/frontend/src/metabase-lib/v1/metadata/Metadata";
import type Database from "@metabase/embedding-sdk-react/dist/frontend/src/metabase-lib/v1/metadata/Database";
import type Table from "@metabase/embedding-sdk-react/dist/frontend/src/metabase-lib/v1/metadata/Table";
import type { Card as CardObject, CardDisplayType, CardType, CollectionId, DashboardId, DashCardId, DatabaseId, DatasetData, DatasetQuery, Field, Parameter as ParameterObject, ParameterId, ParameterValues, TableId, VisualizationSettings } from "@metabase/embedding-sdk-react/dist/frontend/src/metabase-types/api";
import type { Query } from "../types";
export type QuestionCreatorOpts = {
    databaseId?: DatabaseId;
    cardType?: CardType;
    tableId?: TableId;
    collectionId?: CollectionId;
    metadata?: Metadata;
    parameterValues?: ParameterValues;
    type?: "query" | "native";
    name?: string;
    display?: CardDisplayType;
    visualization_settings?: VisualizationSettings;
    dataset_query?: DatasetQuery;
};
/**
 * This is a wrapper around a question/card object, which may contain one or more Query objects
 */
declare class Question {
    /**
     * The plain object presentation of this question, equal to the format that Metabase REST API understands.
     * It is called `card` for both historical reasons and to make a clear distinction to this class.
     */
    _card: CardObject;
    /**
     * The Question wrapper requires a metadata object because the queries it contains (like {@link StructuredQuery})
     * need metadata for accessing databases, tables and metrics.
     */
    _metadata: Metadata;
    /**
     * Parameter values mean either the current values of dashboard filters or SQL editor template parameters.
     * They are in the grey area between UI state and question state, but having them in Question wrapper is convenient.
     */
    _parameterValues: ParameterValues;
    private __mlv2Query;
    private __mlv2MetadataProvider;
    /**
     * Question constructor
     */
    constructor(card: any, metadata?: Metadata, parameterValues?: ParameterValues);
    clone(): Question;
    metadata(): Metadata;
    card(): CardObject<DatasetQuery>;
    _doNotCallSerializableCard(): CardObject<DatasetQuery>;
    setCard(card: CardObject): Question;
    withoutNameAndId(): Question;
    omitTransientCardIds(): this;
    /**
     * A question contains either a:
     * - StructuredQuery for queries written in MBQL
     * - NativeQuery for queries written in data source's native query language
     *
     * This is just a wrapper object, the data is stored in `this._card.dataset_query` in a format specific to the query type.
     */
    _legacyQuery: () => AtomicQuery;
    legacyQuery<UseStructuredQuery extends boolean>({ useStructuredQuery, }?: {
        useStructuredQuery?: UseStructuredQuery;
    }): UseStructuredQuery extends true ? StructuredQuery : AtomicQuery | StructuredQuery;
    /**
     * Returns a new Question object with an updated query.
     * The query is saved to the `dataset_query` field of the Card object.
     */
    setLegacyQuery(newQuery: BaseQuery): Question;
    datasetQuery(): DatasetQuery;
    setDatasetQuery(newDatasetQuery: DatasetQuery): Question;
    /**
     * The visualization type of the question
     */
    display(): string;
    setDisplay(display: any): Question;
    cacheTTL(): number | null;
    setCacheTTL(cache: any): Question;
    type(): CardType;
    setType(type: CardType): Question;
    isPersisted(): any;
    setPersisted(isPersisted: any): Question;
    setPinned(pinned: boolean): Question;
    setArchived(archived: boolean): Question;
    lockDisplay(): Question;
    setDisplayIsLocked(locked: boolean): Question;
    displayIsLocked(): boolean;
    maybeResetDisplay(data: DatasetData, sensibleDisplays: string[], previousSensibleDisplays: string[] | undefined): Question;
    private _maybeSwitchToScalar;
    setDefaultDisplay(): Question;
    settings(): VisualizationSettings;
    setting(settingName: any, defaultValue?: undefined): any;
    setSettings(settings: VisualizationSettings): Question;
    updateSettings(settings: Partial<VisualizationSettings>): Question;
    creationType(): string;
    /**
     * How many filters or other widgets are this question's values used for?
     */
    getParameterUsageCount(): number;
    /**
     * Question is valid (as far as we know) and can be executed
     */
    canRun(): boolean;
    canWrite(): boolean;
    canRunAdhocQuery(): boolean;
    canWriteActions(): boolean;
    supportsImplicitActions(): boolean;
    canAutoRun(): boolean;
    /**
     * Returns the type of alert that current question supports
     *
     * The `visualization_settings` in card object doesn't contain default settings,
     * so you can provide the complete visualization settings object to `alertType`
     * for taking those into account
     */
    alertType(visualizationSettings: any): "alert-type-rows" | "alert-type-timeseries-goal" | "alert-type-progress-bar-goal" | null;
    /**
     * Visualization drill-through and action widget actions
     *
     * Although most of these are essentially a way to modify the current query, having them as a part
     * of Question interface instead of Query interface makes it more convenient to also change the current visualization
     */
    composeQuestion(): Question;
    composeQuestionAdhoc(): Question;
    /**
     * A user-defined name for the question
     */
    displayName(): string | null | undefined;
    slug(): string | null | undefined;
    setDisplayName(name: string | null | undefined): Question;
    collectionId(): CollectionId | null | undefined;
    setCollectionId(collectionId: CollectionId | null | undefined): Question;
    id(): number;
    setId(id: number | undefined): Question;
    markDirty(): Question;
    setDashboardProps({ dashboardId, dashcardId, }: {
        dashboardId: DashboardId;
        dashcardId: DashCardId;
    } | {
        dashboardId: undefined;
        dashcardId: undefined;
    }): Question;
    description(): string | null;
    setDescription(description: any): Question;
    lastEditInfo(): any;
    lastQueryStart(): string | null;
    isSaved(): boolean;
    publicUUID(): string;
    database(): Database | null;
    databaseId(): DatabaseId | null;
    legacyQueryTable(): Table | null;
    legacyQueryTableId(): TableId | null;
    isArchived(): boolean;
    getResultMetadata(): Field[];
    setResultsMetadata(resultsMetadata: any): Question;
    setResultMetadataDiff(metadataDiff: Record<string, Partial<Field>>): Question;
    /**
     * Returns true if the questions are equivalent (including id, card, and parameters)
     */
    isEqual(other: any, { compareResultsMetadata }?: {
        compareResultsMetadata?: boolean | undefined;
    }): boolean;
    setParameter(id: ParameterId, parameter: ParameterObject): Question;
    setParameters(parameters: any): Question;
    setParameterValues(parameterValues: any): Question;
    parameters({ collectionPreview }?: {
        collectionPreview: any;
    }): ParameterObject[];
    isDirtyComparedTo(originalQuestion: Question): boolean;
    isDirtyComparedToWithoutParameters(originalQuestion: Question): boolean;
    isQueryDirtyComparedTo(originalQuestion: Question): boolean;
    _serializeForUrl({ includeOriginalCardId, includeDisplayIsLocked, creationType, }?: {
        includeOriginalCardId?: boolean | undefined;
        includeDisplayIsLocked?: boolean | undefined;
        creationType: any;
    }): string;
    _convertParametersToMbql(): Question;
    query(): Query;
    private metadataProvider;
    setQuery(query: Query): Question;
    generateQueryDescription(): string;
    getModerationReviews(): any;
    getCreator(): string;
    getCreatedAt(): string;
    /**
     * TODO Atte Keinänen 6/13/17: Discussed with Tom that we could use the default Question constructor instead,
     * but it would require changing the constructor signature so that `card` is an optional parameter and has a default value
     */
    static create({ databaseId, tableId, collectionId, metadata, parameterValues, type, name, display, visualization_settings, cardType, dataset_query, }?: QuestionCreatorOpts): Question;
}
export default Question;
