feat: render rich OneNote pages and resources
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user