This commit is contained in:
eric
2026-03-12 00:34:50 -05:00
parent 0c2ccadb6b
commit 5caf970c7e
26 changed files with 1528 additions and 288 deletions

31
lib/content/config.ts Normal file
View File

@@ -0,0 +1,31 @@
/**
* 共享内容模块配置 - 可标准应用到 digital / nomadvip / nomadlms
*/
export type EbookConfig = {
title: string;
backHref: string;
/** 是否需权限,免费则 false */
requireAuth?: boolean;
/** 预计阅读分钟数,用于倒计时/展示 */
estimatedMinutes?: number;
/** 存储 key 前缀,区分项目 */
storagePrefix?: string;
};
export type CourseConfig = {
courseId: string;
courseHomeHref: string;
payHref: string;
/** 试看:[[moduleIndex, lessonIndex], ...] 或 (m,l)=>boolean */
freeTrial?: [number, number][] | ((m: number, l: number) => boolean);
/** 视频进度存储前缀 */
videoStoragePrefix?: string;
/** 学习进度存储前缀 */
learningStoragePrefix?: string;
};
export type ContentConfig = {
ebook: EbookConfig;
course: CourseConfig;
};