/** * Abstract general purpose reader. * readAs() should be implemented in concrete classes. * The motivation for having it abstract is that browser javascript * is relying on Typed Arrays, but nodejs - on Buffer. */ export declare abstract class Reader { private C; private readonly instance; private readonly protocolTable; /** * Constructor. * @param {T} C - serializable class (should have open constructor). */ constructor(C: { new (): T; }); /** * Returns an instance of type {T} composed from the binary message. * @param {M} msg0 - binary message. * @returns {T} */ read(msg0: M): T; /** * Reads `size` bytes of the binary message of given `type` starting with position `start`. * Should be implemented in child classes. * @param {M} msg0 - binary message. * @param {string} type - type of data encoded in bytes between start and start + size. * @param {number} start - starting position. * @param {number} size - message size. */ protected abstract readAs(msg0: M, type: string, start: number, size: number): T; }