/** * The reader module * * @mermaid * * @module reader */ import { BinaryReader } from './cursor.ts'; import { type InstantiableObject } from './types.ts'; import { type BinspectorMetaClass } from './bindump.ts'; interface BinreadOptions { ctx: Record; meta: Partial; } /** * `binread` transforms a Buffer into an object based on a binspector * definition * * @param {BinaryReader | ArrayBufferLike | ArrayBufferView} content Byte array view to be transformed into an object. * @param {InstantiableObject | Target} target Class definition or class instance containing an object definition. * @param {BinreadOptions} opt * * @returns {Target} The byte array content transformed into an object. * * @throws * If you attempt to read a buffer that reach EOF before fully creating the * `ObjectDefinition`. {@link binread} will throw an error. * You can read field until the `EOF` by using a `Controller` decorator * (see {@link While}, {@link Until}) * * @throws * Throws a "Self refering field" error when you create a relation to the same * `ObjectDefinition` passed in param. * You can create self refering field by using conditionnal decorator. * * @throws * Throws a "ValidationTestFailed" error when a property doesn't match the * validator. */ export declare function binread(content: BinaryReader | ArrayBufferLike | ArrayBufferView, target: InstantiableObject | Target, opt?: Partial): Target; export {};