Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / @protobufjs / pool / index.d.ts
1 export = pool;\r
2 \r
3 /**\r
4  * An allocator as used by {@link util.pool}.\r
5  * @typedef PoolAllocator\r
6  * @type {function}\r
7  * @param {number} size Buffer size\r
8  * @returns {Uint8Array} Buffer\r
9  */\r
10 type PoolAllocator = (size: number) => Uint8Array;\r
11 \r
12 /**\r
13  * A slicer as used by {@link util.pool}.\r
14  * @typedef PoolSlicer\r
15  * @type {function}\r
16  * @param {number} start Start offset\r
17  * @param {number} end End offset\r
18  * @returns {Uint8Array} Buffer slice\r
19  * @this {Uint8Array}\r
20  */\r
21 type PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array;\r
22 \r
23 /**\r
24  * A general purpose buffer pool.\r
25  * @memberof util\r
26  * @function\r
27  * @param {PoolAllocator} alloc Allocator\r
28  * @param {PoolSlicer} slice Slicer\r
29  * @param {number} [size=8192] Slab size\r
30  * @returns {PoolAllocator} Pooled allocator\r
31  */\r
32 declare function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator;\r