import { LitElement, PropertyValues, TemplateResult } from 'lit';
import type { FunctionSchema } from '@pawel-up/jexl/schemas/types.js';
import type { Suggestion } from './types.js';
import { SuggestionMatchDecorator } from './SuggestionMatchDecorator.js';
import '../../../md/button/ui-button.js';
/**
 * A CodeMirror 6 based editor component that supports function autocomplete and suggestion placeholders.
 *
 * Features:
 * - Dynamic function schema loading
 * - Autocomplete for functions and suggestions
 * - Suggestion placeholders with double curly braces ({{suggestion}})
 * - Keyboard navigation
 * - Accessibility support
 *
 * @fires functioninsert - When a function is inserted
 * @fires suggestioninsert - When a suggestion is inserted
 * @fires docsrequest - When documentation is requested for a function
 * @fires input - When the editor content changes
 * @fires change - When the editor loses focus and content has changed
 */
export default class CodeEditor extends LitElement {
    #private;
    /**
     * Shadow root configuration for the component.
     * Uses 'open' mode for accessibility and delegates focus to enable proper focus management.
     */
    static shadowRootOptions: ShadowRootInit;
    /**
     * The label text displayed as placeholder/floating label
     * @attribute
     */
    accessor label: string;
    /**
     * Supporting text displayed below the editor
     * @attribute
     */
    accessor supportingText: string;
    /**
     * Whether the component is disabled
     * @attribute
     */
    accessor disabled: boolean;
    /**
     * Whether the component is in an invalid state
     * @attribute
     */
    accessor invalid: boolean;
    /**
     * The name attribute for form integration
     * @attribute
     */
    accessor name: string;
    /**
     * Whether the input is required
     * @attribute
     */
    accessor required: boolean;
    /**
     * Placeholder text shown when editor is empty
     * @attribute
     */
    accessor placeholder: string;
    /**
     * The editor content value
     */
    get value(): string;
    set value(newValue: string);
    /**
     * Available function schemas for autocomplete
     */
    accessor functionSchemas: FunctionSchema[];
    /**
     * Available suggestions for autocomplete
     */
    accessor suggestions: Suggestion[];
    /**
     * Programming language for syntax highlighting
     * @attribute
     */
    accessor language: string;
    /**
     * Whether to show documentation links/buttons in function tooltips and autocomplete
     * @attribute
     */
    accessor showDocumentation: boolean;
    private accessor editorContainer;
    private accessor hasContent;
    private accessor isEditorFocus;
    private editorView?;
    /**
     * A control value to track previous value of the editor.
     * This is used to detect when change event should be dispatched.
     */
    private _previousValue;
    /**
     * Matcher for suggestion placeholders in the editor.
     */
    placeholderMatcher?: SuggestionMatchDecorator;
    /**
     * Get all suggestions (placeholders) currently in the editor
     */
    get activeSuggestions(): Suggestion[];
    private readonlyState;
    disconnectedCallback(): void;
    firstUpdated(): void;
    willUpdate(changedProperties: PropertyValues): void;
    /**
     * Initialize CodeMirror editor with extensions
     */
    private initializeCodeMirror;
    /**
     * Creates the ViewPlugin for rendering suggestion placeholders.
     * This is created as a method to get access to the component's `suggestions`.
     */
    private createPlaceholderPlugin;
    /**
     * Create completion source for functions and suggestions
     */
    private createCompletionSource;
    private createFunctionCompletion;
    private createSuggestionCompletion;
    /**
     * Creates the source for the hover tooltips.
     * This is an arrow function to automatically bind `this`.
     */
    private createHoverTooltipSource;
    /**
     * Creates a styled HTML element to display function documentation.
     * This is used for both hover tooltips and autocomplete info panels.
     */
    protected createFunctionInfoElement(fn: FunctionSchema): HTMLElement;
    /**
     * Format function call with parameters
     */
    private formatFunctionCall;
    /**
     * Update editor content when value changes
     */
    private updateEditorContent;
    /**
     * Handle editor content change
     */
    private handleEditorChange;
    /**
     * Handle focus change
     */
    private handleFocusChange;
    /**
     * Dispatch function insert event
     */
    private dispatchFunctionInsert;
    /**
     * Dispatch suggestion insert event
     */
    private dispatchSuggestionInsert;
    /**
     * Dispatch function documentation event
     */
    private dispatchFunctionDocumentation;
    /**
     * Focus the editor
     */
    focus(): void;
    /**
     * Get the editor's current selection
     */
    getSelection(): {
        from: number;
        to: number;
    } | null;
    /**
     * Insert text at the current cursor position
     */
    insertText(text: string): void;
    render(): TemplateResult;
}
//# sourceMappingURL=CodeEditor.d.ts.map