import { nothing, TemplateResult, PropertyValueMap } from 'lit';
import { Ref } from 'lit/directives/ref.js';
import { EditorView, KeyBinding } from '@codemirror/view';
import { Compartment, Extension, Facet } from '@codemirror/state';
import { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
import { WeavySubAppComponent } from '../classes/weavy-sub-app-component';
import { ShadowPartsController } from '../controllers/shadow-parts-controller';
declare global {
    interface HTMLElementTagNameMap {
        "wy-editor-core": WyEditorCore;
    }
}
/**
 * Rich text editor used for posts, messages and comments.
 *
 * **Used sub components:**
 *
 * - [`<wy-avatar>`](./ui/wy-avatar.ts)
 * - [`<wy-item>`](./ui/wy-item.ts)
 *
 * @csspart wy-core-editor - Wrapper for the editor
 *
 * @fires {EditorSubmitEventType} submit - Emitted when the editor content is submitted
 * @fires {EditorTypingEventType} edit - Throttled event when the user is typing.
 * @fires {EditorEditEventType} edit - When an edit of a previous text is requested.
 * @fires {EditorChangeEventType} change - When the text changes.
 * @fires {EditorClearEventType} clear - When clearing of the editor is requested.
 * @fires {DropFilesEventType} drop-files - When files are pasted into the editor.
 */
export declare class WyEditorCore extends WeavySubAppComponent {
    #private;
    static styles: import('lit').CSSResult[];
    /**
     * Controller for exporting named shadow parts.
     *
     * @internal
     */
    protected exportParts: ShadowPartsController;
    /**
     * Whether the editor is disabled.
     */
    disabled: boolean;
    /**
     * Placeholder text for the editor input.
     */
    placeholder: string;
    /**
     * Initial editor text content (draft or loaded content).
     */
    text?: string;
    /**
     * Whether typing indicators should be emitted.
     */
    typing: boolean;
    /**
     * Editor usage context, used to adjust behavior and styling.
     */
    editorType: "messages" | "posts" | "comments";
    /**
     * Select all content in the editor.
     *
     * @internal
     */
    selectAllContent(): Promise<void>;
    /**
     * Place cursor at the end of the editor content.
     *
     * @internal
     */
    setCursorLast(): Promise<void>;
    /**
     * Focus the editor input.
     *
     * @internal
     */
    focusInput(): Promise<void>;
    showTooltips: boolean;
    /**
     * The active EditorView instance.
     *
     * @internal
     */
    protected editor?: EditorView;
    /**
     * Resolves when the editor is available.
     *
     * @returns {Promise<EditorView>}
     */
    whenEditor(): Promise<EditorView>;
    /**
     * Programmatic editor view instance and extensions.
     *
     * @internal
     */
    protected editorExtensions?: Extension[];
    /**
     * EditorView constructor reference (lazy loaded).
     *
     * @internal
     */
    protected EditorView?: typeof EditorView;
    /**
     * Compartment to toggle editable/readonly.
     *
     * @internal
     */
    protected editorEditable?: Compartment;
    /**
     * Compartment and facets used to manage the editor keymap.
     *
     * @internal
     */
    protected editorKeymap?: Compartment;
    protected keymapFacet?: Facet<readonly KeyBinding[], readonly (readonly KeyBinding[])[]>;
    protected keymaps?: {
        weavyEnterSendKeymap: KeyBinding[];
        weavyModifierEnterSendKeymap: KeyBinding[];
        weavyKeymap: KeyBinding[];
        defaultKeymap: KeyBinding[];
        historyKeymap: KeyBinding[];
    };
    /**
     * Placeholder compartment for dynamic placeholder extension.
     *
     * @internal
     */
    protected editorPlaceholder?: Compartment;
    protected placeholderExtension?: (content: string | HTMLElement | ((view: EditorView) => HTMLElement)) => Extension;
    /**
     * Reference to the editor DOM node wrapper.
     *
     * @internal
     */
    protected editorRef: Ref<HTMLElement>;
    protected editorInitialized: boolean;
    protected tooltipsRef: Ref<HTMLElement>;
    constructor();
    willUpdate(changedProperties: PropertyValueMap<this>): void;
    protected updated(changedProperties: PropertyValueMap<this>): void;
    /**
     * Update the visible placeholder text within the fallback DOM copy.
     *
     * @internal
     */
    protected updatePlaceHolderText(): void;
    /**
     * Update enter key hint on the content element.
     *
     * @internal
     */
    protected updateEnterKeyHint(): void;
    /**
     * Compute and return keymaps for the current settings/editor type.
     *
     * @internal
     */
    protected getKeymaps(): KeyBinding[];
    /**
     * Autocomplete handler for mentions. Returns completion results or null.
     *
     * Called by the editor to resolve mention suggestions.
     *
     * @internal
     * @param context - Completion context from the editor
     * @returns Promise<CompletionResult | null>
     */
    protected autocomplete(context: CompletionContext): Promise<CompletionResult | null>;
    /**
     * Submit the editor content by dispatching a `submit` event.
     *
     * Validates that there is content to submit and that no uploads/embeds are still processing.
     */
    submit(): boolean;
    protected editLast(): boolean;
    /**
     * Throttled typing indicator sender to reduce network traffic.
     *
     * @internal
     */
    private throttledTyping;
    /**
     * Clear the editor UI and internal state (text, embeds, attachments, metadata).
     */
    clear(): void;
    protected dispatchChange(text: string): boolean;
    protected dispatchFiles(files: File[]): boolean;
    /**
     * Editor loading fallback dummy.
     * Hard copy of the rendered nodes when the editor is empty. Cleaned up to not be editable.
     */
    protected renderEditorDummy(): TemplateResult | typeof nothing;
    protected render(): TemplateResult<1>;
}
//# sourceMappingURL=wy-editor-core.d.ts.map