import { type Extension, type Transaction } from '@codemirror/state'; import { EditorView } from '@codemirror/view'; export type Language = 'json' | 'json5' | 'python' | 'go' | 'sql'; export declare const externalUpdate: import("@codemirror/state").AnnotationType; /** Options and initial values for a code editor's extensions. */ export interface ExtensionOptions { label: string; errorMessageID?: string | undefined; isInvalid?: boolean | undefined; readonly?: boolean; onFocus?: (event: FocusEvent) => void; onBlur?: (event: FocusEvent) => void; diffOriginal?: string | undefined; lineWrapping?: boolean; language?: Language; extraExtensions?: Extension[]; } declare const setReadOnly: (view: EditorView | undefined, nextValue: boolean | undefined) => void; declare const setLabel: (view: EditorView | undefined, nextValue: string | undefined) => void; declare const setErrorMessageID: (view: EditorView | undefined, nextValue: string | undefined) => void; declare const setIsInvalid: (view: EditorView | undefined, nextValue: boolean | undefined) => void; declare const setDiffOriginal: (view: EditorView | undefined, nextOriginal: string | undefined) => void; /** * Create a CodeMirror extension list for a code editor. * * Adds various state fields and effects so that props changes * can be hooked to the editor without needing to completely * reconfigure or recreate the extensions list. * * @param options Initial values for editor state * @returns The extension list and hooks to reactively update the state */ export declare const createCodeExtensions: (options: ExtensionOptions) => readonly Extension[]; /** * Dispatch change events when the contents of the editor change. * * Create a new dispatch function whenever the editor is re-created */ export declare const createDispatchTransactions: (onChange: (nextValue: string) => unknown, language?: Language) => (transactions: readonly Transaction[], view: EditorView) => void; export { setDiffOriginal, setErrorMessageID, setIsInvalid, setLabel, setReadOnly, };