feat: render rich OneNote pages and resources

This commit is contained in:
2026-07-22 19:18:42 +02:00
parent 141be03f5e
commit 1750a6b5c3
12 changed files with 1252 additions and 64 deletions

View File

@@ -1,4 +1,5 @@
import type { ParserDiagnostic } from './diagnostics.js';
import type { OneNoteContentBlock } from '../one/content-model.js';
export interface OneNotePageSummaryDto {
id: string;
@@ -11,21 +12,28 @@ export interface OneNotePageSummaryDto {
textPreview: string;
}
export type OneNoteContentBlockDto =
| { kind: 'text'; text: string }
| { kind: 'line-break' }
| { kind: 'link'; text: string; href?: string }
| {
kind: 'unsupported';
sourceKind: string;
description: string;
};
/** Serializable, inert page content. Resource bytes remain in the worker. */
export type OneNoteContentBlockDto = OneNoteContentBlock;
export interface OneNotePageDto extends OneNotePageSummaryDto {
blocks: OneNoteContentBlockDto[];
diagnostics: ParserDiagnostic[];
}
export interface OneNoteResourceDto {
id: string;
kind: 'image' | 'attachment';
filename?: string;
extension?: string;
mediaType: string;
browserRenderable: boolean;
size: number;
}
export interface OneNoteResourcePayloadDto extends OneNoteResourceDto {
bytes: ArrayBuffer;
}
export interface OneNoteSectionDto {
format: 'one';
sourceName: string;