import { EditorView } from 'codemirror';
export { basicSetup, minimalSetup } from 'codemirror';
import { EditorSelection, SelectionRange } from '@codemirror/state';

type Extension = unknown;
declare class EditorDocument {
    #private;
    /**
     * @hidden
     */
    constructor(unkInner: unknown);
    /**
     *
     */
    /**
     *
     * @returns the document as a string, using newline characters to separate lines.
     */
    toString(): string;
    /**
     * @hidden
     */
    get unkInner(): unknown;
}
declare class EditSession {
    #private;
    /**
     * @hidden
     */
    constructor(unkInner: unknown);
    get document(): EditorDocument;
    get selection(): Selection;
    wordAt(pos: number): Range;
    /**
     * @hidden
     */
    get unkInner(): unknown;
}
interface EditSessionConfig {
    value?: string | null;
    selection?: Selection | {
        anchor: number;
        head?: number;
    };
    extensions?: Extension[];
}
interface EditorConfig extends EditSessionConfig {
    parent?: Element | DocumentFragment | null;
}
declare function create_editor(config: EditorConfig): Editor;
declare class Editor {
    #private;
    /**
     * @hidden
     */
    constructor(unkInner: EditorView);
    get session(): EditSession;
    addRef(): void;
    dispatch(arg: {
        changes: {
            from: number;
            to?: number;
            insert?: string;
        }[];
    }): void;
    focus(): void;
    insert(from: number, text: string): void;
    get hasFocus(): boolean;
    release(): void;
    select(ranges: readonly Range[], mainIndex?: number): void;
    /**
     * Sets the start and end positions of a selection in the editor.
     * @param start The offset into the editor for the start of the selection.
     * @param end The offset into the editor for the end of the selection.
     * @param direction The direction in which the selection is performed.
     */
    setSelectionRange(start: number | null, end: number | null, direction?: "forward" | "backward" | "none"): void;
    /**
     * @hidden
     */
    get unkInner(): EditorView;
    get value(): string;
    set value(text: string);
}
interface StyleSpec {
}
declare function create_theme(spec: {
    [selector: string]: StyleSpec;
}, options?: {
    dark?: boolean;
}): Extension;
declare class Selection {
    #private;
    /**
     * @hidden
     */
    constructor(unkInner: EditorSelection);
    get ranges(): Range[];
    /**
     * @hidden
     */
    get unkInner(): EditorSelection;
}
declare class Range {
    #private;
    /**
     * @hidden
     */
    constructor(unkInner: SelectionRange);
    /**
     * The lower boundary of the range.
     */
    get from(): number;
    /**
     * The upper boundary of the range.
     */
    get to(): number;
    /**
     * @hidden
     */
    get unkInner(): SelectionRange;
}
declare function create_anchor_range(anchor: number, head: number, goalColumn?: number, bidiLevel?: number): Range;
declare function create_cursor_range(pos: number, assoc?: number, bidiLevel?: number, goalColumn?: number): Range;
declare function create_selection(ranges: readonly Range[], mainIndex?: number): Selection;

export { EditSession, type EditSessionConfig, Editor, type EditorConfig, EditorDocument, type Extension, Range, Selection, type StyleSpec, create_anchor_range, create_cursor_range, create_editor, create_selection, create_theme };
