@dxos/random-access-storage 0.8.3-staging.0fa589b → 0.8.4-main.1da679c

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.
@@ -37,9 +37,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
37
37
  mod
38
38
  ));
39
39
 
40
- // node_modules/.pnpm/random-access-idb@1.2.2_patch_hash=mqfhtwnltd5kq5s4kb4gk7k2k4/node_modules/random-access-idb/lib/blocks.js
40
+ // ../../../node_modules/.pnpm/random-access-idb@1.2.2_patch_hash=207ec2404ef8b5e9e6d9de8ce83586d215ef77b94a7d0cadced03125874a1d9e/node_modules/random-access-idb/lib/blocks.js
41
41
  var require_blocks = __commonJS({
42
- "node_modules/.pnpm/random-access-idb@1.2.2_patch_hash=mqfhtwnltd5kq5s4kb4gk7k2k4/node_modules/random-access-idb/lib/blocks.js"(exports, module) {
42
+ "../../../node_modules/.pnpm/random-access-idb@1.2.2_patch_hash=207ec2404ef8b5e9e6d9de8ce83586d215ef77b94a7d0cadced03125874a1d9e/node_modules/random-access-idb/lib/blocks.js"(exports, module) {
43
43
  module.exports = function(size, start, end) {
44
44
  var result = [];
45
45
  for (var n = Math.floor(start / size) * size; n < end; n += size) {
@@ -54,9 +54,9 @@ var require_blocks = __commonJS({
54
54
  }
55
55
  });
56
56
 
57
- // node_modules/.pnpm/random-access-idb@1.2.2_patch_hash=mqfhtwnltd5kq5s4kb4gk7k2k4/node_modules/random-access-idb/index.js
57
+ // ../../../node_modules/.pnpm/random-access-idb@1.2.2_patch_hash=207ec2404ef8b5e9e6d9de8ce83586d215ef77b94a7d0cadced03125874a1d9e/node_modules/random-access-idb/index.js
58
58
  var require_random_access_idb = __commonJS({
59
- "node_modules/.pnpm/random-access-idb@1.2.2_patch_hash=mqfhtwnltd5kq5s4kb4gk7k2k4/node_modules/random-access-idb/index.js"(exports, module) {
59
+ "../../../node_modules/.pnpm/random-access-idb@1.2.2_patch_hash=207ec2404ef8b5e9e6d9de8ce83586d215ef77b94a7d0cadced03125874a1d9e/node_modules/random-access-idb/index.js"(exports, module) {
60
60
  var RandomAccess = import$random_access_storage;
61
61
  var inherits = import$inherits;
62
62
  var nextTick = import$next_tick;
@@ -228,27 +228,32 @@ var require_random_access_idb = __commonJS({
228
228
  }
229
229
  });
230
230
 
231
- // packages/common/random-access-storage/src/common/abstract-storage.ts
231
+ // src/common/abstract-storage.ts
232
232
  import { join as join2 } from "@dxos/node-std/path";
233
233
  import { inspect } from "@dxos/node-std/util";
234
234
  import { inspectObject } from "@dxos/debug";
235
235
  import { log as log2 } from "@dxos/log";
236
236
 
237
- // packages/common/random-access-storage/src/common/utils.ts
237
+ // src/common/utils.ts
238
238
  import { join } from "@dxos/node-std/path";
239
239
  var stringDiff = (first, second) => first.split(second).join("");
240
240
  var getFullPath = (root, path) => join(root, stringDiff(path, root));
241
241
 
242
- // packages/common/random-access-storage/src/common/directory.ts
243
- var Directory = class _Directory {
244
- constructor({ type, path, list, getOrCreateFile, remove, onFlush }) {
245
- this.type = type;
246
- this.path = path;
247
- this._list = list;
248
- this._getOrCreateFile = getOrCreateFile;
249
- this._remove = remove;
250
- this._onFlush = onFlush;
242
+ // src/common/directory.ts
243
+ function _define_property(obj, key, value) {
244
+ if (key in obj) {
245
+ Object.defineProperty(obj, key, {
246
+ value,
247
+ enumerable: true,
248
+ configurable: true,
249
+ writable: true
250
+ });
251
+ } else {
252
+ obj[key] = value;
251
253
  }
254
+ return obj;
255
+ }
256
+ var Directory = class _Directory {
252
257
  toString() {
253
258
  return `Directory(${JSON.stringify({
254
259
  type: this.type,
@@ -288,12 +293,26 @@ var Directory = class _Directory {
288
293
  async delete() {
289
294
  await this._remove();
290
295
  }
296
+ constructor({ type, path, list, getOrCreateFile, remove, onFlush }) {
297
+ _define_property(this, "type", void 0);
298
+ _define_property(this, "path", void 0);
299
+ _define_property(this, "_list", void 0);
300
+ _define_property(this, "_getOrCreateFile", void 0);
301
+ _define_property(this, "_remove", void 0);
302
+ _define_property(this, "_onFlush", void 0);
303
+ this.type = type;
304
+ this.path = path;
305
+ this._list = list;
306
+ this._getOrCreateFile = getOrCreateFile;
307
+ this._remove = remove;
308
+ this._onFlush = onFlush;
309
+ }
291
310
  };
292
311
 
293
- // packages/common/random-access-storage/src/common/file.ts
312
+ // src/common/file.ts
294
313
  import pify from "pify";
295
314
  import { log } from "@dxos/log";
296
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/common/random-access-storage/src/common/file.ts";
315
+ var __dxlog_file = "/__w/dxos/dxos/packages/common/random-access-storage/src/common/file.ts";
297
316
  var MAX_STORAGE_OPERATION_TIME = 50;
298
317
  var pifyFields = (object, type, fields) => {
299
318
  for (const field of fields) {
@@ -338,15 +357,24 @@ var wrapFile = (native, type) => {
338
357
  });
339
358
  };
340
359
 
341
- // packages/common/random-access-storage/src/common/abstract-storage.ts
342
- var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/common/random-access-storage/src/common/abstract-storage.ts";
343
- var AbstractStorage = class {
344
- // TODO(burdon): Make required.
345
- constructor(path) {
346
- this.path = path;
347
- this._files = /* @__PURE__ */ new Map();
360
+ // src/common/abstract-storage.ts
361
+ function _define_property2(obj, key, value) {
362
+ if (key in obj) {
363
+ Object.defineProperty(obj, key, {
364
+ value,
365
+ enumerable: true,
366
+ configurable: true,
367
+ writable: true
368
+ });
369
+ } else {
370
+ obj[key] = value;
348
371
  }
349
- [inspect.custom]() {
372
+ return obj;
373
+ }
374
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/common/random-access-storage/src/common/abstract-storage.ts";
375
+ var _inspect_custom = inspect.custom;
376
+ var AbstractStorage = class {
377
+ [_inspect_custom]() {
350
378
  return inspectObject(this);
351
379
  }
352
380
  toJSON() {
@@ -375,7 +403,7 @@ var AbstractStorage = class {
375
403
  try {
376
404
  log2.info("Erasing all data...", void 0, {
377
405
  F: __dxlog_file2,
378
- L: 60,
406
+ L: 61,
379
407
  S: this,
380
408
  C: (f, a) => f(...a)
381
409
  });
@@ -384,14 +412,14 @@ var AbstractStorage = class {
384
412
  await this._destroy();
385
413
  log2("Erased...", void 0, {
386
414
  F: __dxlog_file2,
387
- L: 64,
415
+ L: 65,
388
416
  S: this,
389
417
  C: (f, a) => f(...a)
390
418
  });
391
419
  } catch (err) {
392
420
  log2.catch(err, void 0, {
393
421
  F: __dxlog_file2,
394
- L: 66,
422
+ L: 67,
395
423
  S: this,
396
424
  C: (f, a) => f(...a)
397
425
  });
@@ -449,7 +477,7 @@ var AbstractStorage = class {
449
477
  async _closeFilesInPath(path) {
450
478
  await Promise.all(Array.from((await this._getFiles(path)).values()).map((file) => file.close().catch((err) => log2.catch(err, void 0, {
451
479
  F: __dxlog_file2,
452
- L: 134,
480
+ L: 135,
453
481
  S: this,
454
482
  C: (f, a) => f(...a)
455
483
  }))));
@@ -462,20 +490,27 @@ var AbstractStorage = class {
462
490
  await Promise.all(Array.from(await this._getFiles(path)).map(([path2, file]) => {
463
491
  return file.destroy().then(() => this._files.delete(path2)).catch((err) => log2.error(err.message, void 0, {
464
492
  F: __dxlog_file2,
465
- L: 149,
493
+ L: 150,
466
494
  S: this,
467
495
  C: (f, a) => f(...a)
468
496
  }));
469
497
  }));
470
498
  }
499
+ // TODO(burdon): Make required.
500
+ constructor(path) {
501
+ _define_property2(this, "path", void 0);
502
+ _define_property2(this, "_files", void 0);
503
+ this.path = path;
504
+ this._files = /* @__PURE__ */ new Map();
505
+ }
471
506
  };
472
507
 
473
- // packages/common/random-access-storage/src/common/memory-storage.ts
508
+ // src/common/memory-storage.ts
474
509
  import ram from "random-access-memory";
475
510
  import { arrayToBuffer } from "@dxos/util";
476
511
 
477
- // packages/common/random-access-storage/src/common/storage.ts
478
- var StorageType = /* @__PURE__ */ function(StorageType2) {
512
+ // src/common/storage.ts
513
+ var StorageType = /* @__PURE__ */ (function(StorageType2) {
479
514
  StorageType2["RAM"] = "ram";
480
515
  StorageType2["IDB"] = "idb";
481
516
  StorageType2["CHROME"] = "chrome";
@@ -483,14 +518,23 @@ var StorageType = /* @__PURE__ */ function(StorageType2) {
483
518
  StorageType2["NODE"] = "node";
484
519
  StorageType2["WEBFS"] = "webfs";
485
520
  return StorageType2;
486
- }({});
521
+ })({});
487
522
 
488
- // packages/common/random-access-storage/src/common/memory-storage.ts
489
- var MemoryStorage = class extends AbstractStorage {
490
- constructor() {
491
- super(...arguments);
492
- this.type = StorageType.RAM;
523
+ // src/common/memory-storage.ts
524
+ function _define_property3(obj, key, value) {
525
+ if (key in obj) {
526
+ Object.defineProperty(obj, key, {
527
+ value,
528
+ enumerable: true,
529
+ configurable: true,
530
+ writable: true
531
+ });
532
+ } else {
533
+ obj[key] = value;
493
534
  }
535
+ return obj;
536
+ }
537
+ var MemoryStorage = class extends AbstractStorage {
494
538
  _createFile(path, filename) {
495
539
  return this._patchFile(ram());
496
540
  }
@@ -520,21 +564,30 @@ var MemoryStorage = class extends AbstractStorage {
520
564
  used
521
565
  };
522
566
  }
567
+ constructor(...args) {
568
+ super(...args), _define_property3(this, "type", StorageType.RAM);
569
+ }
523
570
  };
524
571
 
525
- // packages/common/random-access-storage/src/browser/idb-storage.ts
572
+ // src/browser/idb-storage.ts
526
573
  var import_random_access_idb = __toESM(require_random_access_idb(), 1);
527
574
  import { invariant } from "@dxos/invariant";
528
- var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/common/random-access-storage/src/browser/idb-storage.ts";
575
+ function _define_property4(obj, key, value) {
576
+ if (key in obj) {
577
+ Object.defineProperty(obj, key, {
578
+ value,
579
+ enumerable: true,
580
+ configurable: true,
581
+ writable: true
582
+ });
583
+ } else {
584
+ obj[key] = value;
585
+ }
586
+ return obj;
587
+ }
588
+ var __dxlog_file3 = "/__w/dxos/dxos/packages/common/random-access-storage/src/browser/idb-storage.ts";
529
589
  var DELIM = "\0";
530
590
  var IDbStorage = class extends AbstractStorage {
531
- constructor(path) {
532
- super(path);
533
- this.type = StorageType.IDB;
534
- this._store = "data";
535
- this._initialized = false;
536
- this._fileStorage = this._createFileStorage(path);
537
- }
538
591
  _createFileStorage(path) {
539
592
  const database = (0, import_random_access_idb.default)(path);
540
593
  let res;
@@ -619,28 +672,40 @@ var IDbStorage = class extends AbstractStorage {
619
672
  }
620
673
  return super._getFiles(path);
621
674
  }
675
+ constructor(path) {
676
+ super(path), _define_property4(this, "type", StorageType.IDB), _define_property4(this, "_db", void 0), _define_property4(this, "_store", "data"), _define_property4(this, "_initialized", false), _define_property4(this, "_fileStorage", void 0);
677
+ this._fileStorage = this._createFileStorage(path);
678
+ }
622
679
  };
623
680
 
624
- // packages/common/random-access-storage/src/browser/web-fs.ts
681
+ // src/browser/web-fs.ts
625
682
  import { EventEmitter } from "@dxos/node-std/events";
626
683
  import { callbackify } from "@dxos/node-std/util";
627
684
  import { synchronized } from "@dxos/async";
628
685
  import { invariant as invariant2 } from "@dxos/invariant";
629
686
  import { log as log3 } from "@dxos/log";
630
687
  import { TimeSeriesCounter, trace } from "@dxos/tracing";
688
+ function _define_property5(obj, key, value) {
689
+ if (key in obj) {
690
+ Object.defineProperty(obj, key, {
691
+ value,
692
+ enumerable: true,
693
+ configurable: true,
694
+ writable: true
695
+ });
696
+ } else {
697
+ obj[key] = value;
698
+ }
699
+ return obj;
700
+ }
631
701
  function _ts_decorate(decorators, target, key, desc) {
632
702
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
633
703
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
634
704
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
635
705
  return c > 3 && r && Object.defineProperty(target, key, r), r;
636
706
  }
637
- var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/common/random-access-storage/src/browser/web-fs.ts";
707
+ var __dxlog_file4 = "/__w/dxos/dxos/packages/common/random-access-storage/src/browser/web-fs.ts";
638
708
  var WebFS = class {
639
- constructor(path) {
640
- this.path = path;
641
- this._files = /* @__PURE__ */ new Map();
642
- this.type = StorageType.WEBFS;
643
- }
644
709
  get size() {
645
710
  return this._files.size;
646
711
  }
@@ -670,7 +735,7 @@ var WebFS = class {
670
735
  this._root = await navigator.storage.getDirectory();
671
736
  invariant2(this._root, "Root is undefined", {
672
737
  F: __dxlog_file4,
673
- L: 73,
738
+ L: 74,
674
739
  S: this,
675
740
  A: [
676
741
  "this._root",
@@ -718,7 +783,7 @@ var WebFS = class {
718
783
  await Promise.all(Array.from(this._getFiles(path)).map(async ([path2, file]) => {
719
784
  await file.destroy().catch((err) => log3.warn(err, void 0, {
720
785
  F: __dxlog_file4,
721
- L: 116,
786
+ L: 117,
722
787
  S: this,
723
788
  C: (f, a) => f(...a)
724
789
  }));
@@ -735,7 +800,7 @@ var WebFS = class {
735
800
  err
736
801
  }, {
737
802
  F: __dxlog_file4,
738
- L: 126,
803
+ L: 127,
739
804
  S: this,
740
805
  C: (f, a) => f(...a)
741
806
  }));
@@ -750,7 +815,7 @@ var WebFS = class {
750
815
  e
751
816
  }, {
752
817
  F: __dxlog_file4,
753
- L: 136,
818
+ L: 137,
754
819
  S: this,
755
820
  C: (f, a) => f(...a)
756
821
  }));
@@ -786,66 +851,20 @@ var WebFS = class {
786
851
  used
787
852
  };
788
853
  }
854
+ constructor(path) {
855
+ _define_property5(this, "path", void 0);
856
+ _define_property5(this, "_files", void 0);
857
+ _define_property5(this, "type", void 0);
858
+ _define_property5(this, "_root", void 0);
859
+ this.path = path;
860
+ this._files = /* @__PURE__ */ new Map();
861
+ this.type = StorageType.WEBFS;
862
+ }
789
863
  };
790
864
  _ts_decorate([
791
865
  synchronized
792
866
  ], WebFS.prototype, "_initialize", null);
793
867
  var WebFile = class extends EventEmitter {
794
- constructor({ fileName, file, destroy }) {
795
- super();
796
- /**
797
- * Current view of the file contents.
798
- */
799
- this._buffer = null;
800
- this._loadBufferPromise = null;
801
- this._flushScheduled = false;
802
- this._flushPromise = Promise.resolve();
803
- /**
804
- * Used to discard unnecessary scheduled flushes.
805
- * If _flushNow() is called with a lower sequence number it should early exit.
806
- */
807
- this._flushSequence = 0;
808
- //
809
- // Metrics
810
- //
811
- this._flushes = new TimeSeriesCounter();
812
- this._operations = new TimeSeriesCounter();
813
- this._reads = new TimeSeriesCounter();
814
- this._readBytes = new TimeSeriesCounter();
815
- this._writes = new TimeSeriesCounter();
816
- this._writeBytes = new TimeSeriesCounter();
817
- this.type = StorageType.WEBFS;
818
- //
819
- // random-access-storage library compatibility
820
- //
821
- // TODO(dmaretskyi): Are those all needed?
822
- this.opened = true;
823
- this.suspended = false;
824
- this.closed = false;
825
- this.unlinked = false;
826
- this.writing = false;
827
- this.readable = true;
828
- this.writable = true;
829
- this.deletable = true;
830
- this.truncatable = true;
831
- this.statable = true;
832
- this.destroyed = false;
833
- this.directory = "";
834
- // TODO(dmaretskyi): is this used?
835
- this.filename = "";
836
- this.native = {
837
- write: callbackify(this.write.bind(this)),
838
- read: callbackify(this.read.bind(this)),
839
- del: callbackify(this.del.bind(this)),
840
- stat: callbackify(this.stat.bind(this)),
841
- destroy: callbackify(this.destroy.bind(this)),
842
- truncate: callbackify(this.truncate?.bind(this))
843
- };
844
- this.fileName = fileName;
845
- this._fileHandle = file;
846
- this._destroy = destroy;
847
- void this._loadBufferGuarded();
848
- }
849
868
  get _bufferSize() {
850
869
  return this._buffer?.length;
851
870
  }
@@ -855,7 +874,7 @@ var WebFile = class extends EventEmitter {
855
874
  this._buffer = new Uint8Array(await file.arrayBuffer());
856
875
  }
857
876
  async _loadBufferGuarded() {
858
- await (this._loadBufferPromise ??= this._loadBuffer());
877
+ await (this._loadBufferPromise ?? (this._loadBufferPromise = this._loadBuffer()));
859
878
  }
860
879
  // Do not call directly, use _flushLater or _flushNow.
861
880
  async _flushCache(sequence) {
@@ -867,7 +886,7 @@ var WebFile = class extends EventEmitter {
867
886
  await this._loadBufferGuarded();
868
887
  invariant2(this._buffer, void 0, {
869
888
  F: __dxlog_file4,
870
- L: 300,
889
+ L: 301,
871
890
  S: this,
872
891
  A: [
873
892
  "this._buffer",
@@ -895,7 +914,7 @@ var WebFile = class extends EventEmitter {
895
914
  this._flushScheduled = false;
896
915
  this._flushPromise = this._flushCache(sequence).catch((err) => log3.warn(err, void 0, {
897
916
  F: __dxlog_file4,
898
- L: 318,
917
+ L: 319,
899
918
  S: this,
900
919
  C: (f, a) => f(...a)
901
920
  }));
@@ -906,7 +925,7 @@ var WebFile = class extends EventEmitter {
906
925
  await this._flushPromise;
907
926
  this._flushPromise = this._flushCache(this._flushSequence).catch((err) => log3.warn(err, void 0, {
908
927
  F: __dxlog_file4,
909
- L: 326,
928
+ L: 327,
910
929
  S: this,
911
930
  C: (f, a) => f(...a)
912
931
  }));
@@ -921,7 +940,7 @@ var WebFile = class extends EventEmitter {
921
940
  await this._loadBufferGuarded();
922
941
  invariant2(this._buffer, void 0, {
923
942
  F: __dxlog_file4,
924
- L: 339,
943
+ L: 340,
925
944
  S: this,
926
945
  A: [
927
946
  "this._buffer",
@@ -943,7 +962,7 @@ var WebFile = class extends EventEmitter {
943
962
  await this._loadBufferGuarded();
944
963
  invariant2(this._buffer, void 0, {
945
964
  F: __dxlog_file4,
946
- L: 359,
965
+ L: 360,
947
966
  S: this,
948
967
  A: [
949
968
  "this._buffer",
@@ -971,7 +990,7 @@ var WebFile = class extends EventEmitter {
971
990
  await this._loadBufferGuarded();
972
991
  invariant2(this._buffer, void 0, {
973
992
  F: __dxlog_file4,
974
- L: 386,
993
+ L: 387,
975
994
  S: this,
976
995
  A: [
977
996
  "this._buffer",
@@ -994,7 +1013,7 @@ var WebFile = class extends EventEmitter {
994
1013
  await this._loadBufferGuarded();
995
1014
  invariant2(this._buffer, void 0, {
996
1015
  F: __dxlog_file4,
997
- L: 408,
1016
+ L: 409,
998
1017
  S: this,
999
1018
  A: [
1000
1019
  "this._buffer",
@@ -1013,7 +1032,7 @@ var WebFile = class extends EventEmitter {
1013
1032
  await this._loadBufferGuarded();
1014
1033
  invariant2(this._buffer, void 0, {
1015
1034
  F: __dxlog_file4,
1016
- L: 423,
1035
+ L: 424,
1017
1036
  S: this,
1018
1037
  A: [
1019
1038
  "this._buffer",
@@ -1049,6 +1068,35 @@ var WebFile = class extends EventEmitter {
1049
1068
  throw new Error(`${operation} on a destroyed or closed file`);
1050
1069
  }
1051
1070
  }
1071
+ constructor({ fileName, file, destroy }) {
1072
+ super(), _define_property5(this, "fileName", void 0), _define_property5(this, "_fileHandle", void 0), _define_property5(this, "_destroy", void 0), /**
1073
+ * Current view of the file contents.
1074
+ */
1075
+ _define_property5(this, "_buffer", null), _define_property5(this, "_loadBufferPromise", null), _define_property5(this, "_flushScheduled", false), _define_property5(this, "_flushPromise", Promise.resolve()), /**
1076
+ * Used to discard unnecessary scheduled flushes.
1077
+ * If _flushNow() is called with a lower sequence number it should early exit.
1078
+ */
1079
+ _define_property5(this, "_flushSequence", 0), //
1080
+ // Metrics
1081
+ //
1082
+ _define_property5(this, "_flushes", new TimeSeriesCounter()), _define_property5(this, "_operations", new TimeSeriesCounter()), _define_property5(this, "_reads", new TimeSeriesCounter()), _define_property5(this, "_readBytes", new TimeSeriesCounter()), _define_property5(this, "_writes", new TimeSeriesCounter()), _define_property5(this, "_writeBytes", new TimeSeriesCounter()), _define_property5(this, "type", StorageType.WEBFS), //
1083
+ // random-access-storage library compatibility
1084
+ //
1085
+ // TODO(dmaretskyi): Are those all needed?
1086
+ _define_property5(this, "opened", true), _define_property5(this, "suspended", false), _define_property5(this, "closed", false), _define_property5(this, "unlinked", false), _define_property5(this, "writing", false), _define_property5(this, "readable", true), _define_property5(this, "writable", true), _define_property5(this, "deletable", true), _define_property5(this, "truncatable", true), _define_property5(this, "statable", true), _define_property5(this, "destroyed", false), _define_property5(this, "directory", ""), // TODO(dmaretskyi): is this used?
1087
+ _define_property5(this, "filename", ""), _define_property5(this, "native", {
1088
+ write: callbackify(this.write.bind(this)),
1089
+ read: callbackify(this.read.bind(this)),
1090
+ del: callbackify(this.del.bind(this)),
1091
+ stat: callbackify(this.stat.bind(this)),
1092
+ destroy: callbackify(this.destroy.bind(this)),
1093
+ truncate: callbackify(this.truncate?.bind(this))
1094
+ });
1095
+ this.fileName = fileName;
1096
+ this._fileHandle = file;
1097
+ this._destroy = destroy;
1098
+ void this._loadBufferGuarded();
1099
+ }
1052
1100
  };
1053
1101
  _ts_decorate([
1054
1102
  trace.info()
@@ -1078,7 +1126,7 @@ _ts_decorate([
1078
1126
  synchronized
1079
1127
  ], WebFile.prototype, "destroy", null);
1080
1128
 
1081
- // packages/common/random-access-storage/src/browser/storage.ts
1129
+ // src/browser/storage.ts
1082
1130
  var createStorage = ({ type, root = "" } = {}) => {
1083
1131
  if (type === void 0) {
1084
1132
  return new IDbStorage(root);