Fix: System-wide type hardening and V3 API alignment

This commit is contained in:
Scott Idem
2026-01-22 19:22:16 -05:00
parent 9de1d4b23e
commit 4976f2d897
11 changed files with 87 additions and 56 deletions

View File

@@ -1,6 +1,7 @@
let _cmCache: {
EditorView?: any;
EditorState?: any;
EditorSelection?: any;
markdown?: any;
markdownLanguage?: any;
keymap?: any;
@@ -25,6 +26,7 @@ let _cmCache: {
highlightSelectionMatches?: any;
lintKeymap?: any;
EditorState_allowMultipleSelections?: any;
EditorState_readOnly?: any;
EditorView_lineWrapping?: any;
EditorView_editable?: any;
EditorView_contentAttributes?: any;
@@ -43,6 +45,7 @@ import { browser } from '$app/environment';
type CMCache = {
EditorView: any;
EditorState: any;
EditorSelection?: any;
markdown?: any;
markdownLanguage?: any;
keymap?: any;
@@ -67,6 +70,7 @@ type CMCache = {
highlightSelectionMatches?: any;
lintKeymap?: any;
EditorState_allowMultipleSelections?: any;
EditorState_readOnly?: any;
EditorView_lineWrapping?: any;
EditorView_editable?: any;
EditorView_contentAttributes?: any;
@@ -133,7 +137,7 @@ export async function ensureCodeMirrorModules(): Promise<CMCache> {
markdown: markdownMod?.markdown,
markdownLanguage: markdownMod?.markdownLanguage,
languages: languageMod?.languages, // From @codemirror/language-data, often re-exported by @codemirror/language
languages: (languageMod as any)?.languages, // Cast to any to avoid TS error if property is missing from types
defaultKeymap: (commandsMod && commandsMod.defaultKeymap) || [],
history: commandsMod?.history,