@tanstack/query-persist-client-core 5.92.1 → 5.92.2

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.
@@ -1,4 +1,19 @@
1
- export { PersistQueryClientOptions, PersistQueryClientRootOptions, PersistedClient, PersistedQueryClientRestoreOptions, PersistedQueryClientSaveOptions, Persister, Promisable, persistQueryClient, persistQueryClientRestore, persistQueryClientSave, persistQueryClientSubscribe } from './persist.cjs';
2
- export { PersistRetryer, removeOldestQuery } from './retryStrategies.cjs';
3
- export { AsyncStorage, MaybePromise, PERSISTER_KEY_PREFIX, PersistedQuery, StoragePersisterOptions, experimental_createQueryPersister } from './createPersister.cjs';
4
- import '@tanstack/query-core';
1
+ export { persistQueryClientRestore } from './_tsup-dts-rollup.cjs';
2
+ export { persistQueryClientSave } from './_tsup-dts-rollup.cjs';
3
+ export { persistQueryClientSubscribe } from './_tsup-dts-rollup.cjs';
4
+ export { persistQueryClient } from './_tsup-dts-rollup.cjs';
5
+ export { Promisable } from './_tsup-dts-rollup.cjs';
6
+ export { Persister } from './_tsup-dts-rollup.cjs';
7
+ export { PersistedClient } from './_tsup-dts-rollup.cjs';
8
+ export { PersistQueryClientRootOptions } from './_tsup-dts-rollup.cjs';
9
+ export { PersistedQueryClientRestoreOptions } from './_tsup-dts-rollup.cjs';
10
+ export { PersistedQueryClientSaveOptions } from './_tsup-dts-rollup.cjs';
11
+ export { PersistQueryClientOptions } from './_tsup-dts-rollup.cjs';
12
+ export { PersistRetryer } from './_tsup-dts-rollup.cjs';
13
+ export { removeOldestQuery } from './_tsup-dts-rollup.cjs';
14
+ export { experimental_createQueryPersister_alias_1 as experimental_createQueryPersister } from './_tsup-dts-rollup.cjs';
15
+ export { PersistedQuery_alias_1 as PersistedQuery } from './_tsup-dts-rollup.cjs';
16
+ export { MaybePromise_alias_1 as MaybePromise } from './_tsup-dts-rollup.cjs';
17
+ export { AsyncStorage_alias_1 as AsyncStorage } from './_tsup-dts-rollup.cjs';
18
+ export { StoragePersisterOptions_alias_1 as StoragePersisterOptions } from './_tsup-dts-rollup.cjs';
19
+ export { PERSISTER_KEY_PREFIX_alias_1 as PERSISTER_KEY_PREFIX } from './_tsup-dts-rollup.cjs';
@@ -1,4 +1,19 @@
1
- export { PersistQueryClientOptions, PersistQueryClientRootOptions, PersistedClient, PersistedQueryClientRestoreOptions, PersistedQueryClientSaveOptions, Persister, Promisable, persistQueryClient, persistQueryClientRestore, persistQueryClientSave, persistQueryClientSubscribe } from './persist.js';
2
- export { PersistRetryer, removeOldestQuery } from './retryStrategies.js';
3
- export { AsyncStorage, MaybePromise, PERSISTER_KEY_PREFIX, PersistedQuery, StoragePersisterOptions, experimental_createQueryPersister } from './createPersister.js';
4
- import '@tanstack/query-core';
1
+ export { persistQueryClientRestore } from './_tsup-dts-rollup.js';
2
+ export { persistQueryClientSave } from './_tsup-dts-rollup.js';
3
+ export { persistQueryClientSubscribe } from './_tsup-dts-rollup.js';
4
+ export { persistQueryClient } from './_tsup-dts-rollup.js';
5
+ export { Promisable } from './_tsup-dts-rollup.js';
6
+ export { Persister } from './_tsup-dts-rollup.js';
7
+ export { PersistedClient } from './_tsup-dts-rollup.js';
8
+ export { PersistQueryClientRootOptions } from './_tsup-dts-rollup.js';
9
+ export { PersistedQueryClientRestoreOptions } from './_tsup-dts-rollup.js';
10
+ export { PersistedQueryClientSaveOptions } from './_tsup-dts-rollup.js';
11
+ export { PersistQueryClientOptions } from './_tsup-dts-rollup.js';
12
+ export { PersistRetryer } from './_tsup-dts-rollup.js';
13
+ export { removeOldestQuery } from './_tsup-dts-rollup.js';
14
+ export { experimental_createQueryPersister_alias_1 as experimental_createQueryPersister } from './_tsup-dts-rollup.js';
15
+ export { PersistedQuery_alias_1 as PersistedQuery } from './_tsup-dts-rollup.js';
16
+ export { MaybePromise_alias_1 as MaybePromise } from './_tsup-dts-rollup.js';
17
+ export { AsyncStorage_alias_1 as AsyncStorage } from './_tsup-dts-rollup.js';
18
+ export { StoragePersisterOptions_alias_1 as StoragePersisterOptions } from './_tsup-dts-rollup.js';
19
+ export { PERSISTER_KEY_PREFIX_alias_1 as PERSISTER_KEY_PREFIX } from './_tsup-dts-rollup.js';
@@ -1,61 +1,11 @@
1
- import { QueryClient, DehydratedState, HydrateOptions, DehydrateOptions } from '@tanstack/query-core';
2
-
3
- type Promisable<T> = T | PromiseLike<T>;
4
- interface Persister {
5
- persistClient: (persistClient: PersistedClient) => Promisable<void>;
6
- restoreClient: () => Promisable<PersistedClient | undefined>;
7
- removeClient: () => Promisable<void>;
8
- }
9
- interface PersistedClient {
10
- timestamp: number;
11
- buster: string;
12
- clientState: DehydratedState;
13
- }
14
- interface PersistQueryClientRootOptions {
15
- /** The QueryClient to persist */
16
- queryClient: QueryClient;
17
- /** The Persister interface for storing and restoring the cache
18
- * to/from a persisted location */
19
- persister: Persister;
20
- /** A unique string that can be used to forcefully
21
- * invalidate existing caches if they do not share the same buster string */
22
- buster?: string;
23
- }
24
- interface PersistedQueryClientRestoreOptions extends PersistQueryClientRootOptions {
25
- /** The max-allowed age of the cache in milliseconds.
26
- * If a persisted cache is found that is older than this
27
- * time, it will be discarded */
28
- maxAge?: number;
29
- /** The options passed to the hydrate function */
30
- hydrateOptions?: HydrateOptions;
31
- }
32
- interface PersistedQueryClientSaveOptions extends PersistQueryClientRootOptions {
33
- /** The options passed to the dehydrate function */
34
- dehydrateOptions?: DehydrateOptions;
35
- }
36
- interface PersistQueryClientOptions extends PersistedQueryClientRestoreOptions, PersistedQueryClientSaveOptions, PersistQueryClientRootOptions {
37
- }
38
- /**
39
- * Restores persisted data to the QueryCache
40
- * - data obtained from persister.restoreClient
41
- * - data is hydrated using hydrateOptions
42
- * If data is expired, busted, empty, or throws, it runs persister.removeClient
43
- */
44
- declare function persistQueryClientRestore({ queryClient, persister, maxAge, buster, hydrateOptions, }: PersistedQueryClientRestoreOptions): Promise<void>;
45
- /**
46
- * Persists data from the QueryCache
47
- * - data dehydrated using dehydrateOptions
48
- * - data is persisted using persister.persistClient
49
- */
50
- declare function persistQueryClientSave({ queryClient, persister, buster, dehydrateOptions, }: PersistedQueryClientSaveOptions): Promise<void>;
51
- /**
52
- * Subscribe to QueryCache and MutationCache updates (for persisting)
53
- * @returns an unsubscribe function (to discontinue monitoring)
54
- */
55
- declare function persistQueryClientSubscribe(props: PersistedQueryClientSaveOptions): () => void;
56
- /**
57
- * Restores persisted data to QueryCache and persists further changes.
58
- */
59
- declare function persistQueryClient(props: PersistQueryClientOptions): [() => void, Promise<void>];
60
-
61
- export { type PersistQueryClientOptions, type PersistQueryClientRootOptions, type PersistedClient, type PersistedQueryClientRestoreOptions, type PersistedQueryClientSaveOptions, type Persister, type Promisable, persistQueryClient, persistQueryClientRestore, persistQueryClientSave, persistQueryClientSubscribe };
1
+ export { persistQueryClientRestore_alias_1 as persistQueryClientRestore } from './_tsup-dts-rollup.cjs';
2
+ export { persistQueryClientSave_alias_1 as persistQueryClientSave } from './_tsup-dts-rollup.cjs';
3
+ export { persistQueryClientSubscribe_alias_1 as persistQueryClientSubscribe } from './_tsup-dts-rollup.cjs';
4
+ export { persistQueryClient_alias_1 as persistQueryClient } from './_tsup-dts-rollup.cjs';
5
+ export { Promisable_alias_1 as Promisable } from './_tsup-dts-rollup.cjs';
6
+ export { Persister_alias_1 as Persister } from './_tsup-dts-rollup.cjs';
7
+ export { PersistedClient_alias_1 as PersistedClient } from './_tsup-dts-rollup.cjs';
8
+ export { PersistQueryClientRootOptions_alias_1 as PersistQueryClientRootOptions } from './_tsup-dts-rollup.cjs';
9
+ export { PersistedQueryClientRestoreOptions_alias_1 as PersistedQueryClientRestoreOptions } from './_tsup-dts-rollup.cjs';
10
+ export { PersistedQueryClientSaveOptions_alias_1 as PersistedQueryClientSaveOptions } from './_tsup-dts-rollup.cjs';
11
+ export { PersistQueryClientOptions_alias_1 as PersistQueryClientOptions } from './_tsup-dts-rollup.cjs';
@@ -1,61 +1,11 @@
1
- import { QueryClient, DehydratedState, HydrateOptions, DehydrateOptions } from '@tanstack/query-core';
2
-
3
- type Promisable<T> = T | PromiseLike<T>;
4
- interface Persister {
5
- persistClient: (persistClient: PersistedClient) => Promisable<void>;
6
- restoreClient: () => Promisable<PersistedClient | undefined>;
7
- removeClient: () => Promisable<void>;
8
- }
9
- interface PersistedClient {
10
- timestamp: number;
11
- buster: string;
12
- clientState: DehydratedState;
13
- }
14
- interface PersistQueryClientRootOptions {
15
- /** The QueryClient to persist */
16
- queryClient: QueryClient;
17
- /** The Persister interface for storing and restoring the cache
18
- * to/from a persisted location */
19
- persister: Persister;
20
- /** A unique string that can be used to forcefully
21
- * invalidate existing caches if they do not share the same buster string */
22
- buster?: string;
23
- }
24
- interface PersistedQueryClientRestoreOptions extends PersistQueryClientRootOptions {
25
- /** The max-allowed age of the cache in milliseconds.
26
- * If a persisted cache is found that is older than this
27
- * time, it will be discarded */
28
- maxAge?: number;
29
- /** The options passed to the hydrate function */
30
- hydrateOptions?: HydrateOptions;
31
- }
32
- interface PersistedQueryClientSaveOptions extends PersistQueryClientRootOptions {
33
- /** The options passed to the dehydrate function */
34
- dehydrateOptions?: DehydrateOptions;
35
- }
36
- interface PersistQueryClientOptions extends PersistedQueryClientRestoreOptions, PersistedQueryClientSaveOptions, PersistQueryClientRootOptions {
37
- }
38
- /**
39
- * Restores persisted data to the QueryCache
40
- * - data obtained from persister.restoreClient
41
- * - data is hydrated using hydrateOptions
42
- * If data is expired, busted, empty, or throws, it runs persister.removeClient
43
- */
44
- declare function persistQueryClientRestore({ queryClient, persister, maxAge, buster, hydrateOptions, }: PersistedQueryClientRestoreOptions): Promise<void>;
45
- /**
46
- * Persists data from the QueryCache
47
- * - data dehydrated using dehydrateOptions
48
- * - data is persisted using persister.persistClient
49
- */
50
- declare function persistQueryClientSave({ queryClient, persister, buster, dehydrateOptions, }: PersistedQueryClientSaveOptions): Promise<void>;
51
- /**
52
- * Subscribe to QueryCache and MutationCache updates (for persisting)
53
- * @returns an unsubscribe function (to discontinue monitoring)
54
- */
55
- declare function persistQueryClientSubscribe(props: PersistedQueryClientSaveOptions): () => void;
56
- /**
57
- * Restores persisted data to QueryCache and persists further changes.
58
- */
59
- declare function persistQueryClient(props: PersistQueryClientOptions): [() => void, Promise<void>];
60
-
61
- export { type PersistQueryClientOptions, type PersistQueryClientRootOptions, type PersistedClient, type PersistedQueryClientRestoreOptions, type PersistedQueryClientSaveOptions, type Persister, type Promisable, persistQueryClient, persistQueryClientRestore, persistQueryClientSave, persistQueryClientSubscribe };
1
+ export { persistQueryClientRestore_alias_1 as persistQueryClientRestore } from './_tsup-dts-rollup.js';
2
+ export { persistQueryClientSave_alias_1 as persistQueryClientSave } from './_tsup-dts-rollup.js';
3
+ export { persistQueryClientSubscribe_alias_1 as persistQueryClientSubscribe } from './_tsup-dts-rollup.js';
4
+ export { persistQueryClient_alias_1 as persistQueryClient } from './_tsup-dts-rollup.js';
5
+ export { Promisable_alias_1 as Promisable } from './_tsup-dts-rollup.js';
6
+ export { Persister_alias_1 as Persister } from './_tsup-dts-rollup.js';
7
+ export { PersistedClient_alias_1 as PersistedClient } from './_tsup-dts-rollup.js';
8
+ export { PersistQueryClientRootOptions_alias_1 as PersistQueryClientRootOptions } from './_tsup-dts-rollup.js';
9
+ export { PersistedQueryClientRestoreOptions_alias_1 as PersistedQueryClientRestoreOptions } from './_tsup-dts-rollup.js';
10
+ export { PersistedQueryClientSaveOptions_alias_1 as PersistedQueryClientSaveOptions } from './_tsup-dts-rollup.js';
11
+ export { PersistQueryClientOptions_alias_1 as PersistQueryClientOptions } from './_tsup-dts-rollup.js';
@@ -1,11 +1,2 @@
1
- import { PersistedClient } from './persist.cjs';
2
- import '@tanstack/query-core';
3
-
4
- type PersistRetryer = (props: {
5
- persistedClient: PersistedClient;
6
- error: Error;
7
- errorCount: number;
8
- }) => PersistedClient | undefined;
9
- declare const removeOldestQuery: PersistRetryer;
10
-
11
- export { type PersistRetryer, removeOldestQuery };
1
+ export { PersistRetryer_alias_1 as PersistRetryer } from './_tsup-dts-rollup.cjs';
2
+ export { removeOldestQuery_alias_1 as removeOldestQuery } from './_tsup-dts-rollup.cjs';
@@ -1,11 +1,2 @@
1
- import { PersistedClient } from './persist.js';
2
- import '@tanstack/query-core';
3
-
4
- type PersistRetryer = (props: {
5
- persistedClient: PersistedClient;
6
- error: Error;
7
- errorCount: number;
8
- }) => PersistedClient | undefined;
9
- declare const removeOldestQuery: PersistRetryer;
10
-
11
- export { type PersistRetryer, removeOldestQuery };
1
+ export { PersistRetryer_alias_1 as PersistRetryer } from './_tsup-dts-rollup.js';
2
+ export { removeOldestQuery_alias_1 as removeOldestQuery } from './_tsup-dts-rollup.js';
@@ -0,0 +1,246 @@
1
+ import type { DehydratedState } from '@tanstack/query-core';
2
+ import type { DehydrateOptions } from '@tanstack/query-core';
3
+ import type { HydrateOptions } from '@tanstack/query-core';
4
+ import { Options } from 'tsup';
5
+ import type { Query } from '@tanstack/query-core';
6
+ import type { QueryClient } from '@tanstack/query-core';
7
+ import type { QueryFilters } from '@tanstack/query-core';
8
+ import type { QueryFunctionContext } from '@tanstack/query-core';
9
+ import type { QueryKey } from '@tanstack/query-core';
10
+ import type { QueryState } from '@tanstack/query-core';
11
+ import { UserConfig } from 'vite';
12
+
13
+ declare interface AsyncStorage<TStorageValue = string> {
14
+ getItem: (key: string) => MaybePromise<TStorageValue | undefined | null>;
15
+ setItem: (key: string, value: TStorageValue) => MaybePromise<unknown>;
16
+ removeItem: (key: string) => MaybePromise<void>;
17
+ entries?: () => MaybePromise<Array<[key: string, value: TStorageValue]>>;
18
+ }
19
+ export { AsyncStorage }
20
+ export { AsyncStorage as AsyncStorage_alias_1 }
21
+
22
+ export declare function createMockPersister(): Persister;
23
+
24
+ export declare function createSpyPersister(): Persister;
25
+
26
+ export declare const default_alias: any[];
27
+
28
+ export declare const default_alias_1: any[];
29
+
30
+ export declare const default_alias_2: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
31
+
32
+ export declare const default_alias_3: UserConfig;
33
+
34
+ /**
35
+ * Warning: experimental feature.
36
+ * This utility function enables fine-grained query persistence.
37
+ * Simple add it as a `persister` parameter to `useQuery` or `defaultOptions` on `queryClient`.
38
+ *
39
+ * ```
40
+ * useQuery({
41
+ queryKey: ['myKey'],
42
+ queryFn: fetcher,
43
+ persister: createPersister({
44
+ storage: localStorage,
45
+ }),
46
+ })
47
+ ```
48
+ */
49
+ declare function experimental_createQueryPersister<TStorageValue = string>({ storage, buster, maxAge, serialize, deserialize, prefix, refetchOnRestore, filters, }: StoragePersisterOptions<TStorageValue>): {
50
+ persisterFn: <T, TQueryKey extends QueryKey>(queryFn: (context: QueryFunctionContext<TQueryKey>) => T | Promise<T>, ctx: QueryFunctionContext<TQueryKey>, query: Query) => Promise<T>;
51
+ persistQuery: (query: Query) => Promise<void>;
52
+ persistQueryByKey: (queryKey: QueryKey, queryClient: QueryClient) => Promise<void>;
53
+ retrieveQuery: <T>(queryHash: string, afterRestoreMacroTask?: (persistedQuery: PersistedQuery) => void) => Promise<T | undefined>;
54
+ persisterGc: () => Promise<void>;
55
+ restoreQueries: (queryClient: QueryClient, filters?: Pick<QueryFilters, "queryKey" | "exact">) => Promise<void>;
56
+ removeQueries: (filters?: Pick<QueryFilters, "queryKey" | "exact">) => Promise<void>;
57
+ };
58
+ export { experimental_createQueryPersister }
59
+ export { experimental_createQueryPersister as experimental_createQueryPersister_alias_1 }
60
+
61
+ /**
62
+ * @param {Object} opts - Options for building configurations.
63
+ * @param {string[]} opts.entry - The entry array.
64
+ * @returns {import('tsup').Options}
65
+ */
66
+ export declare function legacyConfig(opts: {
67
+ entry: string[];
68
+ }): Options;
69
+
70
+ declare type MaybePromise<T> = T | Promise<T>;
71
+ export { MaybePromise }
72
+ export { MaybePromise as MaybePromise_alias_1 }
73
+
74
+ /**
75
+ * @param {Object} opts - Options for building configurations.
76
+ * @param {string[]} opts.entry - The entry array.
77
+ * @returns {import('tsup').Options}
78
+ */
79
+ export declare function modernConfig(opts: {
80
+ entry: string[];
81
+ }): Options;
82
+
83
+ declare interface PersistedClient {
84
+ timestamp: number;
85
+ buster: string;
86
+ clientState: DehydratedState;
87
+ }
88
+ export { PersistedClient }
89
+ export { PersistedClient as PersistedClient_alias_1 }
90
+
91
+ declare interface PersistedQuery {
92
+ buster: string;
93
+ queryHash: string;
94
+ queryKey: QueryKey;
95
+ state: QueryState;
96
+ }
97
+ export { PersistedQuery }
98
+ export { PersistedQuery as PersistedQuery_alias_1 }
99
+
100
+ declare interface PersistedQueryClientRestoreOptions extends PersistQueryClientRootOptions {
101
+ /** The max-allowed age of the cache in milliseconds.
102
+ * If a persisted cache is found that is older than this
103
+ * time, it will be discarded */
104
+ maxAge?: number;
105
+ /** The options passed to the hydrate function */
106
+ hydrateOptions?: HydrateOptions;
107
+ }
108
+ export { PersistedQueryClientRestoreOptions }
109
+ export { PersistedQueryClientRestoreOptions as PersistedQueryClientRestoreOptions_alias_1 }
110
+
111
+ declare interface PersistedQueryClientSaveOptions extends PersistQueryClientRootOptions {
112
+ /** The options passed to the dehydrate function */
113
+ dehydrateOptions?: DehydrateOptions;
114
+ }
115
+ export { PersistedQueryClientSaveOptions }
116
+ export { PersistedQueryClientSaveOptions as PersistedQueryClientSaveOptions_alias_1 }
117
+
118
+ declare interface Persister {
119
+ persistClient: (persistClient: PersistedClient) => Promisable<void>;
120
+ restoreClient: () => Promisable<PersistedClient | undefined>;
121
+ removeClient: () => Promisable<void>;
122
+ }
123
+ export { Persister }
124
+ export { Persister as Persister_alias_1 }
125
+
126
+ declare const PERSISTER_KEY_PREFIX = "tanstack-query";
127
+ export { PERSISTER_KEY_PREFIX }
128
+ export { PERSISTER_KEY_PREFIX as PERSISTER_KEY_PREFIX_alias_1 }
129
+
130
+ /**
131
+ * Restores persisted data to QueryCache and persists further changes.
132
+ */
133
+ declare function persistQueryClient(props: PersistQueryClientOptions): [() => void, Promise<void>];
134
+ export { persistQueryClient }
135
+ export { persistQueryClient as persistQueryClient_alias_1 }
136
+
137
+ declare interface PersistQueryClientOptions extends PersistedQueryClientRestoreOptions, PersistedQueryClientSaveOptions, PersistQueryClientRootOptions {
138
+ }
139
+ export { PersistQueryClientOptions }
140
+ export { PersistQueryClientOptions as PersistQueryClientOptions_alias_1 }
141
+
142
+ /**
143
+ * Restores persisted data to the QueryCache
144
+ * - data obtained from persister.restoreClient
145
+ * - data is hydrated using hydrateOptions
146
+ * If data is expired, busted, empty, or throws, it runs persister.removeClient
147
+ */
148
+ declare function persistQueryClientRestore({ queryClient, persister, maxAge, buster, hydrateOptions, }: PersistedQueryClientRestoreOptions): Promise<void>;
149
+ export { persistQueryClientRestore }
150
+ export { persistQueryClientRestore as persistQueryClientRestore_alias_1 }
151
+
152
+ declare interface PersistQueryClientRootOptions {
153
+ /** The QueryClient to persist */
154
+ queryClient: QueryClient;
155
+ /** The Persister interface for storing and restoring the cache
156
+ * to/from a persisted location */
157
+ persister: Persister;
158
+ /** A unique string that can be used to forcefully
159
+ * invalidate existing caches if they do not share the same buster string */
160
+ buster?: string;
161
+ }
162
+ export { PersistQueryClientRootOptions }
163
+ export { PersistQueryClientRootOptions as PersistQueryClientRootOptions_alias_1 }
164
+
165
+ /**
166
+ * Persists data from the QueryCache
167
+ * - data dehydrated using dehydrateOptions
168
+ * - data is persisted using persister.persistClient
169
+ */
170
+ declare function persistQueryClientSave({ queryClient, persister, buster, dehydrateOptions, }: PersistedQueryClientSaveOptions): Promise<void>;
171
+ export { persistQueryClientSave }
172
+ export { persistQueryClientSave as persistQueryClientSave_alias_1 }
173
+
174
+ /**
175
+ * Subscribe to QueryCache and MutationCache updates (for persisting)
176
+ * @returns an unsubscribe function (to discontinue monitoring)
177
+ */
178
+ declare function persistQueryClientSubscribe(props: PersistedQueryClientSaveOptions): () => void;
179
+ export { persistQueryClientSubscribe }
180
+ export { persistQueryClientSubscribe as persistQueryClientSubscribe_alias_1 }
181
+
182
+ declare type PersistRetryer = (props: {
183
+ persistedClient: PersistedClient;
184
+ error: Error;
185
+ errorCount: number;
186
+ }) => PersistedClient | undefined;
187
+ export { PersistRetryer }
188
+ export { PersistRetryer as PersistRetryer_alias_1 }
189
+
190
+ declare type Promisable<T> = T | PromiseLike<T>;
191
+ export { Promisable }
192
+ export { Promisable as Promisable_alias_1 }
193
+
194
+ declare const removeOldestQuery: PersistRetryer;
195
+ export { removeOldestQuery }
196
+ export { removeOldestQuery as removeOldestQuery_alias_1 }
197
+
198
+ declare interface StoragePersisterOptions<TStorageValue = string> {
199
+ /** The storage client used for setting and retrieving items from cache.
200
+ * For SSR pass in `undefined`.
201
+ */
202
+ storage: AsyncStorage<TStorageValue> | undefined | null;
203
+ /**
204
+ * How to serialize the data to storage.
205
+ * @default `JSON.stringify`
206
+ */
207
+ serialize?: (persistedQuery: PersistedQuery) => MaybePromise<TStorageValue>;
208
+ /**
209
+ * How to deserialize the data from storage.
210
+ * @default `JSON.parse`
211
+ */
212
+ deserialize?: (cachedString: TStorageValue) => MaybePromise<PersistedQuery>;
213
+ /**
214
+ * A unique string that can be used to forcefully invalidate existing caches,
215
+ * if they do not share the same buster string
216
+ */
217
+ buster?: string;
218
+ /**
219
+ * The max-allowed age of the cache in milliseconds.
220
+ * If a persisted cache is found that is older than this
221
+ * time, it will be discarded
222
+ * @default 24 hours
223
+ */
224
+ maxAge?: number;
225
+ /**
226
+ * Prefix to be used for storage key.
227
+ * Storage key is a combination of prefix and query hash in a form of `prefix-queryHash`.
228
+ * @default 'tanstack-query'
229
+ */
230
+ prefix?: string;
231
+ /**
232
+ * If set to `true`, the query will refetch on successful query restoration if the data is stale.
233
+ * If set to `false`, the query will not refetch on successful query restoration.
234
+ * If set to `'always'`, the query will always refetch on successful query restoration.
235
+ * Defaults to `true`.
236
+ */
237
+ refetchOnRestore?: boolean | 'always';
238
+ /**
239
+ * Filters to narrow down which Queries should be persisted.
240
+ */
241
+ filters?: QueryFilters;
242
+ }
243
+ export { StoragePersisterOptions }
244
+ export { StoragePersisterOptions as StoragePersisterOptions_alias_1 }
245
+
246
+ export { }