Skip to content

DocumentReader

Defined in: src/core/ir/adapters.ts:31

A synchronous reader for one source format (ir-design §7). All async I/O — font fetching, resource loading — lives in the conversion facade, not here.

The adapter contracts may change until they stabilize against three or more adapters.

TDoc = FlowDoc

readonly id: string

Defined in: src/core/ir/adapters.ts:33

Format id: ‘docx’, ‘xlsx’, ‘pdf’, …


readonly produces: "flow" | "page" | "sheet"

Defined in: src/core/ir/adapters.ts:35

Which tree this reader produces (‘sheet’ projects to flow at the boundary).


read: (bytes, opts?) => ReadResult<TDoc>

Defined in: src/core/ir/adapters.ts:40

Uint8Array

ReadOptions

ReadResult<TDoc>


sniff: (bytes) => boolean

Defined in: src/core/ir/adapters.ts:39

Cheap format detection (magic bytes / container markers).

Uint8Array

boolean


readonly supports: ReadonlySet<string>

Defined in: src/core/ir/adapters.ts:37

Feature vocabulary this reader understands (capability matrix source).