Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jajbshjahavahh
GitHub Repository: jajbshjahavahh/Gojo-Satoru
Path: blob/master/node_modules/@protobufjs/pool/index.d.ts
2591 views
1
export = pool;
2
3
/**
4
* An allocator as used by {@link util.pool}.
5
* @typedef PoolAllocator
6
* @type {function}
7
* @param {number} size Buffer size
8
* @returns {Uint8Array} Buffer
9
*/
10
type PoolAllocator = (size: number) => Uint8Array;
11
12
/**
13
* A slicer as used by {@link util.pool}.
14
* @typedef PoolSlicer
15
* @type {function}
16
* @param {number} start Start offset
17
* @param {number} end End offset
18
* @returns {Uint8Array} Buffer slice
19
* @this {Uint8Array}
20
*/
21
type PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array;
22
23
/**
24
* A general purpose buffer pool.
25
* @memberof util
26
* @function
27
* @param {PoolAllocator} alloc Allocator
28
* @param {PoolSlicer} slice Slicer
29
* @param {number} [size=8192] Slab size
30
* @returns {PoolAllocator} Pooled allocator
31
*/
32
declare function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator;
33
34