@internetarchive/collection-browser 3.3.3 → 3.3.4-alpha-webdev7761.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 (55) hide show
  1. package/dist/src/collection-browser.d.ts +10 -2
  2. package/dist/src/collection-browser.js +112 -10
  3. package/dist/src/collection-browser.js.map +1 -1
  4. package/dist/src/collection-facets/facet-row.js +141 -140
  5. package/dist/src/collection-facets/facet-row.js.map +1 -1
  6. package/dist/src/collection-facets/models.js.map +1 -1
  7. package/dist/src/collection-facets.js +12 -0
  8. package/dist/src/collection-facets.js.map +1 -1
  9. package/dist/src/data-source/collection-browser-data-source-interface.d.ts +10 -1
  10. package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
  11. package/dist/src/data-source/collection-browser-data-source.d.ts +19 -1
  12. package/dist/src/data-source/collection-browser-data-source.js +36 -18
  13. package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
  14. package/dist/src/data-source/collection-browser-query-state.d.ts +1 -2
  15. package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
  16. package/dist/src/data-source/models.d.ts +11 -0
  17. package/dist/src/data-source/models.js.map +1 -1
  18. package/dist/src/manage/manage-bar.js +77 -77
  19. package/dist/src/manage/manage-bar.js.map +1 -1
  20. package/dist/src/models.d.ts +2 -6
  21. package/dist/src/models.js +8 -12
  22. package/dist/src/models.js.map +1 -1
  23. package/dist/src/restoration-state-handler.d.ts +1 -2
  24. package/dist/src/restoration-state-handler.js +3 -9
  25. package/dist/src/restoration-state-handler.js.map +1 -1
  26. package/dist/src/tiles/grid/search-tile.js +42 -42
  27. package/dist/src/tiles/grid/search-tile.js.map +1 -1
  28. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +119 -119
  29. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
  30. package/dist/test/collection-browser.test.js +19 -9
  31. package/dist/test/collection-browser.test.js.map +1 -1
  32. package/dist/test/collection-facets/facet-row.test.js +23 -23
  33. package/dist/test/collection-facets/facet-row.test.js.map +1 -1
  34. package/dist/test/collection-facets.test.js +20 -20
  35. package/dist/test/collection-facets.test.js.map +1 -1
  36. package/dist/test/restoration-state-handler.test.js +5 -37
  37. package/dist/test/restoration-state-handler.test.js.map +1 -1
  38. package/package.json +1 -1
  39. package/src/collection-browser.ts +132 -7
  40. package/src/collection-facets/facet-row.ts +299 -296
  41. package/src/collection-facets/models.ts +10 -10
  42. package/src/collection-facets.ts +11 -0
  43. package/src/data-source/collection-browser-data-source-interface.ts +345 -333
  44. package/src/data-source/collection-browser-data-source.ts +59 -19
  45. package/src/data-source/collection-browser-query-state.ts +1 -7
  46. package/src/data-source/models.ts +13 -0
  47. package/src/manage/manage-bar.ts +247 -247
  48. package/src/models.ts +866 -870
  49. package/src/restoration-state-handler.ts +542 -544
  50. package/src/tiles/grid/search-tile.ts +90 -90
  51. package/src/tiles/grid/styles/tile-grid-shared-styles.ts +130 -130
  52. package/test/collection-browser.test.ts +21 -11
  53. package/test/collection-facets/facet-row.test.ts +375 -375
  54. package/test/collection-facets.test.ts +928 -928
  55. package/test/restoration-state-handler.test.ts +480 -510
