Path: blob/master/node_modules/@protobufjs/pool/index.d.ts
2591 views
export = pool;12/**3* An allocator as used by {@link util.pool}.4* @typedef PoolAllocator5* @type {function}6* @param {number} size Buffer size7* @returns {Uint8Array} Buffer8*/9type PoolAllocator = (size: number) => Uint8Array;1011/**12* A slicer as used by {@link util.pool}.13* @typedef PoolSlicer14* @type {function}15* @param {number} start Start offset16* @param {number} end End offset17* @returns {Uint8Array} Buffer slice18* @this {Uint8Array}19*/20type PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array;2122/**23* A general purpose buffer pool.24* @memberof util25* @function26* @param {PoolAllocator} alloc Allocator27* @param {PoolSlicer} slice Slicer28* @param {number} [size=8192] Slab size29* @returns {PoolAllocator} Pooled allocator30*/31declare function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator;323334