refactor: define EditorFile interface for improved type safety in DEFAULT_FILES

This commit is contained in:
ngc2207 2025-01-08 16:37:51 +08:00
parent 7ecc17e8a6
commit 79cbc92a87

View File

@ -4,14 +4,13 @@ export const DEFAULT_EDITOR_THEME = "one-dark-pro";
export const DEFAULT_EDITOR_LANGUAGE: SupportedEditorLanguage = "c";
export const DEFAULT_FILES: Record<
SupportedEditorLanguage,
{
path: string;
language: SupportedEditorLanguage;
value: string;
}
> = {
export interface EditorFile {
path: string;
language: SupportedEditorLanguage;
value: string;
}
export const DEFAULT_FILES: Record<SupportedEditorLanguage, EditorFile> = {
c: {
path: "playground/main.c",
language: "c",