@@ -1,333 +1,345 @@
1
- import type {
2
- FilterMap,
3
- Aggregation,
4
- CollectionExtraInfo,
5
- AccountExtraInfo,
6
- PageElementMap,
7
- SearchResponseSessionContext,
8
- } from '@internetarchive/search-service';
9
- import type { ReactiveController } from 'lit';
10
- import type {
11
- PrefixFilterType,
12
- PrefixFilterCounts,
13
- TileModel,
14
- } from '../models';
15
- import type {
16
- PageSpecifierParams,
17
- CollectionTitles,
18
- TVChannelAliases,
19
- } from './models';
20
-
21
- export interface CollectionBrowserDataSourceInterface
22
- extends ReactiveController {
23
- /**
24
- * How many tile models are present in this data source
25
- */
26
- readonly size: number;
27
-
28
- /**
29
- * How many results there are in the full result set for the current query
30
- * (not necessarily all loaded yet).
31
- */
32
- readonly totalResults: number;
33
-
34
- /**
35
- * Whether the host has a valid set of properties for performing a search.
36
- * For instance, on the search page this requires a valid search service and a
37
- * non-empty query, while collection pages allow searching with an empty query
38
- * for MDS but not FTS.
39
- */
40
- readonly canPerformSearch: boolean;
41
-
42
- /**
43
- * Whether the end of the set of results for the current query state has been
44
- * encountered (i.e., the last page of results).
45
- */
46
- readonly endOfDataReached: boolean;
47
-
48
- /**
49
- * True if the initial work for a new query state has been completed (i.e., firing initial
50
- * page/facet requests). False otherwise.
51
- */
52
- readonly queryInitialized: boolean;
53
-
54
- /**
55
- * A string key compactly representing the current full search state, which can
56
- * be used to determine, e.g., when a new search is required or whether an arriving
57
- * response is outdated.
58
- */
59
- readonly pageFetchQueryKey: string;
60
-
61
- /**
62
- * Similar to `pageFetchQueryKey`, but excluding properties that do not affect
63
- * the validity of a set of facets (e.g., sort).
64
- */
65
- readonly facetFetchQueryKey: string;
66
-
67
- /**
68
- * An object representing any collection- or profile-specific properties to be passed along
69
- * to the search service, specifying the exact page/tab to fetch results for.
70
- */
71
- readonly pageSpecifierParams: PageSpecifierParams | null;
72
-
73
- /**
74
- * A FilterMap object representing all filters applied to the current search,
75
- * including any facets, letter filters, and date ranges.
76
- */
77
- readonly filterMap: FilterMap;
78
-
79
- /**
80
- * The full set of aggregations retrieved for the current search.
81
- */
82
- readonly aggregations?: Record<string, Aggregation>;
83
-
84
- /**
85
- * The `year_histogram` or `date_histogram` aggregation retrieved for the current search.
86
- */
87
- readonly histogramAggregation?: Aggregation;
88
-
89
- /**
90
- * A map from collection identifiers that appear on hits or aggregations for the
91
- * current search, to their human-readable collection titles.
92
- */
93
- readonly collectionTitles: CollectionTitles;
94
-
95
- /**
96
- * A map from TV channel names appearing in `creator` aggregations, to their
97
- * more human-readable network names.
98
- */
99
- readonly tvChannelAliases: TVChannelAliases;
100
-
101
- /**
102
- * The "extra info" package provided by the PPS for collection pages, including details
103
- * used to populate the target collection header & About tab content.
104
- */
105
- readonly collectionExtraInfo?: CollectionExtraInfo;
106
-
107
- /**
108
- * The "extra info" package provided by the PPS for profile pages, including details
109
- * used to populate the profile header.
110
- */
111
- readonly accountExtraInfo?: AccountExtraInfo;
112
-
113
- /**
114
- * Context about the user session that produced the search response, from the PPS.
115
- */
116
- readonly sessionContext?: SearchResponseSessionContext;
117
-
118
- /**
119
- * The set of requested page elements for profile pages, if applicable. These represent
120
- * any content specific to the current profile tab.
121
- */
122
- readonly pageElements?: PageElementMap;
123
-
124
- /**
125
- * An array of the current target collection's parent collections. Should include *all*
126
- * ancestors in the collection hierarchy, not just the immediate parent.
127
- */
128
- readonly parentCollections?: string[];
129
-
130
- /**
131
- * An object storing result counts for the current search bucketed by letter prefix.
132
- * Keys are the result field on which the prefixes are considered (e.g., title/creator)
133
- * and values are a Record mapping letters to their counts.
134
- */
135
- readonly prefixFilterCountMap: Partial<
136
- Record<PrefixFilterType, PrefixFilterCounts>
137
- >;
138
-
139
- /**
140
- * Any error message from the most recent search results response.
141
- */
142
- readonly queryErrorMessage?: string;
143
-
144
- /**
145
- * An array of all the tile models whose management checkboxes are checked
146
- */
147
- readonly checkedTileModels: TileModel[];
148
-
149
- /**
150
- * An array of all the tile models whose management checkboxes are unchecked
151
- */
152
- readonly uncheckedTileModels: TileModel[];
153
-
154
- /**
155
- * A Promise which, after each query change, resolves once the fetches for the initial
156
- * search have completed. Waits for *both* the hits and aggregations fetches to finish.
157
- *
158
- * Ensure you await this component's `updateComplete` promise before awaiting this
159
- * one, to ensure you do not await an obsolete promise from the previous update.
160
- */
161
- readonly initialSearchComplete: Promise<boolean>;
162
-
163
- /**
164
- * Resets the data source to its empty state, with no result pages, aggregations, etc.
165
- */
166
- reset(): void;
167
-
168
- /**
169
- * Resets the data source's result pages, keeping other state intact.
170
- */
171
- resetPages(): void;
172
-
173
- /**
174
- * Adds the given page of tile models to the data source.
175
- * If the given page number already exists, that page will be overwritten.
176
- * This method expects that the provided tiles already fit the configured page size; it
177
- * will not split them into multiple pages.
178
- * @param pageNum Which page number to add (indexed starting from 1)
179
- * @param pageTiles The array of tile models for the new page
180
- */
181
- addPage(pageNum: number, pageTiles: TileModel[]): void;
182
-
183
- /**
184
- * Adds all of the given pages of tile models to the data source, splitting them into
185
- * multiple pages according to the configured page size if necessary. Any pages that
186
- * have tiles added by this method will have any existing content overwritten.
187
- * @param firstPageNum Which page number to start adding pages from (pages are indexed starting from 1)
188
- * @param tiles The full array of tile models to add across one or more pages
189
- */
190
- addMultiplePages(firstPageNum: number, tiles: TileModel[]): void;
191
-
192
- /**
193
- * Returns the given page of tile models from the data source.
194
- * @param pageNum Which page number to get (indexed starting from 1)
195
- */
196
- getPage(pageNum: number): TileModel[];
197
-
198
- /**
199
- * Returns the full set of paged tile models stored in this data source.
200
- */
201
- getAllPages(): Record<string, TileModel[]>;
202
-
203
- /**
204
- * Whether the data source contains any tiles for the given page number.
205
- * @param pageNum Which page number to query (indexed starting from 1)
206
- */
207
- hasPage(pageNum: number): boolean;
208
-
209
- /**
210
- * Returns the single tile model appearing at the given index in the
211
- * data source, with respect to the current page size. Returns `undefined` if
212
- * the corresponding page is not present on the data source or if it does not
213
- * contain a tile model at the corresponding index.
214
- * @param index The 0-based index (within the full data source) of the tile to get
215
- */
216
- getTileModelAt(index: number): TileModel | undefined;
217
-
218
- /**
219
- * Returns the first numeric tile index corresponding to the given tile model object,
220
- * or -1 if the given tile model is not present.
221
- * @param tile The tile model to search for in the data source
222
- */
223
- indexOf(tile: TileModel): number;
224
-
225
- /**
226
- * Requests that the data source fire a backend request for the given page of results.
227
- * @param pageNum Which page number to fetch results for
228
- * @param numInitialPages How many pages should be batched together on an initial fetch
229
- */
230
- fetchPage(pageNum: number, numInitialPages?: number): Promise<void>;
231
-
232
- /**
233
- * Requests that the data source update its prefix bucket result counts for the given
234
- * type of prefix filter.
235
- * @param filterType Which prefixable field to update the buckets for (e.g., title/creator)
236
- */
237
- updatePrefixFilterCounts(filterType: PrefixFilterType): Promise<void>;
238
-
239
- /**
240
- * Fetches and caches the prefix filter counts for the current sort type,
241
- * provided it is one that permits prefix filtering. (If not, this does nothing).
242
- */
243
- updatePrefixFiltersForCurrentSort(): Promise<void>;
244
-
245
- /**
246
- * Clears the cached letter counts for both title and creator, and
247
- * fetches a new set of counts for whichever of them is the currently
248
- * selected sort option (which may be neither).
249
- *
250
- * Call this whenever the counts are invalidated (e.g., by a query change).
251
- */
252
- refreshLetterCounts(): void;
253
-
254
- /**
255
- * Returns the current page size of the data source.
256
- */
257
- getPageSize(): number;
258
-
259
- /**
260
- * Changes the page size used by the data source, discarding any previously-fetched pages.
261
- *
262
- * **Note: this operation will reset any data stored in the data source!**
263
- * @param pageSize
264
- */
265
- setPageSize(pageSize: number): void;
266
-
267
- /**
268
- * Sets the total number of pages that should be batched together on each initial fetch.
269
- * @param pages How many initial pages to batch
270
- */
271
- setNumInitialPages(numPages: number): void;
272
-
273
- /**
274
- * Sets the total result count for this data source to the given value.
275
- * @param count The number of total results to set
276
- */
277
- setTotalResultCount(count: number): void;
278
-
279
- /**
280
- * Sets whether this data source should suppress further data fetches, i.e. ignore any
281
- * future query changes on its host that would trigger a page/facet fetch.
282
- * @param suppressed Whether further fetches for this data source should be suppressed
283
- */
284
- setFetchesSuppressed(suppressed: boolean): void;
285
-
286
- /**
287
- * Sets whether the end of the current data has been reached, indicating whether further
288
- * pages should be looked up.
289
- * @param reached Whether we are at the end of the data for the current query state
290
- */
291
- setEndOfDataReached(reached: boolean): void;
292
-
293
- /**
294
- * Notifies the data source that a query change has occurred, which may trigger a data
295
- * reset & new fetches.
296
- */
297
- handleQueryChange(): Promise<void>;
298
-
299
- /**
300
- * Notifies the data source that the readiness state of the facets has been changed, which
301
- * may trigger facet fetches if they were previously delayed.
302
- */
303
- handleFacetReadinessChange(ready: boolean): Promise<void>;
304
-
305
- /**
306
- * Applies the given map function to all of the tile models in every page of the data
307
- * source.
308
- * @param callback A callback function to apply on each tile model, as with Array.map
309
- */
310
- map(
311
- callback: (
312
- model: TileModel,
313
- index: number,
314
- array: TileModel[],
315
- ) => TileModel,
316
- ): void;
317
-
318
- /**
319
- * Checks every tile's management checkbox
320
- */
321
- checkAllTiles(): void;
322
-
323
- /**
324
- * Unchecks every tile's management checkbox
325
- */
326
- uncheckAllTiles(): void;
327
-
328
- /**
329
- * Removes all tile models that are currently checked & adjusts the paging
330
- * of the data source to account for any new gaps in the data.
331
- */
332
- removeCheckedTiles(): void;
333
- }
1
+ import type {
2
+ FilterMap,
3
+ Aggregation,
4
+ CollectionExtraInfo,
5
+ AccountExtraInfo,
6
+ PageElementMap,
7
+ SearchResponseSessionContext,
8
+ } from '@internetarchive/search-service';
9
+ import type { ReactiveController } from 'lit';
10
+ import type {
11
+ PrefixFilterType,
12
+ PrefixFilterCounts,
13
+ TileModel,
14
+ } from '../models';
15
+ import type {
16
+ PageSpecifierParams,
17
+ CollectionTitles,
18
+ TVChannelAliases,
19
+ TVChannelMaps,
20
+ } from './models';
21
+
22
+ export interface CollectionBrowserDataSourceInterface
23
+ extends ReactiveController {
24
+ /**
25
+ * How many tile models are present in this data source
26
+ */
27
+ readonly size: number;
28
+
29
+ /**
30
+ * How many results there are in the full result set for the current query
31
+ * (not necessarily all loaded yet).
32
+ */
33
+ readonly totalResults: number;
34
+
35
+ /**
36
+ * Whether the host has a valid set of properties for performing a search.
37
+ * For instance, on the search page this requires a valid search service and a
38
+ * non-empty query, while collection pages allow searching with an empty query
39
+ * for MDS but not FTS.
40
+ */
41
+ readonly canPerformSearch: boolean;
42
+
43
+ /**
44
+ * Whether the end of the set of results for the current query state has been
45
+ * encountered (i.e., the last page of results).
46
+ */
47
+ readonly endOfDataReached: boolean;
48
+
49
+ /**
50
+ * True if the initial work for a new query state has been completed (i.e., firing initial
51
+ * page/facet requests). False otherwise.
52
+ */
53
+ readonly queryInitialized: boolean;
54
+
55
+ /**
56
+ * A string key compactly representing the current full search state, which can
57
+ * be used to determine, e.g., when a new search is required or whether an arriving
58
+ * response is outdated.
59
+ */
60
+ readonly pageFetchQueryKey: string;
61
+
62
+ /**
63
+ * Similar to `pageFetchQueryKey`, but excluding properties that do not affect
64
+ * the validity of a set of facets (e.g., sort).
65
+ */
66
+ readonly facetFetchQueryKey: string;
67
+
68
+ /**
69
+ * An object representing any collection- or profile-specific properties to be passed along
70
+ * to the search service, specifying the exact page/tab to fetch results for.
71
+ */
72
+ readonly pageSpecifierParams: PageSpecifierParams | null;
73
+
74
+ /**
75
+ * A FilterMap object representing all filters applied to the current search,
76
+ * including any facets, letter filters, and date ranges.
77
+ */
78
+ readonly filterMap: FilterMap;
79
+
80
+ /**
81
+ * The full set of aggregations retrieved for the current search.
82
+ */
83
+ readonly aggregations?: Record<string, Aggregation>;
84
+
85
+ /**
86
+ * The `year_histogram` or `date_histogram` aggregation retrieved for the current search.
87
+ */
88
+ readonly histogramAggregation?: Aggregation;
89
+
90
+ /**
91
+ * A map from collection identifiers that appear on hits or aggregations for the
92
+ * current search, to their human-readable collection titles.
93
+ */
94
+ readonly collectionTitles: CollectionTitles;
95
+
96
+ /**
97
+ * A map from TV channel names appearing in `creator` aggregations, to their
98
+ * more human-readable network names.
99
+ */
100
+ readonly tvChannelAliases: TVChannelAliases;
101
+
102
+ /**
103
+ * An object holding mappings from channels to networks, and programs to channels.
104
+ */
105
+ readonly tvChannelMaps: TVChannelMaps;
106
+
107
+ /**
108
+ * The "extra info" package provided by the PPS for collection pages, including details
109
+ * used to populate the target collection header & About tab content.
110
+ */
111
+ readonly collectionExtraInfo?: CollectionExtraInfo;
112
+
113
+ /**
114
+ * The "extra info" package provided by the PPS for profile pages, including details
115
+ * used to populate the profile header.
116
+ */
117
+ readonly accountExtraInfo?: AccountExtraInfo;
118
+
119
+ /**
120
+ * Context about the user session that produced the search response, from the PPS.
121
+ */
122
+ readonly sessionContext?: SearchResponseSessionContext;
123
+
124
+ /**
125
+ * The set of requested page elements for profile pages, if applicable. These represent
126
+ * any content specific to the current profile tab.
127
+ */
128
+ readonly pageElements?: PageElementMap;
129
+
130
+ /**
131
+ * An array of the current target collection's parent collections. Should include *all*
132
+ * ancestors in the collection hierarchy, not just the immediate parent.
133
+ */
134
+ readonly parentCollections?: string[];
135
+
136
+ /**
137
+ * An object storing result counts for the current search bucketed by letter prefix.
138
+ * Keys are the result field on which the prefixes are considered (e.g., title/creator)
139
+ * and values are a Record mapping letters to their counts.
140
+ */
141
+ readonly prefixFilterCountMap: Partial<
142
+ Record<PrefixFilterType, PrefixFilterCounts>
143
+ >;
144
+
145
+ /**
146
+ * Any error message from the most recent search results response.
147
+ */
148
+ readonly queryErrorMessage?: string;
149
+
150
+ /**
151
+ * An array of all the tile models whose management checkboxes are checked
152
+ */
153
+ readonly checkedTileModels: TileModel[];
154
+
155
+ /**
156
+ * An array of all the tile models whose management checkboxes are unchecked
157
+ */
158
+ readonly uncheckedTileModels: TileModel[];
159
+
160
+ /**
161
+ * A Promise which, after each query change, resolves once the fetches for the initial
162
+ * search have completed. Waits for *both* the hits and aggregations fetches to finish.
163
+ *
164
+ * Ensure you await this component's `updateComplete` promise before awaiting this
165
+ * one, to ensure you do not await an obsolete promise from the previous update.
166
+ */
167
+ readonly initialSearchComplete: Promise<boolean>;
168
+
169
+ /**
170
+ * Resets the data source to its empty state, with no result pages, aggregations, etc.
171
+ */
172
+ reset(): void;
173
+
174
+ /**
175
+ * Resets the data source's result pages, keeping other state intact.
176
+ */
177
+ resetPages(): void;
178
+
179
+ /**
180
+ * Adds the given page of tile models to the data source.
181
+ * If the given page number already exists, that page will be overwritten.
182
+ * This method expects that the provided tiles already fit the configured page size; it
183
+ * will not split them into multiple pages.
184
+ * @param pageNum Which page number to add (indexed starting from 1)
185
+ * @param pageTiles The array of tile models for the new page
186
+ */
187
+ addPage(pageNum: number, pageTiles: TileModel[]): void;
188
+
189
+ /**
190
+ * Adds all of the given pages of tile models to the data source, splitting them into
191
+ * multiple pages according to the configured page size if necessary. Any pages that
192
+ * have tiles added by this method will have any existing content overwritten.
193
+ * @param firstPageNum Which page number to start adding pages from (pages are indexed starting from 1)
194
+ * @param tiles The full array of tile models to add across one or more pages
195
+ */
196
+ addMultiplePages(firstPageNum: number, tiles: TileModel[]): void;
197
+
198
+ /**
199
+ * Returns the given page of tile models from the data source.
200
+ * @param pageNum Which page number to get (indexed starting from 1)
201
+ */
202
+ getPage(pageNum: number): TileModel[];
203
+
204
+ /**
205
+ * Returns the full set of paged tile models stored in this data source.
206
+ */
207
+ getAllPages(): Record<string, TileModel[]>;
208
+
209
+ /**
210
+ * Whether the data source contains any tiles for the given page number.
211
+ * @param pageNum Which page number to query (indexed starting from 1)
212
+ */
213
+ hasPage(pageNum: number): boolean;
214
+
215
+ /**
216
+ * Returns the single tile model appearing at the given index in the
217
+ * data source, with respect to the current page size. Returns `undefined` if
218
+ * the corresponding page is not present on the data source or if it does not
219
+ * contain a tile model at the corresponding index.
220
+ * @param index The 0-based index (within the full data source) of the tile to get
221
+ */
222
+ getTileModelAt(index: number): TileModel | undefined;
223
+
224
+ /**
225
+ * Returns the first numeric tile index corresponding to the given tile model object,
226
+ * or -1 if the given tile model is not present.
227
+ * @param tile The tile model to search for in the data source
228
+ */
229
+ indexOf(tile: TileModel): number;
230
+
231
+ /**
232
+ * Requests that the data source fire a backend request for the given page of results.
233
+ * @param pageNum Which page number to fetch results for
234
+ * @param numInitialPages How many pages should be batched together on an initial fetch
235
+ */
236
+ fetchPage(pageNum: number, numInitialPages?: number): Promise<void>;
237
+
238
+ /**
239
+ * Requests that the data source update its prefix bucket result counts for the given
240
+ * type of prefix filter.
241
+ * @param filterType Which prefixable field to update the buckets for (e.g., title/creator)
242
+ */
243
+ updatePrefixFilterCounts(filterType: PrefixFilterType): Promise<void>;
244
+
245
+ /**
246
+ * Fetches and caches the prefix filter counts for the current sort type,
247
+ * provided it is one that permits prefix filtering. (If not, this does nothing).
248
+ */
249
+ updatePrefixFiltersForCurrentSort(): Promise<void>;
250
+
251
+ /**
252
+ * Clears the cached letter counts for both title and creator, and
253
+ * fetches a new set of counts for whichever of them is the currently
254
+ * selected sort option (which may be neither).
255
+ *
256
+ * Call this whenever the counts are invalidated (e.g., by a query change).
257
+ */
258
+ refreshLetterCounts(): void;
259
+
260
+ /**
261
+ * Returns the current page size of the data source.
262
+ */
263
+ getPageSize(): number;
264
+
265
+ /**
266
+ * Changes the page size used by the data source, discarding any previously-fetched pages.
267
+ *
268
+ * **Note: this operation will reset any data stored in the data source!**
269
+ * @param pageSize
270
+ */
271
+ setPageSize(pageSize: number): void;
272
+
273
+ /**
274
+ * Sets the total number of pages that should be batched together on each initial fetch.
275
+ * @param pages How many initial pages to batch
276
+ */
277
+ setNumInitialPages(numPages: number): void;
278
+
279
+ /**
280
+ * Sets the total result count for this data source to the given value.
281
+ * @param count The number of total results to set
282
+ */
283
+ setTotalResultCount(count: number): void;
284
+
285
+ /**
286
+ * Sets whether this data source should suppress further data fetches, i.e. ignore any
287
+ * future query changes on its host that would trigger a page/facet fetch.
288
+ * @param suppressed Whether further fetches for this data source should be suppressed
289
+ */
290
+ setFetchesSuppressed(suppressed: boolean): void;
291
+
292
+ /**
293
+ * Sets whether the end of the current data has been reached, indicating whether further
294
+ * pages should be looked up.
295
+ * @param reached Whether we are at the end of the data for the current query state
296
+ */
297
+ setEndOfDataReached(reached: boolean): void;
298
+
299
+ /**
300
+ * Notifies the data source that a query change has occurred, which may trigger a data
301
+ * reset & new fetches.
302
+ */
303
+ handleQueryChange(): Promise<void>;
304
+
305
+ /**
306
+ * Notifies the data source that the readiness state of the facets has been changed, which
307
+ * may trigger facet fetches if they were previously delayed.
308
+ */
309
+ handleFacetReadinessChange(ready: boolean): Promise<void>;
310
+
311
+ /**
312
+ * Applies the given map function to all of the tile models in every page of the data
313
+ * source.
314
+ * @param callback A callback function to apply on each tile model, as with Array.map
315
+ */
316
+ map(
317
+ callback: (
318
+ model: TileModel,
319
+ index: number,
320
+ array: TileModel[],
321
+ ) => TileModel,
322
+ ): void;
323
+
324
+ /**
325
+ * Checks every tile's management checkbox
326
+ */
327
+ checkAllTiles(): void;
328
+
329
+ /**
330
+ * Unchecks every tile's management checkbox
331
+ */
332
+ uncheckAllTiles(): void;
333
+
334
+ /**
335
+ * Removes all tile models that are currently checked & adjusts the paging
336
+ * of the data source to account for any new gaps in the data.
337
+ */
338
+ removeCheckedTiles(): void;
339
+
340
+ /**
341
+ * Fires requests to populate the TV channel mappings (chan2network and programs2chan),
342
+ * or returns the existing Promise for any such request that has already been made.
343
+ */
344
+ populateTVChannelMaps(): Promise<TVChannelMaps>;
345
+ }