sliftutils 0.63.0 → 0.65.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 +4 -0
- package/package.json +1 -1
- package/storage/CBORStorage.d.ts +1 -0
- package/storage/CBORStorage.ts +5 -0
- package/storage/DelayedStorage.d.ts +1 -0
- package/storage/DelayedStorage.ts +5 -0
- package/storage/JSONStorage.d.ts +1 -0
- package/storage/JSONStorage.ts +3 -1
- package/storage/PendingStorage.d.ts +1 -0
- package/storage/PendingStorage.ts +3 -0
package/index.d.ts
CHANGED
|
@@ -574,6 +574,7 @@ declare module "sliftutils/storage/CBORStorage" {
|
|
|
574
574
|
size: number;
|
|
575
575
|
lastModified: number;
|
|
576
576
|
} | undefined>;
|
|
577
|
+
watchResync(callback: () => void): void;
|
|
577
578
|
reset(): Promise<void>;
|
|
578
579
|
}
|
|
579
580
|
|
|
@@ -599,6 +600,7 @@ declare module "sliftutils/storage/DelayedStorage" {
|
|
|
599
600
|
lastModified: number;
|
|
600
601
|
} | undefined>;
|
|
601
602
|
reset(): Promise<void>;
|
|
603
|
+
watchResync(callback: () => void): void;
|
|
602
604
|
}
|
|
603
605
|
|
|
604
606
|
}
|
|
@@ -857,6 +859,7 @@ declare module "sliftutils/storage/JSONStorage" {
|
|
|
857
859
|
size: number;
|
|
858
860
|
lastModified: number;
|
|
859
861
|
} | undefined>;
|
|
862
|
+
watchResync(callback: () => void): void;
|
|
860
863
|
reset(): Promise<void>;
|
|
861
864
|
}
|
|
862
865
|
|
|
@@ -890,6 +893,7 @@ declare module "sliftutils/storage/PendingStorage" {
|
|
|
890
893
|
private watchPending;
|
|
891
894
|
private updatePending;
|
|
892
895
|
reset(): Promise<void>;
|
|
896
|
+
watchResync(callback: () => void): void;
|
|
893
897
|
}
|
|
894
898
|
|
|
895
899
|
}
|
package/package.json
CHANGED
package/storage/CBORStorage.d.ts
CHANGED
package/storage/CBORStorage.ts
CHANGED
|
@@ -30,6 +30,11 @@ export class CBORStorage<T> implements IStorage<T> {
|
|
|
30
30
|
return await this.storage.getInfo(key);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
|
|
34
|
+
public watchResync(callback: () => void): void {
|
|
35
|
+
this.storage.watchResync?.(callback);
|
|
36
|
+
}
|
|
37
|
+
|
|
33
38
|
public async reset() {
|
|
34
39
|
await this.storage.reset();
|
|
35
40
|
}
|
|
@@ -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
|
}
|
package/storage/JSONStorage.d.ts
CHANGED
package/storage/JSONStorage.ts
CHANGED