@tanstack/query-sync-storage-persister 5.90.23 → 5.90.25

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.
@@ -0,0 +1,72 @@
1
+ import { Options } from 'tsup';
2
+ import type { PersistedClient } from '@tanstack/query-persist-client-core';
3
+ import type { Persister } from '@tanstack/query-persist-client-core';
4
+ import type { PersistRetryer } from '@tanstack/query-persist-client-core';
5
+ import { UserConfig } from 'vite';
6
+
7
+ /**
8
+ * @deprecated use `createAsyncStoragePersister` from `@tanstack/query-async-storage-persister` instead.
9
+ */
10
+ export declare function createSyncStoragePersister({ storage, key, throttleTime, serialize, deserialize, retry, }: CreateSyncStoragePersisterOptions): Persister;
11
+
12
+ declare interface CreateSyncStoragePersisterOptions {
13
+ /** The storage client used for setting and retrieving items from cache.
14
+ * For SSR pass in `undefined`. Note that window.localStorage can be
15
+ * `null` in Android WebViews depending on how they are configured.
16
+ */
17
+ storage: Storage_2 | undefined | null;
18
+ /** The key to use when storing the cache */
19
+ key?: string;
20
+ /** To avoid spamming,
21
+ * pass a time in ms to throttle saving the cache to disk */
22
+ throttleTime?: number;
23
+ /**
24
+ * How to serialize the data to storage.
25
+ * @default `JSON.stringify`
26
+ */
27
+ serialize?: (client: PersistedClient) => string;
28
+ /**
29
+ * How to deserialize the data from storage.
30
+ * @default `JSON.parse`
31
+ */
32
+ deserialize?: (cachedString: string) => PersistedClient;
33
+ retry?: PersistRetryer;
34
+ }
35
+
36
+ export declare const default_alias: any[];
37
+
38
+ export declare const default_alias_1: any[];
39
+
40
+ export declare const default_alias_2: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
41
+
42
+ export declare const default_alias_3: UserConfig;
43
+
44
+ /**
45
+ * @param {Object} opts - Options for building configurations.
46
+ * @param {string[]} opts.entry - The entry array.
47
+ * @returns {import('tsup').Options}
48
+ */
49
+ export declare function legacyConfig(opts: {
50
+ entry: string[];
51
+ }): Options;
52
+
53
+ /**
54
+ * @param {Object} opts - Options for building configurations.
55
+ * @param {string[]} opts.entry - The entry array.
56
+ * @returns {import('tsup').Options}
57
+ */
58
+ export declare function modernConfig(opts: {
59
+ entry: string[];
60
+ }): Options;
61
+
62
+ export declare function noop(): void;
63
+
64
+ export declare function noop(): undefined;
65
+
66
+ declare interface Storage_2 {
67
+ getItem: (key: string) => string | null;
68
+ setItem: (key: string, value: string) => void;
69
+ removeItem: (key: string) => void;
70
+ }
71
+
72
+ export { }
@@ -0,0 +1,72 @@
1
+ import { Options } from 'tsup';
2
+ import type { PersistedClient } from '@tanstack/query-persist-client-core';
3
+ import type { Persister } from '@tanstack/query-persist-client-core';
4
+ import type { PersistRetryer } from '@tanstack/query-persist-client-core';
5
+ import { UserConfig } from 'vite';
6
+
7
+ /**
8
+ * @deprecated use `createAsyncStoragePersister` from `@tanstack/query-async-storage-persister` instead.
9
+ */
10
+ export declare function createSyncStoragePersister({ storage, key, throttleTime, serialize, deserialize, retry, }: CreateSyncStoragePersisterOptions): Persister;
11
+
12
+ declare interface CreateSyncStoragePersisterOptions {
13
+ /** The storage client used for setting and retrieving items from cache.
14
+ * For SSR pass in `undefined`. Note that window.localStorage can be
15
+ * `null` in Android WebViews depending on how they are configured.
16
+ */
17
+ storage: Storage_2 | undefined | null;
18
+ /** The key to use when storing the cache */
19
+ key?: string;
20
+ /** To avoid spamming,
21
+ * pass a time in ms to throttle saving the cache to disk */
22
+ throttleTime?: number;
23
+ /**
24
+ * How to serialize the data to storage.
25
+ * @default `JSON.stringify`
26
+ */
27
+ serialize?: (client: PersistedClient) => string;
28
+ /**
29
+ * How to deserialize the data from storage.
30
+ * @default `JSON.parse`
31
+ */
32
+ deserialize?: (cachedString: string) => PersistedClient;
33
+ retry?: PersistRetryer;
34
+ }
35
+
36
+ export declare const default_alias: any[];
37
+
38
+ export declare const default_alias_1: any[];
39
+
40
+ export declare const default_alias_2: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
41
+
42
+ export declare const default_alias_3: UserConfig;
43
+
44
+ /**
45
+ * @param {Object} opts - Options for building configurations.
46
+ * @param {string[]} opts.entry - The entry array.
47
+ * @returns {import('tsup').Options}
48
+ */
49
+ export declare function legacyConfig(opts: {
50
+ entry: string[];
51
+ }): Options;
52
+
53
+ /**
54
+ * @param {Object} opts - Options for building configurations.
55
+ * @param {string[]} opts.entry - The entry array.
56
+ * @returns {import('tsup').Options}
57
+ */
58
+ export declare function modernConfig(opts: {
59
+ entry: string[];
60
+ }): Options;
61
+
62
+ export declare function noop(): void;
63
+
64
+ export declare function noop(): undefined;
65
+
66
+ declare interface Storage_2 {
67
+ getItem: (key: string) => string | null;
68
+ setItem: (key: string, value: string) => void;
69
+ removeItem: (key: string) => void;
70
+ }
71
+
72
+ export { }
@@ -1,36 +1 @@
1
- import { PersistedClient, PersistRetryer, Persister } from '@tanstack/query-persist-client-core';
2
-
3
- interface Storage {
4
- getItem: (key: string) => string | null;
5
- setItem: (key: string, value: string) => void;
6
- removeItem: (key: string) => void;
7
- }
8
- interface CreateSyncStoragePersisterOptions {
9
- /** The storage client used for setting and retrieving items from cache.
10
- * For SSR pass in `undefined`. Note that window.localStorage can be
11
- * `null` in Android WebViews depending on how they are configured.
12
- */
13
- storage: Storage | undefined | null;
14
- /** The key to use when storing the cache */
15
- key?: string;
16
- /** To avoid spamming,
17
- * pass a time in ms to throttle saving the cache to disk */
18
- throttleTime?: number;
19
- /**
20
- * How to serialize the data to storage.
21
- * @default `JSON.stringify`
22
- */
23
- serialize?: (client: PersistedClient) => string;
24
- /**
25
- * How to deserialize the data from storage.
26
- * @default `JSON.parse`
27
- */
28
- deserialize?: (cachedString: string) => PersistedClient;
29
- retry?: PersistRetryer;
30
- }
31
- /**
32
- * @deprecated use `createAsyncStoragePersister` from `@tanstack/query-async-storage-persister` instead.
33
- */
34
- declare function createSyncStoragePersister({ storage, key, throttleTime, serialize, deserialize, retry, }: CreateSyncStoragePersisterOptions): Persister;
35
-
36
- export { createSyncStoragePersister };
1
+ export { createSyncStoragePersister } from './_tsup-dts-rollup.cjs';
@@ -1,36 +1 @@
1
- import { PersistedClient, PersistRetryer, Persister } from '@tanstack/query-persist-client-core';
2
-
3
- interface Storage {
4
- getItem: (key: string) => string | null;
5
- setItem: (key: string, value: string) => void;
6
- removeItem: (key: string) => void;
7
- }
8
- interface CreateSyncStoragePersisterOptions {
9
- /** The storage client used for setting and retrieving items from cache.
10
- * For SSR pass in `undefined`. Note that window.localStorage can be
11
- * `null` in Android WebViews depending on how they are configured.
12
- */
13
- storage: Storage | undefined | null;
14
- /** The key to use when storing the cache */
15
- key?: string;
16
- /** To avoid spamming,
17
- * pass a time in ms to throttle saving the cache to disk */
18
- throttleTime?: number;
19
- /**
20
- * How to serialize the data to storage.
21
- * @default `JSON.stringify`
22
- */
23
- serialize?: (client: PersistedClient) => string;
24
- /**
25
- * How to deserialize the data from storage.
26
- * @default `JSON.parse`
27
- */
28
- deserialize?: (cachedString: string) => PersistedClient;
29
- retry?: PersistRetryer;
30
- }
31
- /**
32
- * @deprecated use `createAsyncStoragePersister` from `@tanstack/query-async-storage-persister` instead.
33
- */
34
- declare function createSyncStoragePersister({ storage, key, throttleTime, serialize, deserialize, retry, }: CreateSyncStoragePersisterOptions): Persister;
35
-
36
- export { createSyncStoragePersister };
1
+ export { createSyncStoragePersister } from './_tsup-dts-rollup.js';
@@ -1,4 +1 @@
1
- declare function noop(): void;
2
- declare function noop(): undefined;
3
-
4
- export { noop };
1
+ export { noop } from './_tsup-dts-rollup.cjs';
@@ -1,4 +1 @@
1
- declare function noop(): void;
2
- declare function noop(): undefined;
3
-
4
- export { noop };
1
+ export { noop } from './_tsup-dts-rollup.js';
@@ -0,0 +1,72 @@
1
+ import { Options } from 'tsup';
2
+ import type { PersistedClient } from '@tanstack/query-persist-client-core';
3
+ import type { Persister } from '@tanstack/query-persist-client-core';
4
+ import type { PersistRetryer } from '@tanstack/query-persist-client-core';
5
+ import { UserConfig } from 'vite';
6
+
7
+ /**
8
+ * @deprecated use `createAsyncStoragePersister` from `@tanstack/query-async-storage-persister` instead.
9
+ */
10
+ export declare function createSyncStoragePersister({ storage, key, throttleTime, serialize, deserialize, retry, }: CreateSyncStoragePersisterOptions): Persister;
11
+
12
+ declare interface CreateSyncStoragePersisterOptions {
13
+ /** The storage client used for setting and retrieving items from cache.
14
+ * For SSR pass in `undefined`. Note that window.localStorage can be
15
+ * `null` in Android WebViews depending on how they are configured.
16
+ */
17
+ storage: Storage_2 | undefined | null;
18
+ /** The key to use when storing the cache */
19
+ key?: string;
20
+ /** To avoid spamming,
21
+ * pass a time in ms to throttle saving the cache to disk */
22
+ throttleTime?: number;
23
+ /**
24
+ * How to serialize the data to storage.
25
+ * @default `JSON.stringify`
26
+ */
27
+ serialize?: (client: PersistedClient) => string;
28
+ /**
29
+ * How to deserialize the data from storage.
30
+ * @default `JSON.parse`
31
+ */
32
+ deserialize?: (cachedString: string) => PersistedClient;
33
+ retry?: PersistRetryer;
34
+ }
35
+
36
+ export declare const default_alias: any[];
37
+
38
+ export declare const default_alias_1: any[];
39
+
40
+ export declare const default_alias_2: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
41
+
42
+ export declare const default_alias_3: UserConfig;
43
+
44
+ /**
45
+ * @param {Object} opts - Options for building configurations.
46
+ * @param {string[]} opts.entry - The entry array.
47
+ * @returns {import('tsup').Options}
48
+ */
49
+ export declare function legacyConfig(opts: {
50
+ entry: string[];
51
+ }): Options;
52
+
53
+ /**
54
+ * @param {Object} opts - Options for building configurations.
55
+ * @param {string[]} opts.entry - The entry array.
56
+ * @returns {import('tsup').Options}
57
+ */
58
+ export declare function modernConfig(opts: {
59
+ entry: string[];
60
+ }): Options;
61
+
62
+ export declare function noop(): void;
63
+
64
+ export declare function noop(): undefined;
65
+
66
+ declare interface Storage_2 {
67
+ getItem: (key: string) => string | null;
68
+ setItem: (key: string, value: string) => void;
69
+ removeItem: (key: string) => void;
70
+ }
71
+
72
+ export { }
@@ -0,0 +1,72 @@
1
+ import { Options } from 'tsup';
2
+ import type { PersistedClient } from '@tanstack/query-persist-client-core';
3
+ import type { Persister } from '@tanstack/query-persist-client-core';
4
+ import type { PersistRetryer } from '@tanstack/query-persist-client-core';
5
+ import { UserConfig } from 'vite';
6
+
7
+ /**
8
+ * @deprecated use `createAsyncStoragePersister` from `@tanstack/query-async-storage-persister` instead.
9
+ */
10
+ export declare function createSyncStoragePersister({ storage, key, throttleTime, serialize, deserialize, retry, }: CreateSyncStoragePersisterOptions): Persister;
11
+
12
+ declare interface CreateSyncStoragePersisterOptions {
13
+ /** The storage client used for setting and retrieving items from cache.
14
+ * For SSR pass in `undefined`. Note that window.localStorage can be
15
+ * `null` in Android WebViews depending on how they are configured.
16
+ */
17
+ storage: Storage_2 | undefined | null;
18
+ /** The key to use when storing the cache */
19
+ key?: string;
20
+ /** To avoid spamming,
21
+ * pass a time in ms to throttle saving the cache to disk */
22
+ throttleTime?: number;
23
+ /**
24
+ * How to serialize the data to storage.
25
+ * @default `JSON.stringify`
26
+ */
27
+ serialize?: (client: PersistedClient) => string;
28
+ /**
29
+ * How to deserialize the data from storage.
30
+ * @default `JSON.parse`
31
+ */
32
+ deserialize?: (cachedString: string) => PersistedClient;
33
+ retry?: PersistRetryer;
34
+ }
35
+
36
+ export declare const default_alias: any[];
37
+
38
+ export declare const default_alias_1: any[];
39
+
40
+ export declare const default_alias_2: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
41
+
42
+ export declare const default_alias_3: UserConfig;
43
+
44
+ /**
45
+ * @param {Object} opts - Options for building configurations.
46
+ * @param {string[]} opts.entry - The entry array.
47
+ * @returns {import('tsup').Options}
48
+ */
49
+ export declare function legacyConfig(opts: {
50
+ entry: string[];
51
+ }): Options;
52
+
53
+ /**
54
+ * @param {Object} opts - Options for building configurations.
55
+ * @param {string[]} opts.entry - The entry array.
56
+ * @returns {import('tsup').Options}
57
+ */
58
+ export declare function modernConfig(opts: {
59
+ entry: string[];
60
+ }): Options;
61
+
62
+ export declare function noop(): void;
63
+
64
+ export declare function noop(): undefined;
65
+
66
+ declare interface Storage_2 {
67
+ getItem: (key: string) => string | null;
68
+ setItem: (key: string, value: string) => void;
69
+ removeItem: (key: string) => void;
70
+ }
71
+
72
+ export { }
@@ -1,36 +1 @@
1
- import { PersistedClient, PersistRetryer, Persister } from '@tanstack/query-persist-client-core';
2
-
3
- interface Storage {
4
- getItem: (key: string) => string | null;
5
- setItem: (key: string, value: string) => void;
6
- removeItem: (key: string) => void;
7
- }
8
- interface CreateSyncStoragePersisterOptions {
9
- /** The storage client used for setting and retrieving items from cache.
10
- * For SSR pass in `undefined`. Note that window.localStorage can be
11
- * `null` in Android WebViews depending on how they are configured.
12
- */
13
- storage: Storage | undefined | null;
14
- /** The key to use when storing the cache */
15
- key?: string;
16
- /** To avoid spamming,
17
- * pass a time in ms to throttle saving the cache to disk */
18
- throttleTime?: number;
19
- /**
20
- * How to serialize the data to storage.
21
- * @default `JSON.stringify`
22
- */
23
- serialize?: (client: PersistedClient) => string;
24
- /**
25
- * How to deserialize the data from storage.
26
- * @default `JSON.parse`
27
- */
28
- deserialize?: (cachedString: string) => PersistedClient;
29
- retry?: PersistRetryer;
30
- }
31
- /**
32
- * @deprecated use `createAsyncStoragePersister` from `@tanstack/query-async-storage-persister` instead.
33
- */
34
- declare function createSyncStoragePersister({ storage, key, throttleTime, serialize, deserialize, retry, }: CreateSyncStoragePersisterOptions): Persister;
35
-
36
- export { createSyncStoragePersister };
1
+ export { createSyncStoragePersister } from './_tsup-dts-rollup.cjs';
@@ -1,36 +1 @@
1
- import { PersistedClient, PersistRetryer, Persister } from '@tanstack/query-persist-client-core';
2
-
3
- interface Storage {
4
- getItem: (key: string) => string | null;
5
- setItem: (key: string, value: string) => void;
6
- removeItem: (key: string) => void;
7
- }
8
- interface CreateSyncStoragePersisterOptions {
9
- /** The storage client used for setting and retrieving items from cache.
10
- * For SSR pass in `undefined`. Note that window.localStorage can be
11
- * `null` in Android WebViews depending on how they are configured.
12
- */
13
- storage: Storage | undefined | null;
14
- /** The key to use when storing the cache */
15
- key?: string;
16
- /** To avoid spamming,
17
- * pass a time in ms to throttle saving the cache to disk */
18
- throttleTime?: number;
19
- /**
20
- * How to serialize the data to storage.
21
- * @default `JSON.stringify`
22
- */
23
- serialize?: (client: PersistedClient) => string;
24
- /**
25
- * How to deserialize the data from storage.
26
- * @default `JSON.parse`
27
- */
28
- deserialize?: (cachedString: string) => PersistedClient;
29
- retry?: PersistRetryer;
30
- }
31
- /**
32
- * @deprecated use `createAsyncStoragePersister` from `@tanstack/query-async-storage-persister` instead.
33
- */
34
- declare function createSyncStoragePersister({ storage, key, throttleTime, serialize, deserialize, retry, }: CreateSyncStoragePersisterOptions): Persister;
35
-
36
- export { createSyncStoragePersister };
1
+ export { createSyncStoragePersister } from './_tsup-dts-rollup.js';
@@ -1,4 +1 @@
1
- declare function noop(): void;
2
- declare function noop(): undefined;
3
-
4
- export { noop };
1
+ export { noop } from './_tsup-dts-rollup.cjs';
@@ -1,4 +1 @@
1
- declare function noop(): void;
2
- declare function noop(): undefined;
3
-
4
- export { noop };
1
+ export { noop } from './_tsup-dts-rollup.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/query-sync-storage-persister",
3
- "version": "5.90.23",
3
+ "version": "5.90.25",
4
4
  "description": "A persister for synchronous storages, to be used with TanStack/Query",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -40,8 +40,8 @@
