import { UITestCase } from './index'; /** * 题目难度级别 */ export type QuestionDifficulty = "easy" | "medium" | "hard"; /** * 题目配置 * 由外部调用者传入,包含题目信息、语言限制、代码模板等 */ export interface QuestionConfig { /** 题目标题 */ title?: string; /** 题目描述(支持 HTML) */ description?: string; /** 题目描述 Markdown(可选) */ descriptionMarkdown?: string; /** 题目难度(可选) */ difficulty?: QuestionDifficulty; /** * 支持的语言 ID 列表(可选) * 如果不传,则显示所有语言 * @example ["python", "java", "cpp"] */ supportedLanguages?: string[]; /** * 每种语言的代码模板 * key: 语言 ID * value: 代码模板字符串 * * @example * { * python: "def twoSum(nums, target):\n pass", * java: "class Solution { ... }" * } */ languageTemplates: Record; /** 默认选中的语言(可选) */ defaultLanguage?: string; /** 测试用例列表(可选) */ testCases?: UITestCase[]; /** * 题目函数结构(用于根据参数名生成输入框) */ functionStructure?: { args: Array<{ name: string; type?: string; }>; returnType?: string; }; } /** * Markdown 题目配置(用于左侧题目区的编辑 + 预览) */ export interface QuestionMarkdownOptions { /** 初始内容 */ value?: string; /** 是否显示编辑区(默认 true) */ showEditor?: boolean; /** 是否可编辑(默认 true) */ editable?: boolean; /** 是否显示预览区(默认 true) */ showPreview?: boolean; /** 编辑区占位文案 */ placeholder?: string; /** 内容变化回调 */ onChange?: (value: string) => void; } /** * 语言模板映射 * 简化版配置,只包含语言到模板的映射 */ export type LanguageTemplates = Record; //# sourceMappingURL=question.d.ts.map