Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / @protobufjs / pool / index.d.ts
diff --git a/legacy-libs/@protobufjs/pool/index.d.ts b/legacy-libs/@protobufjs/pool/index.d.ts
new file mode 100644 (file)
index 0000000..465559c
--- /dev/null
@@ -0,0 +1,32 @@
+export = pool;\r
+\r
+/**\r
+ * An allocator as used by {@link util.pool}.\r
+ * @typedef PoolAllocator\r
+ * @type {function}\r
+ * @param {number} size Buffer size\r
+ * @returns {Uint8Array} Buffer\r
+ */\r
+type PoolAllocator = (size: number) => Uint8Array;\r
+\r
+/**\r
+ * A slicer as used by {@link util.pool}.\r
+ * @typedef PoolSlicer\r
+ * @type {function}\r
+ * @param {number} start Start offset\r
+ * @param {number} end End offset\r
+ * @returns {Uint8Array} Buffer slice\r
+ * @this {Uint8Array}\r
+ */\r
+type PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array;\r
+\r
+/**\r
+ * A general purpose buffer pool.\r
+ * @memberof util\r
+ * @function\r
+ * @param {PoolAllocator} alloc Allocator\r
+ * @param {PoolSlicer} slice Slicer\r
+ * @param {number} [size=8192] Slab size\r
+ * @returns {PoolAllocator} Pooled allocator\r
+ */\r
+declare function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator;\r