@ad-sdk/bgd 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101,6 +101,18 @@ export declare class MemoryBuffer<T extends ArrayBuffer | SharedArrayBuffer = Ar
101
101
  * invalidate the disposal logic resulting in a memory leak.
102
102
  */
103
103
  valueOf(secure: false): Buffer | null;
104
+ /**
105
+ * **ATTENTION:** If you use this function make sure that
106
+ * will not create an external reference of the buffer, or it'll
107
+ * invalidate the disposal logic resulting in a memory leak.
108
+ */
109
+ $ref(secure?: true): T;
110
+ /**
111
+ * **ATTENTION:** If you use this function make sure that
112
+ * will not create an external reference of the buffer, or it'll
113
+ * invalidate the disposal logic resulting in a memory leak.
114
+ */
115
+ $ref(secure: false): T | null;
104
116
  /**
105
117
  * Clear current buffer and free allocated memory.
106
118
  *
@@ -360,6 +360,28 @@ class MemoryBuffer {
360
360
  return _classPrivateFieldGet(_BufRef, this);
361
361
  }
362
362
 
363
+ /**
364
+ * **ATTENTION:** If you use this function make sure that
365
+ * will not create an external reference of the buffer, or it'll
366
+ * invalidate the disposal logic resulting in a memory leak.
367
+ */
368
+
369
+ /**
370
+ * **ATTENTION:** If you use this function make sure that
371
+ * will not create an external reference of the buffer, or it'll
372
+ * invalidate the disposal logic resulting in a memory leak.
373
+ */
374
+
375
+ $ref(secure) {
376
+ if (_classPrivateFieldGet(_BufRef, this) == null) {
377
+ if (secure !== false) {
378
+ _assertClassBrand(_MemoryBuffer_brand, this, _CheckDisposed).call(this);
379
+ }
380
+ return null;
381
+ }
382
+ return _classPrivateFieldGet(_BufRef, this).buffer;
383
+ }
384
+
363
385
  /**
364
386
  * Clear current buffer and free allocated memory.
365
387
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ad-sdk/bgd",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "main": "index.js",
5
5
  "license": "BSD-3-Clause",
6
6
  "repository": {