tsdf 17.0.0-alpha.5 → 17.0.0-alpha.7
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/dist/main.d.ts +197 -93
- package/dist/main.js +18 -24
- package/docs/README.md +1 -1
- package/docs/invalidation.md +3 -3
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -1528,12 +1528,16 @@ type SnapshotConsistency = 'optimistic' | 'confirmed';
|
|
|
1528
1528
|
//#endregion
|
|
1529
1529
|
//#region src/collectionStore/useMultipleItems.d.ts
|
|
1530
1530
|
type UseMultipleItemsOptions$1<ItemState extends ValidStoreState, Selected> = {
|
|
1531
|
-
selector?: (data: ItemState | null) => Selected;
|
|
1532
|
-
returnIdleStatus?: boolean;
|
|
1533
|
-
returnRefetchingStatus?: boolean;
|
|
1534
|
-
omitPayload?: boolean;
|
|
1535
|
-
|
|
1536
|
-
|
|
1531
|
+
/** Maps each item before it is returned from the hook. */selector?: (data: ItemState | null) => Selected; /** Returns `idle` instead of `loading` while items have not been fetched. */
|
|
1532
|
+
returnIdleStatus?: boolean; /** Returns `refetching` instead of keeping `loaded` status during refetches. */
|
|
1533
|
+
returnRefetchingStatus?: boolean; /** Omits `payload` from each query result unless overridden per item. */
|
|
1534
|
+
omitPayload?: boolean;
|
|
1535
|
+
/**
|
|
1536
|
+
* Only fetches when an item is missing from state, skipping stale-state and
|
|
1537
|
+
* invalidation refetches.
|
|
1538
|
+
*/
|
|
1539
|
+
disableRefetches?: boolean; /** Prevents automatic mount refetches for stale loaded data. */
|
|
1540
|
+
disableRefetchOnMount?: boolean; /** Marks these subscriptions as off-screen, lowering automatic fetch priority. */
|
|
1537
1541
|
isOffScreen?: boolean;
|
|
1538
1542
|
/**
|
|
1539
1543
|
* Debounces automatic fetches caused by payload changes, while selection
|
|
@@ -1575,13 +1579,17 @@ type TSFDUseCollectionItemReturn<Selected, ItemPayload, QueryMetadata extends un
|
|
|
1575
1579
|
queryMetadata: QueryMetadata;
|
|
1576
1580
|
};
|
|
1577
1581
|
type CollectionUseMultipleItemsQuery<ItemPayload extends ValidPayload, QueryMetadata extends undefined | Record<string, unknown> = undefined> = {
|
|
1578
|
-
payload: ItemPayload;
|
|
1579
|
-
queryMetadata?: QueryMetadata;
|
|
1580
|
-
omitPayload?: boolean;
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1582
|
+
/** Item payload to subscribe to and fetch when needed. */payload: ItemPayload; /** Metadata returned with this query result for caller-side bookkeeping. */
|
|
1583
|
+
queryMetadata?: QueryMetadata; /** Omits `payload` from this query result. */
|
|
1584
|
+
omitPayload?: boolean;
|
|
1585
|
+
/**
|
|
1586
|
+
* Only fetches when the item is missing from state, skipping stale-state and
|
|
1587
|
+
* invalidation refetches.
|
|
1588
|
+
*/
|
|
1589
|
+
disableRefetches?: boolean; /** Prevents the automatic mount refetch for stale loaded data. */
|
|
1590
|
+
disableRefetchOnMount?: boolean; /** Returns `idle` instead of `loading` while the item has not been fetched. */
|
|
1591
|
+
returnIdleStatus?: boolean; /** Returns `refetching` instead of keeping `loaded` status during refetches. */
|
|
1592
|
+
returnRefetchingStatus?: boolean; /** Marks this subscription as off-screen, lowering automatic fetch priority. */
|
|
1585
1593
|
isOffScreen?: boolean;
|
|
1586
1594
|
};
|
|
1587
1595
|
type OnCollectionItemInvalidate<ItemState extends ValidStoreState, ItemPayload extends ValidPayload> = (props: {
|
|
@@ -1752,22 +1760,22 @@ type CollectionStore<ItemState extends ValidStoreState, ItemPayload extends Vali
|
|
|
1752
1760
|
useMultipleItems: <Selected = ItemState | null, QueryMetadata extends undefined | Record<string, unknown> = undefined>(items: CollectionUseMultipleItemsQuery<ItemPayload, QueryMetadata>[], options?: UseMultipleItemsOptions$1<ItemState, Selected>) => readonly TSFDUseCollectionItemReturn<Selected, ItemPayload, QueryMetadata>[];
|
|
1753
1761
|
useItem: <Selected = ItemState | null>(payload: ItemPayload | undefined | false | null, options?: UseItemOptions$1<ItemState, Selected>) => TSFDUseCollectionItemReturn<Selected, ItemPayload>;
|
|
1754
1762
|
useListItemIsLoading: (payload: ItemPayload, args: {
|
|
1755
|
-
itemId: string;
|
|
1756
|
-
selector: (data: ItemState | null) => unknown;
|
|
1757
|
-
loadItemFallback?: () => void;
|
|
1763
|
+
/** Unique identifier of the sub-item within the collection item. */itemId: string; /** Extracts the sub-item from the collection item data. */
|
|
1764
|
+
selector: (data: ItemState | null) => unknown; /** Called if the sub-item is still missing and no refetch is in progress. */
|
|
1765
|
+
loadItemFallback?: () => void; /** Forces a high-priority fetch and keeps the hook loading until data is loaded. */
|
|
1758
1766
|
ensureIsLoaded?: boolean;
|
|
1759
1767
|
}) => boolean;
|
|
1760
1768
|
useListItemIsDeleted: (payload: ItemPayload, args: {
|
|
1761
|
-
itemId: string;
|
|
1762
|
-
selector: (data: ItemState | null) => unknown;
|
|
1763
|
-
onDelete?: () => void;
|
|
1769
|
+
/** Unique identifier of the sub-item within the collection item. */itemId: string; /** Extracts the sub-item from the collection item data. */
|
|
1770
|
+
selector: (data: ItemState | null) => unknown; /** Called once when deletion is detected. */
|
|
1771
|
+
onDelete?: () => void; /** Forces a high-priority fetch and keeps the hook loading until data is loaded. */
|
|
1764
1772
|
ensureIsLoaded?: boolean;
|
|
1765
1773
|
}) => boolean;
|
|
1766
1774
|
useListItem: <Selected>(payload: ItemPayload, args: {
|
|
1767
|
-
itemId: string;
|
|
1768
|
-
selector: (data: ItemState | null) => Selected;
|
|
1769
|
-
loadItemFallback?: () => void;
|
|
1770
|
-
onDelete?: () => void;
|
|
1775
|
+
/** Unique identifier of the sub-item within the collection item. */itemId: string; /** Extracts and maps the sub-item from the collection item data. */
|
|
1776
|
+
selector: (data: ItemState | null) => Selected; /** Called if the sub-item is still missing and no refetch is in progress. */
|
|
1777
|
+
loadItemFallback?: () => void; /** Called once when deletion is detected. */
|
|
1778
|
+
onDelete?: () => void; /** Forces a high-priority fetch and keeps the hook loading until data is loaded. */
|
|
1771
1779
|
ensureIsLoaded?: boolean;
|
|
1772
1780
|
}) => {
|
|
1773
1781
|
isLoading: boolean;
|
|
@@ -1977,32 +1985,40 @@ type DocumentStore<State extends ValidStoreState, TOfflineOperations extends Doc
|
|
|
1977
1985
|
parseOfflineResolutionConflict: (resolution: OfflineResolutionRecord) => ParsedOfflineResolutionConflictResultForStore<ResolvedDocumentOfflineOperations<TOfflineOperations>>;
|
|
1978
1986
|
resolveOfflineResolution: <TName extends keyof ResolvedDocumentOfflineOperations<TOfflineOperations> & string>(resolutionId: string, operationName: TName, resolution: OfflineResolutionActionForOperation<ResolvedDocumentOfflineOperations<TOfflineOperations>, TName>) => Promise<void> | void;
|
|
1979
1987
|
useDocument: <Selected = State | null>(args?: {
|
|
1980
|
-
selector?: (data: State | null) => Selected;
|
|
1981
|
-
disabled?: boolean;
|
|
1988
|
+
/** Maps the document data before it is returned from the hook. */selector?: (data: State | null) => Selected; /** Disables this hook subscription and prevents automatic fetches. */
|
|
1989
|
+
disabled?: boolean; /** Marks this subscription as off-screen, lowering automatic fetch priority. */
|
|
1982
1990
|
isOffScreen?: boolean;
|
|
1983
|
-
|
|
1984
|
-
|
|
1991
|
+
/**
|
|
1992
|
+
* Only fetches when the document is missing from state, skipping stale-state
|
|
1993
|
+
* and invalidation refetches.
|
|
1994
|
+
*/
|
|
1995
|
+
disableRefetches?: boolean; /** Prevents the automatic mount refetch for stale loaded data. */
|
|
1996
|
+
disableRefetchOnMount?: boolean; /** Returns `idle` instead of `loading` while the document has not been fetched. */
|
|
1985
1997
|
returnIdleStatus?: boolean;
|
|
1986
|
-
|
|
1998
|
+
/**
|
|
1999
|
+
* Forces a high-priority fetch on mount and keeps the hook in `loading`
|
|
2000
|
+
* until the document finishes loading.
|
|
2001
|
+
*/
|
|
2002
|
+
ensureIsLoaded?: boolean; /** Returns `refetching` instead of keeping `loaded` status during refetches. */
|
|
1987
2003
|
returnRefetchingStatus?: boolean;
|
|
1988
2004
|
}) => TSDFUseDocumentReturn<Selected>;
|
|
1989
2005
|
useListItemIsLoading: (args: {
|
|
1990
|
-
itemId: string;
|
|
1991
|
-
selector: (data: State | null) => unknown;
|
|
1992
|
-
loadItemFallback?: () => void;
|
|
2006
|
+
/** Unique identifier of the item within the document. */itemId: string; /** Extracts the item from the document data. */
|
|
2007
|
+
selector: (data: State | null) => unknown; /** Called if the item is still missing and no refetch is in progress. */
|
|
2008
|
+
loadItemFallback?: () => void; /** Forces a high-priority fetch and keeps the hook loading until data is loaded. */
|
|
1993
2009
|
ensureIsLoaded?: boolean;
|
|
1994
2010
|
}) => boolean;
|
|
1995
2011
|
useListItemIsDeleted: (args: {
|
|
1996
|
-
itemId: string;
|
|
1997
|
-
selector: (data: State | null) => unknown;
|
|
1998
|
-
onDelete?: () => void;
|
|
2012
|
+
/** Unique identifier of the item within the document. */itemId: string; /** Extracts the item from the document data. */
|
|
2013
|
+
selector: (data: State | null) => unknown; /** Called once when deletion is detected. */
|
|
2014
|
+
onDelete?: () => void; /** Forces a high-priority fetch and keeps the hook loading until data is loaded. */
|
|
1999
2015
|
ensureIsLoaded?: boolean;
|
|
2000
2016
|
}) => boolean;
|
|
2001
2017
|
useListItem: <Selected>(args: {
|
|
2002
|
-
itemId: string;
|
|
2003
|
-
selector: (data: State | null) => Selected;
|
|
2004
|
-
loadItemFallback?: () => void;
|
|
2005
|
-
onDelete?: () => void;
|
|
2018
|
+
/** Unique identifier of the item within the document. */itemId: string; /** Extracts and maps the item from the document data. */
|
|
2019
|
+
selector: (data: State | null) => Selected; /** Called if the item is still missing and no refetch is in progress. */
|
|
2020
|
+
loadItemFallback?: () => void; /** Called once when deletion is detected. */
|
|
2021
|
+
onDelete?: () => void; /** Forces a high-priority fetch and keeps the hook loading until data is loaded. */
|
|
2006
2022
|
ensureIsLoaded?: boolean;
|
|
2007
2023
|
}) => {
|
|
2008
2024
|
isLoading: boolean;
|
|
@@ -2065,6 +2081,12 @@ type TSFDListQueryState<ItemState extends ValidStoreState, QueryPayload extends
|
|
|
2065
2081
|
itemLoadedFields: Record<string, string[]>;
|
|
2066
2082
|
itemFieldInvalidationFields: Record<string, string[]>;
|
|
2067
2083
|
};
|
|
2084
|
+
/**
|
|
2085
|
+
* Partial-resource fields to request.
|
|
2086
|
+
*
|
|
2087
|
+
* Pass a field-name array to load only those fields, or `'*'` to load the
|
|
2088
|
+
* complete item.
|
|
2089
|
+
*/
|
|
2068
2090
|
type FieldsInput = string[] | '*';
|
|
2069
2091
|
type TSFDUseListQueryReturn<Selected, QueryPayload, QueryMetadata extends undefined | Record<string, unknown> = undefined, HasPartialResources extends boolean = false> = {
|
|
2070
2092
|
items: Selected[];
|
|
@@ -2116,35 +2138,55 @@ type ListQueryStoreInitialData<ItemState extends ValidStoreState, QueryPayload e
|
|
|
2116
2138
|
}[];
|
|
2117
2139
|
};
|
|
2118
2140
|
type ListQueryUseMultipleItemsQuery<ItemPayload extends ValidPayload, QueryMetadata extends undefined | Record<string, unknown> = undefined> = {
|
|
2119
|
-
payload: ItemPayload;
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2141
|
+
/** Item payload to subscribe to and fetch when needed. */payload: ItemPayload;
|
|
2142
|
+
/**
|
|
2143
|
+
* Partial-resource fields to request for this item.
|
|
2144
|
+
*
|
|
2145
|
+
* Pass `'*'` to fetch the complete item. This option is required when
|
|
2146
|
+
* `partialResources` is enabled and optional otherwise.
|
|
2147
|
+
*/
|
|
2148
|
+
fields?: FieldsInput; /** Metadata returned with this item result for caller-side bookkeeping. */
|
|
2149
|
+
queryMetadata?: QueryMetadata;
|
|
2150
|
+
/**
|
|
2151
|
+
* Only fetches when the item is missing from state, skipping stale-state and
|
|
2152
|
+
* invalidation refetches.
|
|
2153
|
+
*/
|
|
2154
|
+
disableRefetches?: boolean; /** Prevents the automatic mount refetch for stale loaded data. */
|
|
2155
|
+
disableRefetchOnMount?: boolean; /** Returns `idle` instead of `loading` while the item has not been fetched. */
|
|
2156
|
+
returnIdleStatus?: boolean; /** Returns `refetching` instead of keeping `loaded` status during refetches. */
|
|
2125
2157
|
returnRefetchingStatus?: boolean;
|
|
2126
2158
|
/**
|
|
2127
2159
|
* When requested fields are missing but cached partial data exists, return
|
|
2128
2160
|
* `refetching` instead of `loading`.
|
|
2129
2161
|
*/
|
|
2130
|
-
showPartialAsRefetching?: boolean;
|
|
2162
|
+
showPartialAsRefetching?: boolean; /** Marks this subscription as off-screen, lowering automatic fetch priority. */
|
|
2131
2163
|
isOffScreen?: boolean;
|
|
2132
2164
|
};
|
|
2133
2165
|
type ListQueryUseMultipleListQueriesQuery<QueryPayload extends ValidPayload, QueryMetadata extends undefined | Record<string, unknown> = undefined> = {
|
|
2134
|
-
payload: QueryPayload;
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2166
|
+
/** Query payload to subscribe to and fetch when needed. */payload: QueryPayload;
|
|
2167
|
+
/**
|
|
2168
|
+
* Partial-resource fields to request for each item in this query.
|
|
2169
|
+
*
|
|
2170
|
+
* Pass `'*'` to fetch complete items. This option is required when
|
|
2171
|
+
* `partialResources` is enabled and optional otherwise.
|
|
2172
|
+
*/
|
|
2173
|
+
fields?: FieldsInput; /** Metadata returned with this query result for caller-side bookkeeping. */
|
|
2174
|
+
queryMetadata?: QueryMetadata; /** Omits `payload` from this query result. */
|
|
2175
|
+
omitPayload?: boolean;
|
|
2176
|
+
/**
|
|
2177
|
+
* Only fetches when the query is missing from state, skipping stale-state and
|
|
2178
|
+
* invalidation refetches.
|
|
2179
|
+
*/
|
|
2180
|
+
disableRefetches?: boolean; /** Prevents the automatic mount refetch for stale loaded data. */
|
|
2181
|
+
disableRefetchOnMount?: boolean; /** Returns `idle` instead of `loading` while the query has not been fetched. */
|
|
2182
|
+
returnIdleStatus?: boolean; /** Returns `refetching` instead of keeping `loaded` status during refetches. */
|
|
2141
2183
|
returnRefetchingStatus?: boolean;
|
|
2142
2184
|
/**
|
|
2143
2185
|
* When requested fields are missing but cached partial data exists, return
|
|
2144
2186
|
* `refetching` instead of `loading`.
|
|
2145
2187
|
*/
|
|
2146
|
-
showPartialAsRefetching?: boolean;
|
|
2147
|
-
isOffScreen?: boolean;
|
|
2188
|
+
showPartialAsRefetching?: boolean; /** Marks this subscription as off-screen, lowering automatic fetch priority. */
|
|
2189
|
+
isOffScreen?: boolean; /** Number of items to request when fetching this query page. */
|
|
2148
2190
|
loadSize?: number;
|
|
2149
2191
|
};
|
|
2150
2192
|
type OnListQueryInvalidate<QueryPayload extends ValidPayload> = (query: QueryPayload, priority: FetchType) => void;
|
|
@@ -2164,10 +2206,10 @@ type OptimisticListUpdate<ItemState extends ValidStoreState, QueryPayload extend
|
|
|
2164
2206
|
};
|
|
2165
2207
|
};
|
|
2166
2208
|
type QueryFetchPayload<QueryPayload extends ValidPayload> = {
|
|
2167
|
-
type: 'load' | 'loadMore';
|
|
2168
|
-
payload: QueryPayload;
|
|
2169
|
-
offset: number;
|
|
2170
|
-
limit: number;
|
|
2209
|
+
/** Whether this request loads the first page or a later page. */type: 'load' | 'loadMore'; /** Query payload being fetched. */
|
|
2210
|
+
payload: QueryPayload; /** Offset used for offset-paginated fetches. */
|
|
2211
|
+
offset: number; /** Maximum number of items requested. */
|
|
2212
|
+
limit: number; /** Partial-resource fields requested for each item in the fetched query. */
|
|
2171
2213
|
fields?: string[];
|
|
2172
2214
|
};
|
|
2173
2215
|
type OffsetPaginationConfig = {
|
|
@@ -2218,24 +2260,40 @@ type DerivedQueriesConfig<ItemState extends ValidStoreState, QueryPayload extend
|
|
|
2218
2260
|
deriveQuery: (queryPayload: QueryPayload, items: DerivedQueryItem<ItemState>[], context: DerivedQueryContext) => string[] | false;
|
|
2219
2261
|
};
|
|
2220
2262
|
type FieldsOption<HasPartialResources extends boolean> = HasPartialResources extends true ? {
|
|
2263
|
+
/**
|
|
2264
|
+
* Partial-resource fields to request.
|
|
2265
|
+
*
|
|
2266
|
+
* Pass `'*'` to fetch complete items. This option is required when
|
|
2267
|
+
* `partialResources` is enabled.
|
|
2268
|
+
*/
|
|
2221
2269
|
fields: FieldsInput;
|
|
2222
2270
|
} : {
|
|
2271
|
+
/**
|
|
2272
|
+
* Partial-resource fields to request.
|
|
2273
|
+
*
|
|
2274
|
+
* Pass `'*'` to fetch complete items. This option is optional when
|
|
2275
|
+
* `partialResources` is not enabled.
|
|
2276
|
+
*/
|
|
2223
2277
|
fields?: FieldsInput;
|
|
2224
2278
|
};
|
|
2225
2279
|
//#endregion
|
|
2226
2280
|
//#region src/listQueryStore/useMultipleItems.d.ts
|
|
2227
2281
|
type UseMultipleItemsOptions<ItemState extends ValidStoreState, Selected> = {
|
|
2228
|
-
selector?: (data: ItemState | null, payload: ValidPayload | null) => Selected;
|
|
2229
|
-
loadFromStateOnly?: boolean;
|
|
2230
|
-
returnIdleStatus?: boolean;
|
|
2282
|
+
/** Maps each item before it is returned from the hook. */selector?: (data: ItemState | null, payload: ValidPayload | null) => Selected; /** Reads only from the current store state and never schedules fetches. */
|
|
2283
|
+
loadFromStateOnly?: boolean; /** Returns `idle` instead of `loading` while items have not been fetched. */
|
|
2284
|
+
returnIdleStatus?: boolean; /** Returns `refetching` instead of keeping `loaded` status during refetches. */
|
|
2231
2285
|
returnRefetchingStatus?: boolean;
|
|
2232
2286
|
/**
|
|
2233
2287
|
* When requested fields are missing but cached partial data exists, return
|
|
2234
2288
|
* `refetching` instead of `loading`.
|
|
2235
2289
|
*/
|
|
2236
|
-
showPartialAsRefetching?: boolean;
|
|
2237
|
-
|
|
2238
|
-
|
|
2290
|
+
showPartialAsRefetching?: boolean;
|
|
2291
|
+
/**
|
|
2292
|
+
* Only fetches when an item is missing from state, skipping stale-state and
|
|
2293
|
+
* invalidation refetches.
|
|
2294
|
+
*/
|
|
2295
|
+
disableRefetches?: boolean; /** Prevents automatic mount refetches for stale loaded data. */
|
|
2296
|
+
disableRefetchOnMount?: boolean; /** Marks these subscriptions as off-screen, lowering automatic fetch priority. */
|
|
2239
2297
|
isOffScreen?: boolean;
|
|
2240
2298
|
/**
|
|
2241
2299
|
* Debounces automatic fetches caused by payload changes, while selection
|
|
@@ -2253,6 +2311,12 @@ type UseItemOptions<ItemState extends ValidStoreState, Selected> = UseMultipleIt
|
|
|
2253
2311
|
* `debouncePayload`.
|
|
2254
2312
|
*/
|
|
2255
2313
|
ensureIsLoaded?: boolean;
|
|
2314
|
+
/**
|
|
2315
|
+
* Partial-resource fields to request for this item.
|
|
2316
|
+
*
|
|
2317
|
+
* Pass `'*'` to fetch the complete item. This option is required when
|
|
2318
|
+
* `partialResources` is enabled and optional otherwise.
|
|
2319
|
+
*/
|
|
2256
2320
|
fields?: FieldsInput;
|
|
2257
2321
|
/**
|
|
2258
2322
|
* When requested fields are missing but cached partial data exists, return
|
|
@@ -2263,18 +2327,22 @@ type UseItemOptions<ItemState extends ValidStoreState, Selected> = UseMultipleIt
|
|
|
2263
2327
|
//#endregion
|
|
2264
2328
|
//#region src/listQueryStore/useMultipleListQueries.d.ts
|
|
2265
2329
|
type UseMultipleListQueriesOptions<ItemState extends ValidStoreState, ItemPayload extends ValidPayload, SelectedItem> = {
|
|
2266
|
-
itemSelector?: (data: ItemState, itemPayload: ItemPayload, itemKey: string) => SelectedItem;
|
|
2267
|
-
returnIdleStatus?: boolean;
|
|
2330
|
+
/** Maps each query item before it is returned from the hook. */itemSelector?: (data: ItemState, itemPayload: ItemPayload, itemKey: string) => SelectedItem; /** Returns `idle` instead of `loading` while queries have not been fetched. */
|
|
2331
|
+
returnIdleStatus?: boolean; /** Returns `refetching` instead of keeping `loaded` status during refetches. */
|
|
2268
2332
|
returnRefetchingStatus?: boolean;
|
|
2269
2333
|
/**
|
|
2270
2334
|
* When requested fields are missing but cached partial data exists, return
|
|
2271
2335
|
* `refetching` instead of `loading`.
|
|
2272
2336
|
*/
|
|
2273
|
-
showPartialAsRefetching?: boolean;
|
|
2274
|
-
omitPayload?: boolean;
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2337
|
+
showPartialAsRefetching?: boolean; /** Omits `payload` from each query result unless overridden per query. */
|
|
2338
|
+
omitPayload?: boolean;
|
|
2339
|
+
/**
|
|
2340
|
+
* Only fetches when a query is missing from state, skipping stale-state and
|
|
2341
|
+
* invalidation refetches.
|
|
2342
|
+
*/
|
|
2343
|
+
disableRefetches?: boolean; /** Prevents automatic mount refetches for stale loaded data. */
|
|
2344
|
+
disableRefetchOnMount?: boolean; /** Marks these subscriptions as off-screen, lowering automatic fetch priority. */
|
|
2345
|
+
isOffScreen?: boolean; /** Number of items to request when fetching each query page. */
|
|
2278
2346
|
loadSize?: number;
|
|
2279
2347
|
/**
|
|
2280
2348
|
* Debounces automatic fetches caused by payload changes, while selection
|
|
@@ -2292,6 +2360,12 @@ type UseListQueryOptions<ItemState extends ValidStoreState, ItemPayload extends
|
|
|
2292
2360
|
* `debouncePayload`.
|
|
2293
2361
|
*/
|
|
2294
2362
|
ensureIsLoaded?: boolean;
|
|
2363
|
+
/**
|
|
2364
|
+
* Partial-resource fields to request for each item in this query.
|
|
2365
|
+
*
|
|
2366
|
+
* Pass `'*'` to fetch complete items. This option is required when
|
|
2367
|
+
* `partialResources` is enabled and optional otherwise.
|
|
2368
|
+
*/
|
|
2295
2369
|
fields?: FieldsInput;
|
|
2296
2370
|
/**
|
|
2297
2371
|
* When requested fields are missing but cached partial data exists, return
|
|
@@ -2337,8 +2411,20 @@ type ListQueryStoreStoreEvents<ItemPayload extends ValidPayload> = {
|
|
|
2337
2411
|
type ResolvedListQueryOfflineOperations<TOfflineOperations> = TOfflineOperations extends null ? Record<never, never> : Exclude<TOfflineOperations, null>;
|
|
2338
2412
|
type ListQueryHasPartialResources<TPartialResources extends boolean> = [TPartialResources] extends [true] ? true : false;
|
|
2339
2413
|
type ListQueryFetchFieldsOption<TPartialResources extends boolean> = ListQueryHasPartialResources<TPartialResources> extends true ? {
|
|
2414
|
+
/**
|
|
2415
|
+
* Partial-resource fields to request.
|
|
2416
|
+
*
|
|
2417
|
+
* Pass `'*'` to fetch complete items. This option is required when
|
|
2418
|
+
* `partialResources` is enabled.
|
|
2419
|
+
*/
|
|
2340
2420
|
fields: FieldsInput;
|
|
2341
2421
|
} : {
|
|
2422
|
+
/**
|
|
2423
|
+
* Partial-resource fields to request.
|
|
2424
|
+
*
|
|
2425
|
+
* Pass `'*'` to fetch complete items. This option is optional when
|
|
2426
|
+
* `partialResources` is not enabled.
|
|
2427
|
+
*/
|
|
2342
2428
|
fields?: FieldsInput;
|
|
2343
2429
|
};
|
|
2344
2430
|
type ListQueryScheduleFetchWithFieldsOption<TPartialResources extends boolean> = ScheduleFetchOptions & ListQueryFetchFieldsOption<TPartialResources>;
|
|
@@ -2402,18 +2488,14 @@ type ListQueryUseMultipleListQueriesApi<ItemState extends ValidStoreState, Query
|
|
|
2402
2488
|
<S = ItemState>(queries: ListQueryUseMultipleListQueriesQuery<QueryPayload, undefined>[], options: UseMultipleListQueriesOptions<ItemState, ItemPayload, S>): readonly TSFDUseListQueryReturn<S, QueryPayload, undefined>[];
|
|
2403
2489
|
};
|
|
2404
2490
|
type ListQueryUseListQueryApi<ItemState extends ValidStoreState, QueryPayload extends ValidPayload, ItemPayload extends ValidPayload, TPartialResources extends boolean> = {
|
|
2405
|
-
<SelectedItem = ItemState>(payload: QueryPayload | false | null | undefined, ...args: ListQueryHasPartialResources<TPartialResources> extends true ? [options: UseListQueryOptions<ItemState, ItemPayload, SelectedItem> &
|
|
2406
|
-
fields: FieldsInput;
|
|
2407
|
-
}] : [options?: UseListQueryOptions<ItemState, ItemPayload, SelectedItem>]): TSFDUseListQueryReturn<SelectedItem, QueryPayload, undefined>;
|
|
2491
|
+
<SelectedItem = ItemState>(payload: QueryPayload | false | null | undefined, ...args: ListQueryHasPartialResources<TPartialResources> extends true ? [options: UseListQueryOptions<ItemState, ItemPayload, SelectedItem> & FieldsOption<true>] : [options?: UseListQueryOptions<ItemState, ItemPayload, SelectedItem>]): TSFDUseListQueryReturn<SelectedItem, QueryPayload, undefined>;
|
|
2408
2492
|
};
|
|
2409
2493
|
type ListQueryUseMultipleItemsApi<ItemState extends ValidStoreState, ItemPayload extends ValidPayload, TPartialResources extends boolean> = {
|
|
2410
2494
|
<Selected = ItemState | null, QueryMetadata extends undefined | Record<string, unknown> = undefined>(items: (ListQueryUseMultipleItemsQuery<ItemPayload, QueryMetadata> & FieldsOption<ListQueryHasPartialResources<TPartialResources>>)[], options?: UseMultipleItemsOptions<ItemState, Selected>): readonly TSFDUseListItemReturn<Selected, ItemPayload, QueryMetadata>[];
|
|
2411
2495
|
<S = ItemState | null>(items: ListQueryUseMultipleItemsQuery<ItemPayload, undefined>[], options: UseMultipleItemsOptions<ItemState, S>): readonly TSFDUseListItemReturn<S, ItemPayload, undefined>[];
|
|
2412
2496
|
};
|
|
2413
2497
|
type ListQueryUseItemApi<ItemState extends ValidStoreState, ItemPayload extends ValidPayload, TPartialResources extends boolean> = {
|
|
2414
|
-
<Selected = ItemState | null>(itemPayload: ItemPayload | false | null | undefined, ...args: ListQueryHasPartialResources<TPartialResources> extends true ? [options: UseItemOptions<ItemState, Selected> &
|
|
2415
|
-
fields: FieldsInput;
|
|
2416
|
-
}] : [options?: UseItemOptions<ItemState, Selected>]): TSFDUseListItemReturn<Selected, ItemPayload>;
|
|
2498
|
+
<Selected = ItemState | null>(itemPayload: ItemPayload | false | null | undefined, ...args: ListQueryHasPartialResources<TPartialResources> extends true ? [options: UseItemOptions<ItemState, Selected> & FieldsOption<true>] : [options?: UseItemOptions<ItemState, Selected>]): TSFDUseListItemReturn<Selected, ItemPayload>;
|
|
2417
2499
|
};
|
|
2418
2500
|
type ListQueryUsePendingOfflineItemsApi<ItemState extends ValidStoreState, ItemPayload extends ValidPayload> = {
|
|
2419
2501
|
<SelectedItem = ItemState>(options?: UsePendingOfflineItemsOptions<ItemState, ItemPayload, SelectedItem>): TSFDUsePendingOfflineItemsReturn<SelectedItem, ItemPayload>;
|
|
@@ -2464,6 +2546,41 @@ type ListQueryAddItemToStateApi<ItemState extends ValidStoreState, QueryPayload
|
|
|
2464
2546
|
};
|
|
2465
2547
|
}) => void;
|
|
2466
2548
|
type ListQueryDeleteItemStateApi<ItemState extends ValidStoreState, ItemPayload extends ValidPayload> = (itemId: ItemPayload | ItemPayload[] | ListQueryFilterItem<ItemState, ItemPayload>) => void;
|
|
2549
|
+
type ListQueryInvalidateQueryAndItemsArgs<ItemState extends ValidStoreState, QueryPayload extends ValidPayload, ItemPayload extends ValidPayload> = {
|
|
2550
|
+
/** Invalidate every cached query and every cached item. */all: true; /** Fetch priority used for refetches triggered by this invalidation. */
|
|
2551
|
+
type?: FetchType;
|
|
2552
|
+
/**
|
|
2553
|
+
* Partial-resource fields to invalidate on matching items.
|
|
2554
|
+
*
|
|
2555
|
+
* Omit to invalidate the full item data.
|
|
2556
|
+
*/
|
|
2557
|
+
fields?: string[]; /** Not allowed when invalidating every query and item. */
|
|
2558
|
+
itemPayload?: undefined; /** Not allowed when invalidating every query and item. */
|
|
2559
|
+
queryPayload?: undefined;
|
|
2560
|
+
} | {
|
|
2561
|
+
/** Leave unset when invalidating selected queries or items. */all?: undefined;
|
|
2562
|
+
/**
|
|
2563
|
+
* Items to invalidate.
|
|
2564
|
+
*
|
|
2565
|
+
* Pass one payload, many payloads, a predicate over cached items, or
|
|
2566
|
+
* `false` to skip item invalidation.
|
|
2567
|
+
*/
|
|
2568
|
+
itemPayload: ItemPayload | ItemPayload[] | ListQueryFilterItem<ItemState, ItemPayload> | false;
|
|
2569
|
+
/**
|
|
2570
|
+
* Queries to invalidate.
|
|
2571
|
+
*
|
|
2572
|
+
* Pass one payload, many payloads, a predicate over cached queries, or
|
|
2573
|
+
* `false` to skip query invalidation.
|
|
2574
|
+
*/
|
|
2575
|
+
queryPayload: QueryPayload | QueryPayload[] | ListQueryFilterQuery<QueryPayload> | false; /** Fetch priority used for refetches triggered by this invalidation. */
|
|
2576
|
+
type?: FetchType;
|
|
2577
|
+
/**
|
|
2578
|
+
* Partial-resource fields to invalidate on matching items.
|
|
2579
|
+
*
|
|
2580
|
+
* Omit to invalidate the full item data.
|
|
2581
|
+
*/
|
|
2582
|
+
fields?: string[];
|
|
2583
|
+
};
|
|
2467
2584
|
type ListQueryStore<ItemState extends ValidStoreState, QueryPayload extends ValidPayload, ItemPayload extends ValidPayload, TPartialResources extends boolean = false, TOfflineOperations extends ListQueryOfflineOperationsConfig<ItemState, QueryPayload, ItemPayload> = null> = {
|
|
2468
2585
|
store: Store<TSFDListQueryState<ItemState, QueryPayload, ItemPayload>>;
|
|
2469
2586
|
events: Emitter<ListQueryStoreEvents>;
|
|
@@ -2506,12 +2623,7 @@ type ListQueryStore<ItemState extends ValidStoreState, QueryPayload extends Vali
|
|
|
2506
2623
|
scheduleItemFetch: ListQueryScheduleItemFetchApi<ItemPayload, TPartialResources>;
|
|
2507
2624
|
awaitItemFetch: ListQueryAwaitItemFetchApi<ItemState, ItemPayload, TPartialResources>;
|
|
2508
2625
|
getItemFromStateOrFetch: ListQueryGetItemFromStateOrFetchApi<ItemState, ItemPayload, TPartialResources>;
|
|
2509
|
-
invalidateQueryAndItems: (args:
|
|
2510
|
-
itemPayload: ItemPayload | ItemPayload[] | ListQueryFilterItem<ItemState, ItemPayload> | false;
|
|
2511
|
-
queryPayload: QueryPayload | QueryPayload[] | ListQueryFilterQuery<QueryPayload> | false;
|
|
2512
|
-
type?: FetchType;
|
|
2513
|
-
fields?: string[];
|
|
2514
|
-
}) => void;
|
|
2626
|
+
invalidateQueryAndItems: (args: ListQueryInvalidateQueryAndItemsArgs<ItemState, QueryPayload, ItemPayload>) => void;
|
|
2515
2627
|
invalidateItem: (itemId: ItemPayload | ItemPayload[] | ListQueryFilterItem<ItemState, ItemPayload>, priority?: FetchType) => void;
|
|
2516
2628
|
startItemMutation: (itemId: ItemPayload | ItemPayload[] | ListQueryFilterItem<ItemState, ItemPayload>) => () => void;
|
|
2517
2629
|
updateItemState: ListQueryUpdateItemStateApi<ItemState, ItemPayload>;
|
|
@@ -2523,7 +2635,7 @@ type ListQueryStore<ItemState extends ValidStoreState, QueryPayload extends Vali
|
|
|
2523
2635
|
useMultipleItems: ListQueryUseMultipleItemsApi<ItemState, ItemPayload, TPartialResources>;
|
|
2524
2636
|
useItem: ListQueryUseItemApi<ItemState, ItemPayload, TPartialResources>;
|
|
2525
2637
|
useFindItem: <SelectedItem = ItemState | null>(findItemFn: (item: ItemState, itemPayload: ItemPayload) => boolean, options?: {
|
|
2526
|
-
selector?: (data: ItemState, id: ItemPayload) => SelectedItem;
|
|
2638
|
+
/** Maps the matched item before it is returned from the hook. */selector?: (data: ItemState, id: ItemPayload) => SelectedItem;
|
|
2527
2639
|
}) => SelectedItem | null;
|
|
2528
2640
|
onTransportReconnect: () => void;
|
|
2529
2641
|
};
|
|
@@ -2669,14 +2781,6 @@ declare function createListQueryStore<ItemState extends ValidStoreState, QueryPa
|
|
|
2669
2781
|
* `getQueriesState`.
|
|
2670
2782
|
*/
|
|
2671
2783
|
declare const GET_ALL: (...args: unknown[]) => true;
|
|
2672
|
-
/**
|
|
2673
|
-
* Shared List Query invalidation target for invalidating every cached query and
|
|
2674
|
-
* every cached item.
|
|
2675
|
-
*/
|
|
2676
|
-
declare const ALL_QUERY_AND_ITEMS: {
|
|
2677
|
-
readonly queryPayload: typeof GET_ALL;
|
|
2678
|
-
readonly itemPayload: typeof GET_ALL;
|
|
2679
|
-
};
|
|
2680
2784
|
//#endregion
|
|
2681
2785
|
//#region src/isOffScreenContext.d.ts
|
|
2682
2786
|
/**
|
|
@@ -2829,4 +2933,4 @@ declare function clearAllSessionStorage(sessionKey: string): Promise<void>;
|
|
|
2829
2933
|
//#region src/persistentStorage/opfsOfflineUploadAdapter.d.ts
|
|
2830
2934
|
declare const opfsOfflineUploadAdapter: OfflineUploadAdapter;
|
|
2831
2935
|
//#endregion
|
|
2832
|
-
export {
|
|
2936
|
+
export { type AsyncStorageAdapter, type AsyncStorageDiscoveredScope, type AsyncStorageDriver, type AsyncStorageDriverSetEntry, type AsyncStorageMetadataOrder, type AsyncStorageNamespaceCommitArgs, type AsyncStorageNamespaceCommitTouch, type AsyncStorageNamespaceCommitUpsert, type AsyncStorageNamespaceGetResult, type AsyncStorageNamespaceHandle, type AsyncStorageNamespaceKind, type AsyncStorageNamespaceScope, type AsyncStorageReadOptions, type BlockWindowCloseHandler, CollectionBrowserTabsMessage, CollectionInitialStateItem, CollectionItemStatus, type CollectionOfflineEntityRef, type CollectionOfflineOperationDefinition, type CollectionPersistentStorageConfig, CollectionStateCleanup, CollectionStore, CollectionStoreEvents, CollectionStoreOptions, CollectionStoreStoreEvents, CollectionUseMultipleItemsQuery, type ConvertedPersistentStorageDataSchema, type CreateStoreManagerOptions, type DefineCollectionOfflineOperations, type DefineDocumentOfflineOperations, type DefineListQueryOfflineOperations, type DefineOfflineOperation, type DerivedQueriesConfig, type DerivedQueryContext, type DerivedQuerySource, DocumentBrowserTabsMessage, type DocumentOfflineOperationDefinition, type DocumentPersistentStorageConfig, DocumentStatus, DocumentStore, DocumentStoreOptions, DocumentStoreState, DocumentStoreStoreEvents, type FetchListFnReturn, type FetchListFnReturnItem, type FieldsInput, type FieldsOption, GET_ALL, type GlobalOfflineEntity, type GlobalOfflineStatus, type IndexedDbPersistentStorageOptions, IsOffScreenContext, type ListQueryOfflineEntityRef, type ListQueryOfflineOperationDefinition, type ListQueryPersistentStorageConfig, type ListQueryStore, type ListQueryStoreEvents, type ListQueryStoreInitialData, type ListQueryStoreOptions, type ListQueryUseMultipleItemsQuery, type ListQueryUseMultipleListQueriesQuery, type MutationDebounce, type MutationSkipped, type OfflineAccumulationConfig, type OfflineAccumulationMergeContext, type OfflineConflictResolutionAction, type OfflineEntityMutationKind, type OfflineMutationDescriptor, type OfflineMutationInput, type OfflineMutationQueueingCause, type OfflineMutationQueueingConfig, type OfflineMutationQueueingPolicy, type OfflineMutationResult, type OfflineMutationUploadsInput, type OfflineOperationKind, type OfflineOperationUploadsContext, type OfflineQueueEntry, type OfflineReplayRetryConfig, type OfflineResolutionAction, type OfflineResolutionActionForOperation, type OfflineResolutionConflictParseError, type OfflineResolutionConflictParseErrorCode, type OfflineResolutionRecord, type OfflineResolutionRecordForOperation, type OfflineResolutionRecordForStore, type OfflineRetryExhaustedResolutionAction, type OfflineRuntimeConfig, type OfflineRuntimeConfigUpdate, type OfflineSession, type OfflineSessionConfig, type OfflineSessionUploadsConfig, type OfflineStoredUploadRecord, type OfflineSupersedeConfig, type OfflineSyncState, type OfflineTempEntitiesConfig, type OfflineTempEntitiesReconciliation, type OfflineTempEntityConfig, type OfflineTempEntityPendingEntry, type OfflineUpload, type OfflineUploadAdapter, type OfflineUploadProgress, type OfflineUploadSource, type OfflineUploadState, type OfflineUploadTransportContext, type OffsetPaginationConfig, OnCollectionItemInvalidate, OnDocumentInvalidate, type OnListQueryInvalidate, type OnListQueryItemInvalidate, type OperationConflict, type OperationResult, type OptimisticListUpdate, type ParsedOfflineResolutionConflictResultForOperation, type PartialResourcesConfig, type PayloadDebounce, type PersistentStorageBaseConfig, type PersistentStorageDataSchema, type PersistentStoragePreloadResult, type PersistentStorageSchema, type QueryFetchPayload, type QueryStatus, type StorageAdapter, type StoreError, StoreFetchError, type StoreManager, StoreMutationError, type StoreMutationErrorOptions, type TSDFItemQuery, type TSDFStatus, TSDFUseDocumentReturn, TSFDCollectionItem, TSFDCollectionState, type TSFDListQuery, type TSFDListQueryState, TSFDUseCollectionItemReturn, type TSFDUseListItemReturn, type TSFDUseListQueryReturn, type TSFDUsePendingOfflineItemsReturn, type ValidPayload, type ValidStoreState, clearAllSessionStorage, clearSessionStorage, createAsyncStorageAdapter, createCollectionStore, createDocumentStore, createIndexedDbPersistentStorage, createListQueryStore, createStoreManager, defaultOfflineRuntimeConfig, fetchTypePriority, getGlobalOfflineEntities, getGlobalOfflineResolutions, getGlobalOfflineStatus, indexedDbPersistentStorage, localPersistentStorage, mutationSkipped, opfsOfflineUploadAdapter, opfsPersistentStorage, useGlobalOfflineEntities, useGlobalOfflineResolutions, useGlobalOfflineStatus };
|
package/dist/main.js
CHANGED
|
@@ -15874,6 +15874,16 @@ function createFetchApi({ store, normalizedFetchListFn, offsetPagination, fetchI
|
|
|
15874
15874
|
};
|
|
15875
15875
|
}
|
|
15876
15876
|
//#endregion
|
|
15877
|
+
//#region src/invalidationUtils.ts
|
|
15878
|
+
/**
|
|
15879
|
+
* Predicate that matches every currently known payload.
|
|
15880
|
+
*
|
|
15881
|
+
* Use it with APIs that accept payload filters, such as
|
|
15882
|
+
* `invalidateQueryAndItems`, `invalidateItem`, `getItemState`, and
|
|
15883
|
+
* `getQueriesState`.
|
|
15884
|
+
*/
|
|
15885
|
+
const GET_ALL = () => true;
|
|
15886
|
+
//#endregion
|
|
15877
15887
|
//#region src/listQueryStore/createMutationApi.ts
|
|
15878
15888
|
/** @internal */
|
|
15879
15889
|
function createMutationApi({ store, fetchItemFn, partialResources, optimisticListUpdates, onInvalidateQuery, onInvalidateItem, onMutationError, errorNormalizer, getItemKey, getQueriesKeyArray, getQueriesRelatedToItem, getItemsKeyArray, getOrCreateItemScheduler, getOrCreateQueryScheduler, deleteItemFetchResources, emitInvalidateQuery, emitInvalidateItem, blockWindowClose, offlineController, runWithBroadcastConsistency, publishQuerySnapshot, publishItemSnapshot, onOfflineTimelineEvent }) {
|
|
@@ -15937,7 +15947,11 @@ function createMutationApi({ store, fetchItemFn, partialResources, optimisticLis
|
|
|
15937
15947
|
const itemInvalidationWasTriggered = /* @__PURE__ */ new Set();
|
|
15938
15948
|
const itemFieldInvalidationPriorities = /* @__PURE__ */ new Map();
|
|
15939
15949
|
const itemPendingInvalidationFields = /* @__PURE__ */ new Map();
|
|
15940
|
-
function invalidateQueryAndItems(
|
|
15950
|
+
function invalidateQueryAndItems(args) {
|
|
15951
|
+
const itemPayload = args.all ? GET_ALL : args.itemPayload;
|
|
15952
|
+
const queryPayload = args.all ? GET_ALL : args.queryPayload;
|
|
15953
|
+
const priority = args.type ?? "highPriority";
|
|
15954
|
+
const invalidateFields = args.fields;
|
|
15941
15955
|
const queriesKey = queryPayload ? getQueriesKeyArray(queryPayload) : [];
|
|
15942
15956
|
for (const { key, payload } of queriesKey) {
|
|
15943
15957
|
const queryState = store.state.queries[key];
|
|
@@ -18473,15 +18487,13 @@ function createListQueryStore(storeOptions) {
|
|
|
18473
18487
|
onWindowFocus: testOptions?.onWindowFocus ?? onWindowFocus,
|
|
18474
18488
|
onWindowFocusRevalidate: () => {
|
|
18475
18489
|
invalidateQueryAndItems({
|
|
18476
|
-
|
|
18477
|
-
itemPayload: () => true,
|
|
18490
|
+
all: true,
|
|
18478
18491
|
type: "lowPriority"
|
|
18479
18492
|
});
|
|
18480
18493
|
},
|
|
18481
18494
|
onTransportReconnectRevalidate: () => {
|
|
18482
18495
|
invalidateQueryAndItems({
|
|
18483
|
-
|
|
18484
|
-
itemPayload: () => true,
|
|
18496
|
+
all: true,
|
|
18485
18497
|
type: "realtimeUpdate"
|
|
18486
18498
|
});
|
|
18487
18499
|
}
|
|
@@ -18740,24 +18752,6 @@ function createListQueryStore(storeOptions) {
|
|
|
18740
18752
|
};
|
|
18741
18753
|
}
|
|
18742
18754
|
//#endregion
|
|
18743
|
-
//#region src/invalidationUtils.ts
|
|
18744
|
-
/**
|
|
18745
|
-
* Predicate that matches every currently known payload.
|
|
18746
|
-
*
|
|
18747
|
-
* Use it with APIs that accept payload filters, such as
|
|
18748
|
-
* `invalidateQueryAndItems`, `invalidateItem`, `getItemState`, and
|
|
18749
|
-
* `getQueriesState`.
|
|
18750
|
-
*/
|
|
18751
|
-
const GET_ALL = () => true;
|
|
18752
|
-
/**
|
|
18753
|
-
* Shared List Query invalidation target for invalidating every cached query and
|
|
18754
|
-
* every cached item.
|
|
18755
|
-
*/
|
|
18756
|
-
const ALL_QUERY_AND_ITEMS = {
|
|
18757
|
-
queryPayload: GET_ALL,
|
|
18758
|
-
itemPayload: GET_ALL
|
|
18759
|
-
};
|
|
18760
|
-
//#endregion
|
|
18761
18755
|
//#region src/persistentStorage/opfsOfflineUploadAdapter.ts
|
|
18762
18756
|
const OPFS_UPLOADS_ROOT_DIR = "tsdf-uploads";
|
|
18763
18757
|
const METADATA_FILE_NAME = "metadata.json";
|
|
@@ -18930,4 +18924,4 @@ var OpfsOfflineUploadDriver = class {
|
|
|
18930
18924
|
};
|
|
18931
18925
|
const opfsOfflineUploadAdapter = new OpfsOfflineUploadDriver();
|
|
18932
18926
|
//#endregion
|
|
18933
|
-
export {
|
|
18927
|
+
export { GET_ALL, IsOffScreenContext, StoreFetchError, StoreMutationError, clearAllSessionStorage, clearSessionStorage, createAsyncStorageAdapter, createCollectionStore, createDocumentStore, createIndexedDbPersistentStorage, createListQueryStore, createStoreManager, defaultOfflineRuntimeConfig, fetchTypePriority, getGlobalOfflineEntities, getGlobalOfflineResolutions, getGlobalOfflineStatus, indexedDbPersistentStorage, localPersistentStorage, mutationSkipped, opfsOfflineUploadAdapter, opfsPersistentStorage, useGlobalOfflineEntities, useGlobalOfflineResolutions, useGlobalOfflineStatus };
|
package/docs/README.md
CHANGED
|
@@ -36,7 +36,7 @@ Notable additions:
|
|
|
36
36
|
|
|
37
37
|
- Hook payload debouncing is documented in [React Hooks](./hooks.md#debouncepayload)
|
|
38
38
|
- The exported `PayloadDebounce` type is documented in [Shared Types](./shared-types.md#payloaddebounce)
|
|
39
|
-
- `GET_ALL` and `
|
|
39
|
+
- `GET_ALL` and `{ all: true }` invalidation are documented in [Invalidation](./invalidation.md#list-query-store)
|
|
40
40
|
|
|
41
41
|
## Quick Start
|
|
42
42
|
|
package/docs/invalidation.md
CHANGED
|
@@ -45,10 +45,10 @@ store.invalidateItem('item-1', 'lowPriority');
|
|
|
45
45
|
The List Query Store has the most flexible invalidation through `invalidateQueryAndItems`:
|
|
46
46
|
|
|
47
47
|
```ts
|
|
48
|
-
import {
|
|
48
|
+
import { GET_ALL } from 'tsdf';
|
|
49
49
|
|
|
50
50
|
// Invalidate all queries and all items
|
|
51
|
-
store.invalidateQueryAndItems(
|
|
51
|
+
store.invalidateQueryAndItems({ all: true });
|
|
52
52
|
|
|
53
53
|
// Invalidate specific queries only (skip items)
|
|
54
54
|
store.invalidateQueryAndItems({
|
|
@@ -69,7 +69,7 @@ store.invalidateQueryAndItems({
|
|
|
69
69
|
type: 'lowPriority',
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
// Reuse the all-payload predicate
|
|
72
|
+
// Reuse the all-payload predicate when only one side should match everything
|
|
73
73
|
store.invalidateQueryAndItems({ queryPayload: GET_ALL, itemPayload: false });
|
|
74
74
|
```
|
|
75
75
|
|