统一阶段拼图配置和进度上报,增加同步写入协调与失败重试,优化收集确认及同步反馈,并展示菜单探索进度。补充相关回归测试与字体素材。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
declare module '@/lib/utils/api-common' {
|
|
export type UserDefineFetchStatus = 'success' | 'empty' | 'unauthenticated' | 'error'
|
|
export type StorageBackend = 'auto' | 'yiban' | 'session'
|
|
|
|
export interface StorageOptions {
|
|
backend?: StorageBackend
|
|
}
|
|
|
|
export interface WriteOptions extends StorageOptions {
|
|
critical?: boolean
|
|
bypassQueue?: boolean
|
|
deadlineMs?: number
|
|
silent?: boolean
|
|
}
|
|
|
|
export interface WriteResult {
|
|
success: boolean
|
|
skipped?: boolean
|
|
superseded?: boolean
|
|
code?: number
|
|
message?: string
|
|
attempts?: number
|
|
}
|
|
|
|
export interface UserDefineFetchResult {
|
|
status: UserDefineFetchStatus
|
|
content: string
|
|
code?: number
|
|
message?: string
|
|
}
|
|
|
|
export function setUserDefine(
|
|
lessonId: string | number,
|
|
key: string | number,
|
|
value: string,
|
|
options?: WriteOptions
|
|
): Promise<WriteResult>
|
|
|
|
export function getUserDefineResult(
|
|
lessonId: string | number,
|
|
key: string | number,
|
|
options?: StorageOptions
|
|
): Promise<UserDefineFetchResult>
|
|
|
|
export function parseUserDefineContent<T>(content: string, options?: StorageOptions): T
|
|
|
|
export function setCourseTimeProgress(
|
|
order: number,
|
|
options?: Pick<WriteOptions, 'bypassQueue' | 'deadlineMs'>
|
|
): Promise<WriteResult>
|
|
}
|