Type Alias: IsoBoxReadConfig<V>
type IsoBoxReadConfig<V> = object & ([V] extends [bigint] ? object : object);Defined in: IsoBoxReadConfig.ts:14
Configuration for readIsoBoxes and createIsoBoxReadCursor.
The type parameter V is the type of every 64-bit integer field that the built-in readers return. TypeScript infers V from the return type of the int64 function. The int64 option is optional for number fields and required for bigint fields.
Type Parameters
V
V extends IsoInt64 = number
Type Declaration
readers?
readers?: NoInfer<IsoBoxReaderMap<V>>;Map of each box type to the reader of that box.
truncated?
truncated?: "stop" | "throw";What a function that reads a list of boxes does before a truncated box. The default is 'stop'. With 'stop', the function stops before the truncated box and throws no error. With 'throw', the function throws a RangeError.
A box is truncated if the data ends inside the box, or if its size is below its header size. So 1 to 7 bytes after the last box of a list are also a truncated box. A box with size 0 extends to the end of its list and is not truncated.
The option applies to readIsoBoxes, readChildBoxes, nextIsoBox, iterateChildBoxes, seekIsoBox, and seekIsoBoxes. Each cursor that these functions create has the option of its input. readChildBoxes with a count does not read the bytes after the last box of the count.
Do not use 'throw' for partial data. A box that the download has not finished is a truncated box.