From 79cbc92a8746eaf46eb8b325a7f8d8e92a88426a Mon Sep 17 00:00:00 2001 From: ngc2207 Date: Wed, 8 Jan 2025 16:37:51 +0800 Subject: [PATCH] refactor: define EditorFile interface for improved type safety in DEFAULT_FILES --- code-editor/src/config/index.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/code-editor/src/config/index.ts b/code-editor/src/config/index.ts index 5046bf2..0b9e984 100644 --- a/code-editor/src/config/index.ts +++ b/code-editor/src/config/index.ts @@ -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 = { c: { path: "playground/main.c", language: "c",