/** * Pool for buffer allocations, as seen in [Node.js](https://github.com/nodejs/node/blob/main/lib/buffer.js) */ export declare class BufferPool { #private; readonly size: number; constructor(size: number); alloc(size: number): Uint8Array; } /** * Override the default buffer pool size (the one used by `u8.alloc`) */ export declare function setDefaultPoolSize(size: number): void; /** * Allocate a new buffer of the given size. * For smaller sizes, the allocation will be from the default buffer pool, * similar to `Buffer.alloc` in Node.js */ export declare function alloc(size: number): Uint8Array; /** * Shortcut for allocating a buffer and filling it with the given data, * similar to `Buffer.from` in Node.js */ export declare function allocWith(init: ArrayLike): Uint8Array;