import * as _codemirror_view from '@codemirror/view'; import * as _codemirror_state from '@codemirror/state'; import { Extension } from '@codemirror/state'; import * as _coze_editor_core_plugins from '@coze-editor/core-plugins'; import * as _coze_editor_core from '@coze-editor/core'; import { InferEditorAPIFromPlugins } from '@coze-editor/core'; import { LanguageConfig, Transformer } from '@coze-editor/code-language-shared'; export { Transformer } from '@coze-editor/code-language-shared'; import { TagStyle } from '@codemirror/language'; import { Text } from 'text-mapping'; export { tags } from '@lezer/highlight'; declare const themes: any; declare class LanguagesRegistry { private languages; register(id: string, options: LanguageConfig): () => void; get(languageId: string): LanguageConfig; getExtension(id: string): Extension[]; } declare const languages: LanguagesRegistry; interface Theme { /** * Theme variant. Determines which styles CodeMirror will apply by default. */ variant: Variant; /** * Settings to customize the look of the editor, like background, gutter, selection and others. */ settings: Settings; /** * Syntax highlighting styles. */ styles: TagStyle[]; } type Variant = 'light' | 'dark'; interface StyleSpec { [propOrSelector: string]: string | number | StyleSpec | null; } interface Settings { /** * Editor background. */ background: string; /** * Default text color. */ foreground: string; /** * Caret color. */ caret: string; /** * Selection background. */ selection: string; /** * Background of highlighted lines. */ lineHighlight: string; /** * Gutter background. */ gutterBackground: string; /** * Text color inside gutter. */ gutterForeground: string; /** * Gutter border color */ gutterBorderColor: string; /** * Gutter border width */ gutterBorderWidth?: number; bracketColors?: string[]; tooltip: StyleSpec; tooltipCompletion?: StyleSpec; link?: StyleSpec; completionItemHover?: StyleSpec; completionItemSelected?: StyleSpec; completionItemIcon?: StyleSpec; completionItemLabel?: StyleSpec; completionItemInfo?: StyleSpec; completionItemDetail?: StyleSpec; } declare const createTheme: ({ variant, settings, styles }: Theme) => Extension; declare const transformerCreator: (processor: (text: Text) => Text) => Transformer; declare const preset: (_coze_editor_core.ExtensionPluginSpec | _coze_editor_core.OptionPluginSpec<"fontSize", number> | _coze_editor_core.OptionPluginSpec<"placeholder", string | HTMLElement> | _coze_editor_core.OptionPluginSpec<"readOnly", boolean> | _coze_editor_core.OptionPluginSpec<"editable", boolean> | _coze_editor_core.OptionPluginSpec<"lineWrapping", boolean> | _coze_editor_core.OptionPluginSpec<"height", string | number> | _coze_editor_core.OptionPluginSpec<"minHeight", string | number> | _coze_editor_core.OptionPluginSpec<"maxHeight", string | number> | _coze_editor_core.APIPluginSpec<"getValue", [], string> | _coze_editor_core.APIPluginSpec<"setValue", [value: string], void> | _coze_editor_core.APIPluginSpec<"replaceText", [options: _coze_editor_core_plugins.ReplaceTextOptions], void> | _coze_editor_core.APIPluginSpec<"getCursorPosition", [], number> | _coze_editor_core.APIPluginSpec<"setCursorPosition", [pos: number], void> | _coze_editor_core.APIPluginSpec<"focus", [], void> | _coze_editor_core.APIPluginSpec<"blur", [], void> | _coze_editor_core.APIPluginSpec<"disableKeybindings", [keys: string[]], void> | _coze_editor_core.APIPluginSpec<"updateASTDecorations", [], void> | _coze_editor_core.APIPluginSpec<"undo", [], void> | _coze_editor_core.APIPluginSpec<"redo", [], void> | _coze_editor_core.APIPluginSpec<"transformTextInSelection", [transformer: (text: string) => string | undefined], void> | _coze_editor_core.APIPluginSpec<"getSelection", [], { from: number; to: number; anchor: number; head: number; }> | _coze_editor_core.APIPluginSpec<"getLineInfoAtPosition", [pos: number], _codemirror_state.Line> | _coze_editor_core.EventPluginSpec<"selectionChange", { selection: { from: number; to: number; head: number; anchor: number; }; update: _codemirror_view.ViewUpdate; }> | _coze_editor_core.EventPluginSpec<"change", { value: string; }> | _coze_editor_core.EventPluginSpec<"focus", symbol> | _coze_editor_core.EventPluginSpec<"blur", symbol> | _coze_editor_core.DOMEventHandlerPluginSpec<"mousedown"> | _coze_editor_core.DOMEventHandlerPluginSpec<"mouseup"> | _coze_editor_core.OptionPluginSpec<"tabSize", number> | _coze_editor_core.OptionPluginSpec<"scrollBeyondLastLine", boolean> | _coze_editor_core.OptionPluginSpec<"uri", string> | _coze_editor_core.OptionPluginSpec<"theme", string> | _coze_editor_core.OptionPluginSpec<"languageId", string> | _coze_editor_core.OptionPluginSpec<"transformer", Transformer> | _coze_editor_core.OptionPluginSpec<"overlayScrollbar", unknown> | _coze_editor_core.OptionPluginSpec<"lineNumbersGutter", unknown> | _coze_editor_core.OptionPluginSpec<"foldGutter", unknown> | _coze_editor_core.OptionPluginSpec<"colorizeBrackets", unknown> | _coze_editor_core.APIPluginSpec<"validate", [], void>)[]; type EditorAPI = InferEditorAPIFromPlugins; export { type EditorAPI, type Theme, createTheme, preset as default, languages, themes, transformerCreator };