@tanstack/query-sync-storage-persister 5.101.4 → 5.102.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.
Files changed (37) hide show
  1. package/build/legacy/index.cjs +59 -93
  2. package/build/legacy/index.cjs.map +1 -1
  3. package/build/legacy/index.d.cts +37 -1
  4. package/build/legacy/index.d.cts.map +1 -0
  5. package/build/legacy/index.d.ts +37 -1
  6. package/build/legacy/index.d.ts.map +1 -0
  7. package/build/legacy/index.js +57 -67
  8. package/build/legacy/index.js.map +1 -1
  9. package/build/legacy/utils.cjs +5 -30
  10. package/build/legacy/utils.cjs.map +1 -1
  11. package/build/legacy/utils.d.cts +6 -1
  12. package/build/legacy/utils.d.cts.map +1 -0
  13. package/build/legacy/utils.d.ts +6 -1
  14. package/build/legacy/utils.d.ts.map +1 -0
  15. package/build/legacy/utils.js +5 -6
  16. package/build/legacy/utils.js.map +1 -1
  17. package/build/modern/index.cjs +59 -93
  18. package/build/modern/index.cjs.map +1 -1
  19. package/build/modern/index.d.cts +37 -1
  20. package/build/modern/index.d.cts.map +1 -0
  21. package/build/modern/index.d.ts +37 -1
  22. package/build/modern/index.d.ts.map +1 -0
  23. package/build/modern/index.js +57 -67
  24. package/build/modern/index.js.map +1 -1
  25. package/build/modern/utils.cjs +5 -30
  26. package/build/modern/utils.cjs.map +1 -1
  27. package/build/modern/utils.d.cts +6 -1
  28. package/build/modern/utils.d.cts.map +1 -0
  29. package/build/modern/utils.d.ts +6 -1
  30. package/build/modern/utils.d.ts.map +1 -0
  31. package/build/modern/utils.js +5 -6
  32. package/build/modern/utils.js.map +1 -1
  33. package/package.json +5 -7
  34. package/build/legacy/_tsup-dts-rollup.d.cts +0 -44
  35. package/build/legacy/_tsup-dts-rollup.d.ts +0 -44
  36. package/build/modern/_tsup-dts-rollup.d.cts +0 -44
  37. package/build/modern/_tsup-dts-rollup.d.ts +0 -44
@@ -1,44 +0,0 @@
1
- import type { PersistedClient } from '@tanstack/query-persist-client-core';
2
- import type { Persister } from '@tanstack/query-persist-client-core';
3
- import type { PersistRetryer } from '@tanstack/query-persist-client-core';
4
-
5
- /**
6
- * @deprecated use `createAsyncStoragePersister` from `@tanstack/query-async-storage-persister` instead.
7
- */
8
- export declare function createSyncStoragePersister({ storage, key, throttleTime, serialize, deserialize, retry, }: CreateSyncStoragePersisterOptions): Persister;
9
-
10
- declare interface CreateSyncStoragePersisterOptions {
11
- /** The storage client used for setting and retrieving items from cache.
12
- * For SSR pass in `undefined`. Note that window.localStorage can be
13
- * `null` in Android WebViews depending on how they are configured.
14
- */
15
- storage: Storage_2 | undefined | null;
16
- /** The key to use when storing the cache */
17
- key?: string;
18
- /** To avoid spamming,
19
- * pass a time in ms to throttle saving the cache to disk */
20
- throttleTime?: number;
21
- /**
22
- * How to serialize the data to storage.
23
- * @default `JSON.stringify`
24
- */
25
- serialize?: (client: PersistedClient) => string;
26
- /**
27
- * How to deserialize the data from storage.
28
- * @default `JSON.parse`
29
- */
30
- deserialize?: (cachedString: string) => PersistedClient;
31
- retry?: PersistRetryer;
32
- }
33
-
34
- export declare function noop(): void;
35
-
36
- export declare function noop(): undefined;
37
-
38
- declare interface Storage_2 {
39
- getItem: (key: string) => string | null;
40
- setItem: (key: string, value: string) => void;
41
- removeItem: (key: string) => void;
42
- }
43
-
44
- export { }
@@ -1,44 +0,0 @@
1
- import type { PersistedClient } from '@tanstack/query-persist-client-core';
2
- import type { Persister } from '@tanstack/query-persist-client-core';
3
- import type { PersistRetryer } from '@tanstack/query-persist-client-core';
4
-
5
- /**
6
- * @deprecated use `createAsyncStoragePersister` from `@tanstack/query-async-storage-persister` instead.
7
- */
8
- export declare function createSyncStoragePersister({ storage, key, throttleTime, serialize, deserialize, retry, }: CreateSyncStoragePersisterOptions): Persister;
9
-
10
- declare interface CreateSyncStoragePersisterOptions {
11
- /** The storage client used for setting and retrieving items from cache.
12
- * For SSR pass in `undefined`. Note that window.localStorage can be
13
- * `null` in Android WebViews depending on how they are configured.
14
- */
15
- storage: Storage_2 | undefined | null;
16
- /** The key to use when storing the cache */
17
- key?: string;
18
- /** To avoid spamming,
19
- * pass a time in ms to throttle saving the cache to disk */
20
- throttleTime?: number;
21
- /**
22
- * How to serialize the data to storage.
23
- * @default `JSON.stringify`
24
- */
25
- serialize?: (client: PersistedClient) => string;
26
- /**
27
- * How to deserialize the data from storage.
28
- * @default `JSON.parse`
29
- */
30
- deserialize?: (cachedString: string) => PersistedClient;
31
- retry?: PersistRetryer;
32
- }
33
-
34
- export declare function noop(): void;
35
-
36
- export declare function noop(): undefined;
37
-
38
- declare interface Storage_2 {
39
- getItem: (key: string) => string | null;
40
- setItem: (key: string, value: string) => void;
41
- removeItem: (key: string) => void;
42
- }
43
-
44
- export { }