sliftutils 0.63.0 → 0.64.0

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.
package/index.d.ts CHANGED
@@ -599,6 +599,7 @@ declare module "sliftutils/storage/DelayedStorage" {
599
599
  lastModified: number;
600
600
  } | undefined>;
601
601
  reset(): Promise<void>;
602
+ watchResync(callback: () => void): void;
602
603
  }
603
604
 
604
605
  }
@@ -890,6 +891,7 @@ declare module "sliftutils/storage/PendingStorage" {
890
891
  private watchPending;
891
892
  private updatePending;
892
893
  reset(): Promise<void>;
894
+ watchResync(callback: () => void): void;
893
895
  }
894
896
 
895
897
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sliftutils",
3
- "version": "0.63.0",
3
+ "version": "0.64.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -11,4 +11,5 @@ export declare class DelayedStorage<T> implements IStorage<T> {
11
11
  lastModified: number;
12
12
  } | undefined>;
13
13
  reset(): Promise<void>;
14
+ watchResync(callback: () => void): void;
14
15
  }
@@ -27,4 +27,9 @@ export class DelayedStorage<T> implements IStorage<T> {
27
27
  const storage = await this.storage;
28
28
  return storage.reset();
29
29
  }
30
+ public watchResync(callback: () => void): void {
31
+ void this.storage.then(storage => {
32
+ storage.watchResync?.(callback);
33
+ });
34
+ }
30
35
  }
@@ -15,4 +15,5 @@ export declare class PendingStorage<T> implements IStorage<T> {
15
15
  private watchPending;
16
16
  private updatePending;
17
17
  reset(): Promise<void>;
18
+ watchResync(callback: () => void): void;
18
19
  }
@@ -44,4 +44,7 @@ export class PendingStorage<T> implements IStorage<T> {
44
44
  public async reset() {
45
45
  return this.storage.reset();
46
46
  }
47
+ public watchResync(callback: () => void): void {
48
+ this.storage.watchResync?.(callback);
49
+ }
47
50
  }