import type { EditorSelection, EditorState, Extension } from '@codemirror/state'; import type { EditorView, ViewUpdate } from '@codemirror/view'; import type { CSSProperties } from 'vue'; export type QdCodemirrorLanguageName = 'brainfuck' | 'clojure' | 'coffeescript' | 'cpp' | 'css' | 'dockerfile' | 'erlang' | 'go' | 'html' | 'java' | 'javascript' | 'json' | 'jsx' | 'julia' | 'lezer' | 'lua' | 'markdown' | 'mysql' | 'nginx' | 'pascal' | 'perl' | 'pgsql' | 'php' | 'powershell' | 'python' | 'r' | 'ruby' | 'rust' | 'scheme' | 'shell' | 'sql' | 'stylus' | 'swift' | 'tcl' | 'toml' | 'tsx' | 'typescript' | 'vb' | 'vbscript' | 'vue' | 'xml' | 'yaml'; export interface QdCodemirrorProps { modelValue?: string; autofocus?: boolean; disabled?: boolean; theme?: 'light' | 'dark'; indentWithTab?: boolean; tabSize?: number; placeholder?: string; style?: CSSProperties; phrases?: Record; autoDestroy?: boolean; extensions?: Extension[]; selection?: EditorSelection; root?: ShadowRoot | Document; language?: QdCodemirrorLanguageName; onChange?: (value: string, viewUpdate: ViewUpdate) => void; onUpdate?: (viewUpdate: ViewUpdate) => void; onFocus?: (viewUpdate: ViewUpdate) => void; onBlur?: (viewUpdate: ViewUpdate) => void; onReady?: (payload: { view: EditorView; state: EditorState; container: HTMLDivElement; }) => void; }