import { IReadable, ISyncReadable, ISyncWritable, IWritable } from './types.js'; /** a byte buffer implementing fuman readable/writable streams */ export declare class Bytes implements IReadable, IWritable, ISyncReadable, ISyncWritable { #private; constructor(buf: Uint8Array); static alloc(capacity?: number): Bytes; static from(data: Uint8Array): Bytes; /** Total number of bytes in the underlying buffer */ get capacity(): number; /** Number of bytes available to be read */ get available(): number; /** Number of bytes written */ get written(): number; readSync(bytes: number): Uint8Array; read(into: Uint8Array): Promise; writeSync(size: number): Uint8Array; disposeWriteSync(written?: number): void; write(bytes: Uint8Array): Promise; /** * get the "result" of the buffer, i.e. everything that has been written so far, * but not yet read * * **Note**: this method returns a view into the underlying buffer, and does advance the read cursor */ result(): Uint8Array; /** Reclaim memory by only keeping the yet-unread data */ reclaim(): void; /** Mark last n bytes as unread */ rewind(n: number): void; /** reset the read/write cursors */ reset(): void; }