/** The object type of a CFB directory entry (MS-CFB §2.6.1). */ export type CfbEntryType = 'root' | 'storage' | 'stream' | 'unknown'; /** One CFB directory entry: its name, type, starting sector and byte size. */ export interface CfbEntry { readonly name: string; readonly type: CfbEntryType; readonly startSector: number; readonly size: number; } /** Error thrown for a malformed or unsupported compound file. */ export declare class CfbError extends Error { } /** A parsed compound file: its directory entries plus stream-access helpers. */ export interface Cfb { /** Every directory entry, in directory order (index 0 is the root storage). */ readonly entries: ReadonlyArray; /** Read a stream's bytes by entry name (case-insensitive), or undefined. */ readStream: (name: string) => Uint8Array | undefined; /** Whether a stream entry with that name exists (case-insensitive). */ hasStream: (name: string) => boolean; } /** * Cheap magic-byte probe — the first eight bytes are the CFB signature. Shared * by the legacy readers' sniff and by `OpcPackage` to tell an OLE file from a * ZIP. */ export declare function isCfb(bytes: Uint8Array): boolean; /** * Parse a compound file's bytes into a {@link Cfb}: read the header, FAT (via the * DIFAT), directory and mini-FAT, and expose its streams by name. The * main-document storage's own streams win a name clash over an embedded object's * (MS-CFB §2.6). Every sector index is bounds-checked and every chain walk is * capped, so a crafted container aborts rather than looping or exhausting memory. * * @throws CfbError on a bad signature, an unsupported sector layout, or a * corrupt/cyclic FAT, mini-FAT or DIFAT chain. */ export declare function openCfb(bytes: Uint8Array): Cfb;