@dxos/random-access-storage 0.8.2-main.7503643 → 0.8.2-main.9f6ec58

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,7 +37,7 @@ export class Directory {
37
37
  this._onFlush = onFlush;
38
38
  }
39
39
 
40
- toString() {
40
+ toString(): string {
41
41
  return `Directory(${JSON.stringify({ type: this.type, path: this.path })})`;
42
42
  }
43
43
 
@@ -68,14 +68,14 @@ export class Directory {
68
68
  return this._getOrCreateFile(this.path, filename, opts);
69
69
  }
70
70
 
71
- async flush() {
71
+ async flush(): Promise<void> {
72
72
  await this._onFlush?.();
73
73
  }
74
74
 
75
75
  /**
76
76
  * Close and delete all files in the directory and all its sub-directories.
77
77
  */
78
- async delete() {
78
+ async delete(): Promise<void> {
79
79
  await this._remove();
80
80
  }
81
81
  }
@@ -18,7 +18,7 @@ export class NodeStorage extends AbstractStorage implements Storage {
18
18
  public override type: StorageType = StorageType.NODE;
19
19
  private _initialized = false;
20
20
 
21
- private async _loadFiles(path: string) {
21
+ private async _loadFiles(path: string): Promise<void> {
22
22
  // TODO(mykola): Do not load all files at once. It is a quick fix.
23
23
  if (!existsSync(path)) {
24
24
  return;
@@ -50,7 +50,7 @@ export class NodeStorage extends AbstractStorage implements Storage {
50
50
  return file;
51
51
  }
52
52
 
53
- protected override async _destroy() {
53
+ protected override async _destroy(): Promise<void> {
54
54
  await del(this.path, { force: true });
55
55
  }
56
56