export type ThemeSpec = Record; export type StyleSpec = { [propOrSelector: string]: string | number | StyleSpec | null; }; export type CodeMirrorProps = { /** The value that will be displayed and edited in the CodeMirror editor. */ value?: string | null | undefined; /** Class value to add additional css classes to CodeMirror editor. */ class?: ClassValue; /** The language extension that will parse and highlight the value. */ lang?: LanguageSupport | null | undefined; /** The theme extension to customize the appearence of the editor. */ theme?: Extension | null | undefined; /** The placeholder text or element to show when the editor is empty. */ placeholder?: string | HTMLElement | null | undefined; /** Whether to make the editor editable or not. */ editable?: boolean; /** Whether to make the editor readonly or not. */ readonly?: boolean; /** Whether to allow multi-selecting text. */ allowMultiSelect?: boolean; /** Whether to use the `Tab` shortcut to handle indentation. */ useTab?: boolean; /** The number of space of an indentation level. */ tabSize?: number; /** Whether to wrap lines in the editor or not. */ lineWrapping?: boolean; /** Whether to show line numbers or not. */ lineNumbers?: boolean | LineNumberConfig; /** Highlighting options. */ highlight?: { /** Whether to highlight the active line. */ activeLine?: boolean; /** Whether to highlight the active line gutter. */ activeLineGutter?: boolean; /** Highlight special characters. */ specialChars?: boolean | SpecialCharConfig; /** Highlight selection matches. */ selectionMatches?: boolean | SelectionMatchesConfig; }; /** Enable/disable and/or configure history. */ history?: boolean | HistoryConfig; /** Enable/disable and/or configure fold gutter. */ foldGutter?: boolean | FoldGutterConfig; /** Enable/disable and/or configure draw selection. */ drawSelection?: boolean | DrawSelectionConfig; /** Whether to show the drop cursor. */ dropCursor?: boolean; /** Whether to indent on input. */ indentOnInput?: boolean; /** Enable/disable and/or configure syntax highlighting. */ syntaxHighlighting?: boolean | { highlighter?: Highlighter; fallback?: boolean; }; /** Enable/disable and/or configure bracket matching. */ bracketMatching?: boolean | BracketMatchingConfig; /** Whether to close brackets automatically. */ closeBrackets?: boolean; /** Enable/disable and/or configure autocompletion. */ autocompletion?: boolean | CompletionConfig; /** Enable/disable and/or configure rectangular selection. */ rectangularSelection?: boolean | RectangularSelectionConfig; /** Enable/disable and/or configure crosshair cursor. */ crosshairCursor?: boolean | CrosshairCursorConfig; /** Additional extensions to inject in the editor.*/ extensions?: Extension[]; /** Additional keybindings to register. */ keybindings?: KeyBinding[]; /** In-place theme configuration. */ styles?: ThemeSpec | null | undefined; /** Disable onchange debounce (warning: impact performance). */ nodebounce?: boolean; /** Trigger when the code changes. */ onchange?: (value: string) => void; /** Trigger when the editor is ready. Allows to retrieve the `EditorView` instance. */ onready?: (view: EditorView) => void; /** Trigger when the editor is reconfiguring because of props update. */ onreconfigure?: (view: EditorView) => void; }; export type LineNumberConfig = Parameters[0] & {}; export type SpecialCharConfig = Parameters[0] & {}; export type SelectionMatchesConfig = Parameters[0] & {}; export type HistoryConfig = Parameters[0] & {}; export type FoldGutterConfig = Parameters[0] & {}; export type DrawSelectionConfig = Parameters[0] & {}; export type Highlighter = Parameters[0] & {}; export type BracketMatchingConfig = Parameters[0] & {}; export type CompletionConfig = Parameters[0] & {}; export type RectangularSelectionConfig = Parameters[0] & {}; export type CrosshairCursorConfig = Parameters[0] & {}; import type { ClassValue } from "svelte/elements"; import { autocompletion as autocompletionExt } from "@codemirror/autocomplete"; import { history as historyExt } from "@codemirror/commands"; import { bracketMatching as bracketMatchingExt, foldGutter as foldGutterExt, syntaxHighlighting as syntaxHighlightingExt, type LanguageSupport } from "@codemirror/language"; import { highlightSelectionMatches } from "@codemirror/search"; import { type Extension } from "@codemirror/state"; import { crosshairCursor as crosshairCursorExt, drawSelection as drawSelectionExt, EditorView, highlightSpecialChars, lineNumbers as lineNumbersExt, rectangularSelection as rectangularSelectionExt, type KeyBinding } from "@codemirror/view"; declare const CodeMirror: import("svelte").Component; type CodeMirror = ReturnType; export default CodeMirror;