wangdl f4e800538b test: remove redundant singleton test in MarkedReadStore tests
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-18 13:03:18 +08:00

105 lines
2.5 KiB
Plaintext

namespace zx_document {};
[Error]
enum DocumentError {
"FileNotFound",
"UnsupportedFormat",
"ParseError",
"InvalidEncoding",
"IoError",
};
[Enum]
interface MaterialType {
Markdown();
Text();
Pdf();
Image();
Epub();
Word();
Excel();
PowerPoint();
Unknown();
};
[Enum]
interface PreviewMode {
NativeReader();
PlatformPreview();
ExternalOpen();
Unsupported();
};
dictionary DocumentInfo {
string material_id;
string title;
MaterialType material_type;
PreviewMode preview_mode;
u64 file_size;
u32? page_count;
u32? word_count;
string? created_at;
};
[Enum]
interface ReadingPosition {
Markdown(string block_id, f32 scroll_progress);
Text(u32 line_number, f32 scroll_progress);
Pdf(u32 page_number, f32 page_progress, f32 overall_progress);
Image(f32 zoom_scale, f32 offset_x, f32 offset_y);
Epub(string chapter_id, f32 chapter_progress, f32 overall_progress);
Unknown();
};
[Enum]
interface ReadingEvent {
MaterialOpened(string material_id, i64 timestamp_ms);
MaterialClosed(string material_id, i64 timestamp_ms, u32 active_seconds);
PositionChanged(string material_id, ReadingPosition position, i64 timestamp_ms);
Heartbeat(string material_id, u32 active_seconds, ReadingPosition? position, i64 timestamp_ms);
MarkedAsRead(string material_id, i64 timestamp_ms);
};
[Enum]
interface NoteAnchor {
Material(string material_id);
MarkdownBlock(string material_id, string block_id);
TextLine(string material_id, u32 line_number);
PdfPage(string material_id, u32 page_number);
Image(string material_id);
EpubChapter(string material_id, string chapter_id);
KnowledgeItem(string knowledge_item_id);
};
dictionary ImageMeta {
u32 width;
u32 height;
string format;
u64 file_size;
};
dictionary SearchResult {
string block_id;
u32? line_number;
string snippet;
u64 match_start;
u64 match_end;
};
dictionary TextStats {
u32 line_count;
u32 word_count;
};
[Enum]
interface DocumentBlock {
Heading(string id, u8 level, string text);
Paragraph(string id, string text);
List(string id, boolean ordered, sequence<string> items);
CodeBlock(string id, string? language, string code);
Quote(string id, string text);
Table(string id, sequence<string> headers, sequence<sequence<string>> rows);
ImageBlock(string id, string src, string? alt);
HorizontalRule(string id);
};