import { parseNotebookToc } from "./parse"; import type { Notebook, Section } from "./types"; export { parseNotebookToc }; export * from "./types"; export type OneNoteFileType = "section" | "notebook" | "unknown"; /** * Thrown when a section is encrypted and cannot be imported without a password. */ export declare class OneNoteEncryptedError extends Error { readonly filename: string; readonly encryptionXml: string; constructor(filename: string, encryptionXml: string, message?: string); } /** * Sniffs the type of a OneNote file by reading the file type GUID from the * file header without fully parsing it. */ export declare function sniffOneNoteFileType(data: Uint8Array): OneNoteFileType; /** * Parses a single OneNote section (.one) file. * * @param data the raw bytes of the .one file * @param filename the name of the file, used as fallback for the display name * @param password optional password for encrypted sections */ export declare function parseOneNoteSection(data: Uint8Array, filename: string, password?: string): Promise
; export type ResolveFile = (name: string) => Uint8Array | undefined; /** * Parses the table of contents of a OneNote notebook (.onetoc2) file. * Returns the section/group entry names in the order they appear in the * notebook along with the notebook's color. */ export declare function parseOneNoteNotebookToc(data: Uint8Array): { entries: string[]; color?: { alpha: number; r: number; g: number; b: number; }; }; /** * Parses a OneNote notebook table of contents (.onetoc2) file. * * @param data the raw bytes of the .onetoc2 file * @param resolveFile a function that resolves the bytes of a section file by * its (sanitized) name; returns undefined when a file cannot be resolved in * which case the entry is skipped */ export declare function parseOneNoteNotebook(data: Uint8Array, resolveFile: ResolveFile, password?: string): Promise;