feat(server): add endpoint to list code note themes

This commit is contained in:
Elian Doran
2025-05-11 20:40:22 +03:00
parent 7475e94c53
commit ca467fcd7a
6 changed files with 20 additions and 4 deletions

View File

@@ -1,17 +1,17 @@
import type { Extension } from '@codemirror/state';
export interface ThemeDefinition {
name: string;
id: string;
load(): Promise<Extension>;
}
const themes: ThemeDefinition[] = [
{
name: "abyss",
id: "abyss",
load: async () => (await import("@fsegurai/codemirror-theme-abyss")).abyss
},
{
name: "abcdef",
id: "abcdef",
load: async () => (await import("@fsegurai/codemirror-theme-abcdef")).abcdef
}
]

View File

@@ -8,7 +8,7 @@ import byMimeType from "./syntax_highlighting.js";
import smartIndentWithTab from "./extensions/custom_tab.js";
import type { ThemeDefinition } from "./color_themes.js";
export * from "./color_themes.js";
export { default as ColorThemes, type ThemeDefinition } from "./color_themes.js";
type ContentChangedListener = () => void;