import { Text } from "@codemirror/next/text"; import { ChangeSet, ChangeSpec } from "./change"; import { EditorSelection, SelectionRange } from "./selection"; import { Transaction, TransactionSpec, StateEffect } from "./transaction"; import { Facet, Extension, StateField } from "./facet"; import { CharCategory } from "./charcategory"; export interface EditorStateConfig { doc?: string | Text; selection?: EditorSelection | { anchor: number; head?: number; }; extensions?: Extension; } export declare class EditorState { readonly doc: Text; readonly selection: EditorSelection; field(field: StateField): T; field(field: StateField, require: false): T | undefined; update(...specs: readonly TransactionSpec[]): Transaction; replaceSelection(text: string | Text): { changes: ChangeSet; selection: EditorSelection; effects: readonly StateEffect[]; }; changeByRange(f: (range: SelectionRange) => { range: SelectionRange; changes?: ChangeSpec; effects?: StateEffect | readonly StateEffect[]; }): { changes: ChangeSet; selection: EditorSelection; effects: readonly StateEffect[]; }; changes(spec?: ChangeSpec): ChangeSet; toText(string: string): Text; sliceDoc(from?: number, to?: number): string; facet(facet: Facet): Output; toJSON(fields?: { [prop: string]: StateField; }): any; static fromJSON(json: any, config?: EditorStateConfig, fields?: { [prop: string]: StateField; }): EditorState; static create(config?: EditorStateConfig): EditorState; static allowMultipleSelections: Facet; static tabSize: Facet; get tabSize(): number; static lineSeparator: Facet; get lineBreak(): string; static phrases: Facet<{ [key: string]: string; }, readonly { [key: string]: string; }[]>; phrase(phrase: string): string; static languageData: Facet<(state: EditorState, pos: number) => readonly { [name: string]: any; }[], readonly ((state: EditorState, pos: number) => readonly { [name: string]: any; }[])[]>; languageDataAt(name: string, pos: number): readonly T[]; charCategorizer(at: number): (char: string) => CharCategory; static changeFilter: Facet<(tr: Transaction) => boolean | readonly number[], readonly ((tr: Transaction) => boolean | readonly number[])[]>; static transactionFilter: Facet<(tr: Transaction) => TransactionSpec | readonly TransactionSpec[], readonly ((tr: Transaction) => TransactionSpec | readonly TransactionSpec[])[]>; static transactionExtender: Facet<(tr: Transaction) => Pick | null, readonly ((tr: Transaction) => Pick | null)[]>; } //# sourceMappingURL=state.d.ts.map