40
40
  "!src/__tests__"
41
41
  ],
42
42
  "dependencies": {
43
- "@tanstack/query-core": "5.90.20",
44
- "@tanstack/query-persist-client-core": "5.92.0"
43
+ "@tanstack/query-core": "5.91.0",
44
+ "@tanstack/query-persist-client-core": "5.92.2"
45
45
  },
46
46
  "devDependencies": {
47
47
  "npm-run-all2": "^5.0.0",
@@ -52,15 +52,14 @@
52
52
  "compile": "tsc --build",
53
53
  "test:eslint": "eslint --concurrency=auto ./src",
54
54
  "test:types": "npm-run-all --serial test:types:*",
55
- "test:types:ts50": "node ../../node_modules/typescript50/lib/tsc.js --build",
56
- "test:types:ts51": "node ../../node_modules/typescript51/lib/tsc.js --build",
57
- "test:types:ts52": "node ../../node_modules/typescript52/lib/tsc.js --build",
58
- "test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js --build",
59
55
  "test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js --build",
60
56
  "test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js --build",
61
57
  "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --build",
62
58
  "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js --build",
59
+ "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js --build",
60
+ "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js --build",
63
61
  "test:types:tscurrent": "tsc --build",
62
+ "test:types:ts60": "node ../../node_modules/typescript60/lib/tsc.js --build",
64
63
  "test:lib": "vitest",
65
64
  "test:lib:dev": "pnpm run test:lib --watch",
66
65
  "test:build": "publint --strict && attw --pack",