import type { Ace } from "ace-builds";
import { Component } from "react";
import type { ResizableBox, ResizableBoxProps } from "react-resizable";
import _ from "underscore";
import "ace/ace";
import "ace/ext-language_tools";
import "ace/ext-searchbox";
import "ace/mode-sql";
import "ace/mode-json";
import "ace/snippets/text";
import "ace/snippets/sql";
import "ace/snippets/json";
import type { QueryModalType } from "@metabase/embedding-sdk-react/dist/frontend/src/metabase/query_builder/constants";
import type Question from "@metabase/embedding-sdk-react/dist/frontend/src/metabase-lib/v1/Question";
import type NativeQuery from "@metabase/embedding-sdk-react/dist/frontend/src/metabase-lib/v1/queries/NativeQuery";
import type { Card, CardId, Collection, DatabaseId, NativeQuerySnippet, ParameterId, TableId } from "@metabase/embedding-sdk-react/dist/frontend/src/metabase-types/api";
import type { Features as SidebarFeatures } from "./NativeQueryEditorSidebar";
type CardCompletionItem = Pick<Card, "id" | "name" | "type"> & {
    collection_name: string;
};
type AutocompleteItem = [string, string];
type OwnProps = typeof NativeQueryEditor.defaultProps & {
    question: Question;
    query: NativeQuery;
    nativeEditorSelectedText?: string;
    modalSnippet?: NativeQuerySnippet;
    viewHeight: number;
    isOpen?: boolean;
    isInitiallyOpen?: boolean;
    isNativeEditorOpen: boolean;
    isRunnable: boolean;
    isRunning: boolean;
    isResultDirty: boolean;
    isShowingDataReference: boolean;
    isShowingTemplateTagsEditor: boolean;
    isShowingSnippetSidebar: boolean;
    readOnly?: boolean;
    enableRun?: boolean;
    canChangeDatabase?: boolean;
    hasTopBar?: boolean;
    hasParametersList?: boolean;
    hasEditingSidebar?: boolean;
    sidebarFeatures?: SidebarFeatures;
    resizable?: boolean;
    resizableBoxProps?: Partial<Omit<ResizableBoxProps, "axis">>;
    editorContext?: "question";
    handleResize: () => void;
    autocompleteResultsFn: (prefix: string) => Promise<AutocompleteItem[]>;
    cardAutocompleteResultsFn: (prefix: string) => Promise<CardCompletionItem[]>;
    setDatasetQuery: (query: NativeQuery) => Promise<Question>;
    runQuestionQuery: (opts?: {
        overrideWithQuestion?: Question;
        shouldUpdateUrl?: boolean;
    }) => void;
    setNativeEditorSelectedRange: (range: Ace.Range) => void;
    openDataReferenceAtQuestion: (id: CardId) => void;
    openSnippetModalWithSelectedText: () => void;
    insertSnippet: (snippet: NativeQuerySnippet) => void;
    setIsNativeEditorOpen?: (isOpen: boolean) => void;
    setParameterValue: (parameterId: ParameterId, value: string) => void;
    setParameterValueToDefault: (parameterId: ParameterId) => void;
    onOpenModal: (modalType: QueryModalType) => void;
    toggleDataReference: () => void;
    toggleTemplateTagsEditor: () => void;
    toggleSnippetSidebar: () => void;
    cancelQuery?: () => void;
    closeSnippetModal: () => void;
    onSetDatabaseId?: (id: DatabaseId) => void;
};
interface StateProps {
    canUsePromptInput: boolean;
}
interface DispatchProps {
    fetchQuestion: (cardId: CardId) => Promise<Card>;
}
interface ExplicitSizeProps {
    width: number;
    height: number;
}
interface EntityLoaderProps {
    snippets?: NativeQuerySnippet[];
    snippetCollections?: Collection[];
}
type Props = OwnProps & StateProps & DispatchProps & ExplicitSizeProps & EntityLoaderProps;
interface NativeQueryEditorState {
    initialHeight: number;
    isSelectedTextPopoverOpen: boolean;
    mobileShowParameterList: boolean;
    isPromptInputVisible: boolean;
}
type AceCompletionsGetter = Ace.Completer["getCompletions"];
export declare class NativeQueryEditor extends Component<Props, NativeQueryEditorState> {
    editor: import("react").RefObject<HTMLDivElement>;
    resizeBox: import("react").RefObject<HTMLDivElement & ResizableBox>;
    nextCompleters?: (position: Ace.Position) => Ace.Completer[];
    _editor: Ace.Editor | null;
    _localUpdate: boolean;
    _focusFrame: number;
    constructor(props: Props);
    static defaultProps: {
        isOpen: boolean;
        enableRun: boolean;
        canChangeDatabase: boolean;
        resizable: boolean;
        sidebarFeatures: {
            dataReference: boolean;
            variables: boolean;
            snippets: boolean;
            promptInput: boolean;
        };
    };
    UNSAFE_componentWillMount(): void;
    componentDidMount(): void;
    handleRightClick: (event: MouseEvent) => void;
    componentDidUpdate(prevProps: Props): void;
    componentWillUnmount(): void;
    cardTagIdAtCursor: ({ row, column }: Ace.Position) => number | null;
    handleCursorChange: ((e: Event, { cursor }: {
        cursor: Ace.Position;
    }) => void) & _.Cancelable;
    handleSelectionChange: () => void;
    handleKeyDown: (e: KeyboardEvent) => void;
    runQuery: () => void;
    focus(): void;
    loadAceEditor(): void;
    getSnippetNameAtCursor: ({ row, column }: Ace.Position) => string | null;
    getCardTagNameAtCursor: ({ row, column }: Ace.Position) => string | null;
    getSnippetCompletions: AceCompletionsGetter;
    getCardTagCompletions: AceCompletionsGetter;
    _updateSize(): void;
    _retriggerAutocomplete: (() => void) & _.Cancelable;
    onChange(): void;
    toggleEditor: () => void;
    setDatabaseId: (databaseId: DatabaseId) => void;
    setTableId: (tableId: TableId) => void;
    setParameterIndex: (parameterId: ParameterId, parameterIndex: number) => void;
    handleFilterButtonClick: () => void;
    togglePromptVisibility: () => void;
    handleQueryUpdate: (queryText: string) => void;
    handleQueryGenerated: (queryText: string) => void;
    isPromptInputVisible: () => boolean;
    formatQuery: () => Promise<void>;
    render(): import("react/jsx-runtime").JSX.Element;
}
declare const _default: any;
export default _default;
