instantsearch.js 4.55.0 → 4.56.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 (62) hide show
  1. package/cjs/components/Breadcrumb/Breadcrumb.js +2 -2
  2. package/cjs/components/RangeInput/RangeInput.js +22 -11
  3. package/cjs/components/RefinementList/RefinementList.js +34 -52
  4. package/cjs/components/Slider/Rheostat.js +163 -249
  5. package/cjs/connectors/infinite-hits/connectInfiniteHits.js +22 -7
  6. package/cjs/lib/InstantSearch.js +2 -4
  7. package/cjs/lib/routers/history.js +54 -1
  8. package/cjs/lib/utils/render-args.js +3 -2
  9. package/cjs/lib/version.js +1 -1
  10. package/cjs/widgets/hits-per-page/hits-per-page.js +3 -1
  11. package/cjs/widgets/index/index.js +8 -8
  12. package/dist/instantsearch.development.d.ts +76 -76
  13. package/dist/instantsearch.development.js +345 -341
  14. package/dist/instantsearch.development.js.map +1 -1
  15. package/dist/instantsearch.production.d.ts +76 -76
  16. package/dist/instantsearch.production.min.d.ts +76 -76
  17. package/dist/instantsearch.production.min.js +2 -2
  18. package/dist/instantsearch.production.min.js.map +1 -1
  19. package/es/components/Breadcrumb/Breadcrumb.d.ts +2 -2
  20. package/es/components/Breadcrumb/Breadcrumb.js +2 -2
  21. package/es/components/GeoSearchControls/GeoSearchButton.d.ts +1 -1
  22. package/es/components/GeoSearchControls/GeoSearchControls.d.ts +3 -3
  23. package/es/components/GeoSearchControls/GeoSearchToggle.d.ts +1 -1
  24. package/es/components/Pagination/Pagination.d.ts +2 -2
  25. package/es/components/RangeInput/RangeInput.d.ts +7 -4
  26. package/es/components/RangeInput/RangeInput.js +22 -11
  27. package/es/components/RefinementList/RefinementList.d.ts +0 -1
  28. package/es/components/RefinementList/RefinementList.js +34 -52
  29. package/es/components/RelevantSort/RelevantSort.d.ts +1 -1
  30. package/es/components/Selector/Selector.d.ts +2 -2
  31. package/es/components/Slider/Rheostat.d.ts +23 -17
  32. package/es/components/Slider/Rheostat.js +163 -249
  33. package/es/components/Slider/Slider.d.ts +1 -1
  34. package/es/connectors/current-refinements/connectCurrentRefinements.d.ts +2 -2
  35. package/es/connectors/dynamic-widgets/connectDynamicWidgets.d.ts +2 -2
  36. package/es/connectors/geo-search/connectGeoSearch.d.ts +7 -7
  37. package/es/connectors/infinite-hits/connectInfiniteHits.js +23 -8
  38. package/es/connectors/menu/connectMenu.d.ts +2 -2
  39. package/es/connectors/pagination/connectPagination.d.ts +1 -1
  40. package/es/connectors/range/connectRange.d.ts +3 -3
  41. package/es/connectors/refinement-list/connectRefinementList.d.ts +3 -3
  42. package/es/connectors/relevant-sort/connectRelevantSort.d.ts +1 -1
  43. package/es/lib/InstantSearch.d.ts +13 -13
  44. package/es/lib/InstantSearch.js +3 -5
  45. package/es/lib/routers/history.d.ts +2 -2
  46. package/es/lib/routers/history.js +55 -2
  47. package/es/lib/utils/defer.d.ts +2 -2
  48. package/es/lib/utils/render-args.js +3 -2
  49. package/es/lib/version.d.ts +1 -1
  50. package/es/lib/version.js +1 -1
  51. package/es/types/middleware.d.ts +6 -6
  52. package/es/types/router.d.ts +7 -7
  53. package/es/types/widget.d.ts +1 -1
  54. package/es/widgets/dynamic-widgets/dynamic-widgets.d.ts +2 -2
  55. package/es/widgets/geo-search/createHTMLMarker.d.ts +1 -1
  56. package/es/widgets/geo-search/geo-search.d.ts +1 -1
  57. package/es/widgets/hits-per-page/hits-per-page.js +3 -1
  58. package/es/widgets/index/index.d.ts +20 -20
  59. package/es/widgets/index/index.js +8 -8
  60. package/es/widgets/panel/panel.d.ts +2 -2
  61. package/es/widgets/range-slider/range-slider.d.ts +1 -1
  62. package/package.json +6 -6
@@ -467,7 +467,7 @@ declare class BrowserHistory<TRouteState> implements Router<TRouteState> {
467
467
  */
468
468
  private readonly getLocation;
469
469
  private writeTimer?;
470
- private _onPopState;
470
+ private _onPopState?;
471
471
  /**
472
472
  * Indicates if last action was back/forward in the browser.
473
473
  */
@@ -525,7 +525,7 @@ declare type BrowserHistoryArgs<TRouteState> = {
525
525
  writeDelay: number;
526
526
  createURL: CreateURL_2<TRouteState>;
527
527
  parseURL: ParseURL<TRouteState>;
528
- getLocation(): Location;
528
+ getLocation: () => Location;
529
529
  start?: (onUpdate: () => void) => void;
530
530
  dispose?: () => void;
531
531
  push?: (url: string) => void;
@@ -979,7 +979,7 @@ declare type CurrentRefinementsConnectorParamsItem = {
979
979
  /**
980
980
  * Removes the given refinement and triggers a new search.
981
981
  */
982
- refine(refinement: CurrentRefinementsConnectorParamsRefinement): void;
982
+ refine: (refinement: CurrentRefinementsConnectorParamsRefinement) => void;
983
983
  };
984
984
 
985
985
  declare type CurrentRefinementsConnectorParamsRefinement = {
@@ -1060,7 +1060,7 @@ declare type CurrentRefinementsRenderState = {
1060
1060
  /**
1061
1061
  * Removes the given refinement and triggers a new search.
1062
1062
  */
1063
- refine(refinement: CurrentRefinementsConnectorParamsRefinement): void;
1063
+ refine: (refinement: CurrentRefinementsConnectorParamsRefinement) => void;
1064
1064
  /**
1065
1065
  * Generates a URL for the next state.
1066
1066
  */
@@ -1117,10 +1117,10 @@ declare type DynamicWidgetsConnectorParams = {
1117
1117
  * Function to return a fallback widget when an attribute isn't found in
1118
1118
  * `widgets`.
1119
1119
  */
1120
- fallbackWidget?(args: {
1120
+ fallbackWidget?: (args: {
1121
1121
  /** The attribute name to create a widget for. */
1122
1122
  attribute: string;
1123
- }): Widget;
1123
+ }) => Widget;
1124
1124
  /**
1125
1125
  * Function to transform the items to render.
1126
1126
  * The function also exposes the full search response.
@@ -1174,12 +1174,12 @@ declare type DynamicWidgetsWidgetParams = {
1174
1174
  * Function to return a fallback widget when an attribute isn't found in
1175
1175
  * `widgets`.
1176
1176
  */
1177
- fallbackWidget?(args: {
1177
+ fallbackWidget?: (args: {
1178
1178
  /** The attribute name to create a widget for. */
1179
1179
  attribute: string;
1180
1180
  /** CSS Selector or HTMLElement to insert the widget */
1181
1181
  container: HTMLElement;
1182
- }): Widget;
1182
+ }) => Widget;
1183
1183
  };
1184
1184
 
1185
1185
  declare type Expand<T> = T extends infer O ? {
@@ -1264,7 +1264,7 @@ declare type GeoSearchMarker<TOptions> = {
1264
1264
  * See the documentation for more information:
1265
1265
  * https://developers.google.com/maps/documentation/javascript/reference/3/#MarkerOptions
1266
1266
  */
1267
- createOptions?(item: GeoHit): TOptions;
1267
+ createOptions?: (item: GeoHit) => TOptions;
1268
1268
  /**
1269
1269
  * Object that takes an event type (ex: `click`, `mouseover`) as key and a
1270
1270
  * listener as value. The listener is provided with an object that contains:
@@ -1284,7 +1284,7 @@ declare type GeoSearchRenderState<THit extends BaseHit = Record<string, any>> =
1284
1284
  /**
1285
1285
  * Reset the current bounding box refinement.
1286
1286
  */
1287
- clearMapRefinement(): void;
1287
+ clearMapRefinement: () => void;
1288
1288
  /**
1289
1289
  * The current bounding box of the search.
1290
1290
  */
@@ -1292,15 +1292,15 @@ declare type GeoSearchRenderState<THit extends BaseHit = Record<string, any>> =
1292
1292
  /**
1293
1293
  * Return true if the map has move since the last refinement.
1294
1294
  */
1295
- hasMapMoveSinceLastRefine(): boolean;
1295
+ hasMapMoveSinceLastRefine: () => boolean;
1296
1296
  /**
1297
1297
  * Return true if the current refinement is set with the map bounds.
1298
1298
  */
1299
- isRefinedWithMap(): boolean;
1299
+ isRefinedWithMap: () => boolean;
1300
1300
  /**
1301
1301
  * Return true if the user is able to refine on map move.
1302
1302
  */
1303
- isRefineOnMapMove(): boolean;
1303
+ isRefineOnMapMove: () => boolean;
1304
1304
  /**
1305
1305
  * The matched hits from Algolia API.
1306
1306
  */
@@ -1312,7 +1312,7 @@ declare type GeoSearchRenderState<THit extends BaseHit = Record<string, any>> =
1312
1312
  /**
1313
1313
  * Sets a bounding box to filter the results from the given map bounds.
1314
1314
  */
1315
- refine(bounds: Bounds): void;
1315
+ refine: (bounds: Bounds) => void;
1316
1316
  /**
1317
1317
  * Send event to insights middleware
1318
1318
  */
@@ -1322,11 +1322,11 @@ declare type GeoSearchRenderState<THit extends BaseHit = Record<string, any>> =
1322
1322
  * called on each map move. The call to the function triggers a new rendering
1323
1323
  * only when the value change.
1324
1324
  */
1325
- setMapMoveSinceLastRefine(): void;
1325
+ setMapMoveSinceLastRefine: () => void;
1326
1326
  /**
1327
1327
  * Toggle the fact that the user is able to refine on map move.
1328
1328
  */
1329
- toggleRefineOnMapMove(): void;
1329
+ toggleRefineOnMapMove: () => void;
1330
1330
  };
1331
1331
 
1332
1332
  declare type GeoSearchTemplates = Partial<{
@@ -2069,39 +2069,39 @@ declare type IndexUiState = Partial<ConnectorUiStates & WidgetUiStates>;
2069
2069
  declare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<IndexWidgetDescription & {
2070
2070
  widgetParams: IndexWidgetParams;
2071
2071
  }>, 'getWidgetUiState' | 'getWidgetState'> & {
2072
- getIndexName(): string;
2073
- getIndexId(): string;
2074
- getHelper(): AlgoliaSearchHelper | null;
2075
- getResults(): SearchResults | null;
2076
- getPreviousState(): SearchParameters | null;
2077
- getScopedResults(): ScopedResult[];
2078
- getParent(): IndexWidget | null;
2079
- getWidgets(): Array<Widget | IndexWidget>;
2080
- createURL(state: SearchParameters): string;
2081
- addWidgets(widgets: Array<Widget | IndexWidget>): IndexWidget;
2082
- removeWidgets(widgets: Array<Widget | IndexWidget>): IndexWidget;
2083
- init(options: IndexInitOptions): void;
2084
- render(options: IndexRenderOptions): void;
2085
- dispose(): void;
2072
+ getIndexName: () => string;
2073
+ getIndexId: () => string;
2074
+ getHelper: () => AlgoliaSearchHelper | null;
2075
+ getResults: () => SearchResults | null;
2076
+ getPreviousState: () => SearchParameters | null;
2077
+ getScopedResults: () => ScopedResult[];
2078
+ getParent: () => IndexWidget | null;
2079
+ getWidgets: () => Array<Widget | IndexWidget>;
2080
+ createURL: (state: SearchParameters) => string;
2081
+ addWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;
2082
+ removeWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;
2083
+ init: (options: IndexInitOptions) => void;
2084
+ render: (options: IndexRenderOptions) => void;
2085
+ dispose: () => void;
2086
2086
  /**
2087
2087
  * @deprecated
2088
2088
  */
2089
- getWidgetState(uiState: UiState): UiState;
2090
- getWidgetUiState<TSpecificUiState extends UiState = TUiState>(uiState: TSpecificUiState): TSpecificUiState;
2091
- getWidgetSearchParameters(searchParameters: SearchParameters, searchParametersOptions: {
2089
+ getWidgetState: (uiState: UiState) => UiState;
2090
+ getWidgetUiState: <TSpecificUiState extends UiState = TUiState>(uiState: TSpecificUiState) => TSpecificUiState;
2091
+ getWidgetSearchParameters: (searchParameters: SearchParameters, searchParametersOptions: {
2092
2092
  uiState: IndexUiState;
2093
- }): SearchParameters;
2093
+ }) => SearchParameters;
2094
2094
  /**
2095
2095
  * Set this index' UI state back to the state defined by the widgets.
2096
2096
  * Can only be called after `init`.
2097
2097
  */
2098
- refreshUiState(): void;
2098
+ refreshUiState: () => void;
2099
2099
  /**
2100
2100
  * Set this index' UI state and search. This is the equivalent of calling
2101
2101
  * a spread `setUiState` on the InstantSearch instance.
2102
2102
  * Can only be called after `init`.
2103
2103
  */
2104
- setIndexUiState(indexUiState: TUiState[string] | ((previousIndexUiState: TUiState[string]) => TUiState[string])): void;
2104
+ setIndexUiState: (indexUiState: TUiState[string] | ((previousIndexUiState: TUiState[string]) => TUiState[string])) => void;
2105
2105
  };
2106
2106
 
2107
2107
  declare type IndexWidgetDescription = {
@@ -2379,8 +2379,8 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
2379
2379
  _searchFunction?: InstantSearchOptions['searchFunction'];
2380
2380
  _mainHelperSearch?: AlgoliaSearchHelper['search'];
2381
2381
  middleware: Array<{
2382
- creator: Middleware;
2383
- instance: MiddlewareDefinition;
2382
+ creator: Middleware<TUiState>;
2383
+ instance: MiddlewareDefinition<TUiState>;
2384
2384
  }>;
2385
2385
  sendEventToInsights: (event: InsightsEvent) => void;
2386
2386
  /**
@@ -2400,11 +2400,11 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
2400
2400
  /**
2401
2401
  * Hooks a middleware into the InstantSearch lifecycle.
2402
2402
  */
2403
- use(...middleware: Middleware[]): this;
2403
+ use(...middleware: Array<Middleware<TUiState>>): this;
2404
2404
  /**
2405
2405
  * Removes a middleware from the InstantSearch lifecycle.
2406
2406
  */
2407
- unuse(...middlewareToUnuse: Middleware[]): this;
2407
+ unuse(...middlewareToUnuse: Array<Middleware<TUiState>>): this;
2408
2408
  EXPERIMENTAL_use(...middleware: Middleware[]): this;
2409
2409
  /**
2410
2410
  * Adds a widget to the search instance.
@@ -2450,12 +2450,12 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
2450
2450
  */
2451
2451
  dispose(): void;
2452
2452
  scheduleSearch: (() => void) & {
2453
- wait(): Promise<void>;
2454
- cancel(): void;
2453
+ wait: () => Promise<void>;
2454
+ cancel: () => void;
2455
2455
  };
2456
2456
  scheduleRender: ((shouldResetStatus?: boolean) => void) & {
2457
- wait(): Promise<void>;
2458
- cancel(): void;
2457
+ wait: () => Promise<void>;
2458
+ cancel: () => void;
2459
2459
  };
2460
2460
  scheduleStalledRender(): void;
2461
2461
  /**
@@ -2466,8 +2466,8 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
2466
2466
  setUiState(uiState: TUiState | ((previousUiState: TUiState) => TUiState), callOnStateChange?: boolean): void;
2467
2467
  getUiState(): TUiState;
2468
2468
  onInternalStateChange: (() => void) & {
2469
- wait(): Promise<void>;
2470
- cancel(): void;
2469
+ wait: () => Promise<void>;
2470
+ cancel: () => void;
2471
2471
  };
2472
2472
  createURL(nextState?: TUiState): string;
2473
2473
  refresh(): void;
@@ -2520,9 +2520,9 @@ declare type InstantSearchModule = {
2520
2520
  */
2521
2521
  declare type InstantSearchOptions<TUiState extends UiState = UiState, TRouteState = TUiState> = {
2522
2522
  /**
2523
- * The name of the main index
2523
+ * The name of the main index. If no indexName is provided, you have to manually add an index widget.
2524
2524
  */
2525
- indexName: string;
2525
+ indexName?: string;
2526
2526
  /**
2527
2527
  * The search client to plug to InstantSearch.js
2528
2528
  *
@@ -2571,7 +2571,7 @@ declare type InstantSearchOptions<TUiState extends UiState = UiState, TRouteStat
2571
2571
  */
2572
2572
  onStateChange?: (params: {
2573
2573
  uiState: TUiState;
2574
- setUiState(uiState: TUiState | ((previousUiState: TUiState) => TUiState)): void;
2574
+ setUiState: (uiState: TUiState | ((previousUiState: TUiState) => TUiState)) => void;
2575
2575
  }) => void;
2576
2576
  /**
2577
2577
  * Injects a `uiState` to the `instantsearch` instance. You can use this option
@@ -2734,7 +2734,7 @@ declare type MenuRenderState = {
2734
2734
  /**
2735
2735
  * Filter the search to item value.
2736
2736
  */
2737
- refine(value: string): void;
2737
+ refine: (value: string) => void;
2738
2738
  /**
2739
2739
  * True if refinement can be applied.
2740
2740
  */
@@ -2746,7 +2746,7 @@ declare type MenuRenderState = {
2746
2746
  /**
2747
2747
  * Toggles the number of values displayed between `limit` and `showMore.limit`.
2748
2748
  */
2749
- toggleShowMore(): void;
2749
+ toggleShowMore: () => void;
2750
2750
  /**
2751
2751
  * `true` if the toggleShowMore button can be activated (enough items to display more or
2752
2752
  * already displaying more than `limit` items)
@@ -2868,7 +2868,7 @@ declare type MenuWidgetParams = {
2868
2868
  cssClasses?: MenuCSSClasses;
2869
2869
  };
2870
2870
 
2871
- declare type Middleware = (options: MiddlewareOptions) => AtLeastOne<MiddlewareDefinition>;
2871
+ declare type Middleware<TUiState extends UiState = UiState> = (options: MiddlewareOptions) => AtLeastOne<MiddlewareDefinition<TUiState>>;
2872
2872
 
2873
2873
  declare type MiddlewareDefinition<TUiState extends UiState = UiState> = {
2874
2874
  /**
@@ -2878,21 +2878,21 @@ declare type MiddlewareDefinition<TUiState extends UiState = UiState> = {
2878
2878
  /**
2879
2879
  * Change handler called on every UiState change
2880
2880
  */
2881
- onStateChange(options: {
2881
+ onStateChange: (options: {
2882
2882
  uiState: TUiState;
2883
- }): void;
2883
+ }) => void;
2884
2884
  /**
2885
2885
  * Called when the middleware is added to InstantSearch
2886
2886
  */
2887
- subscribe(): void;
2887
+ subscribe: () => void;
2888
2888
  /**
2889
2889
  * Called when InstantSearch is started
2890
2890
  */
2891
- started(): void;
2891
+ started: () => void;
2892
2892
  /**
2893
2893
  * Called when the middleware is removed from InstantSearch
2894
2894
  */
2895
- unsubscribe(): void;
2895
+ unsubscribe: () => void;
2896
2896
  };
2897
2897
 
2898
2898
  declare type MiddlewareOptions = {
@@ -3175,7 +3175,7 @@ declare type PaginationRenderState = {
3175
3175
  /** Creates URLs for the next state, the number is the page to generate the URL for. */
3176
3176
  createURL: CreateURL<number>;
3177
3177
  /** Sets the current page and triggers a search. */
3178
- refine(page: number): void;
3178
+ refine: (page: number) => void;
3179
3179
  /** true if this search returned more than one page */
3180
3180
  canRefine: boolean;
3181
3181
  /** The number of the page currently displayed. */
@@ -3353,12 +3353,12 @@ declare type PanelWidgetParams<TWidgetFactory extends AnyWidgetFactory> = {
3353
3353
  * A function that is called on each render to determine if the
3354
3354
  * panel should be hidden based on the render options.
3355
3355
  */
3356
- hidden?(options: PanelRenderOptions<TWidgetFactory>): boolean;
3356
+ hidden?: (options: PanelRenderOptions<TWidgetFactory>) => boolean;
3357
3357
  /**
3358
3358
  * A function that is called on each render to determine if the
3359
3359
  * panel should be collapsed based on the render options.
3360
3360
  */
3361
- collapsed?(options: PanelRenderOptions<TWidgetFactory>): boolean;
3361
+ collapsed?: (options: PanelRenderOptions<TWidgetFactory>) => boolean;
3362
3362
  /**
3363
3363
  * The templates to use for the widget.
3364
3364
  */
@@ -3674,7 +3674,7 @@ declare type RangeRenderState = {
3674
3674
  * previously set bound or to set an infinite bound.
3675
3675
  * @param rangeValue tuple of [min, max] bounds
3676
3676
  */
3677
- refine(rangeValue: RangeBoundaries): void;
3677
+ refine: (rangeValue: RangeBoundaries) => void;
3678
3678
  /**
3679
3679
  * Indicates whether this widget can be refined
3680
3680
  */
@@ -3696,8 +3696,8 @@ declare type RangeRenderState = {
3696
3696
  * Both functions take a `number` as input and should output a `string`.
3697
3697
  */
3698
3698
  format: {
3699
- from(fromValue: number): string;
3700
- to(toValue: number): string;
3699
+ from: (fromValue: number) => string;
3700
+ to: (toValue: number) => string;
3701
3701
  };
3702
3702
  };
3703
3703
 
@@ -3732,7 +3732,7 @@ declare type RangeSliderTooltipOptions = {
3732
3732
  * @example
3733
3733
  * { format(rawValue) {return '$' + Math.round(rawValue).toLocaleString() } }
3734
3734
  */
3735
- format(value: number): string;
3735
+ format: (value: number) => string;
3736
3736
  };
3737
3737
 
3738
3738
  declare type RangeSliderWidget = WidgetFactory<Omit<RangeWidgetDescription, '$$type'> & {
@@ -3992,7 +3992,7 @@ declare type ReconfigurableOptions = Places.ReconfigurableOptions;
3992
3992
  */
3993
3993
  declare type Refine = (searchParameters: PlainSearchParameters) => void;
3994
3994
 
3995
- declare type Refine_2 = (relevancyStrictness: number) => void;
3995
+ declare type Refine_2 = (relevancyStrictness: number | undefined) => void;
3996
3996
 
3997
3997
  /**
3998
3998
  * The refinement list widget is one of the most common widget that you can find
@@ -4206,7 +4206,7 @@ declare type RefinementListRenderState = {
4206
4206
  /**
4207
4207
  * Action to apply selected refinements.
4208
4208
  */
4209
- refine(value: string): void;
4209
+ refine: (value: string) => void;
4210
4210
  /**
4211
4211
  * Send event to insights middleware
4212
4212
  */
@@ -4214,7 +4214,7 @@ declare type RefinementListRenderState = {
4214
4214
  /**
4215
4215
  * Searches for values inside the list.
4216
4216
  */
4217
- searchForItems(query: string): void;
4217
+ searchForItems: (query: string) => void;
4218
4218
  /**
4219
4219
  * `true` if the values are from an index search.
4220
4220
  */
@@ -4235,7 +4235,7 @@ declare type RefinementListRenderState = {
4235
4235
  /**
4236
4236
  * Toggles the number of values displayed between `limit` and `showMoreLimit`.
4237
4237
  */
4238
- toggleShowMore(): void;
4238
+ toggleShowMore: () => void;
4239
4239
  };
4240
4240
 
4241
4241
  declare type RefinementListSearchableCSSClasses = Partial<{
@@ -4589,26 +4589,26 @@ declare type Router<TRouteState = UiState> = {
4589
4589
  * In the case of the history / URL in a browser, the callback will be called
4590
4590
  * by `onPopState`.
4591
4591
  */
4592
- onUpdate(callback: (route: TRouteState) => void): void;
4592
+ onUpdate: (callback: (route: TRouteState) => void) => void;
4593
4593
  /**
4594
4594
  * Reads the storage and gets a route object. It does not take parameters,
4595
4595
  * and should return an object
4596
4596
  */
4597
- read(): TRouteState;
4597
+ read: () => TRouteState;
4598
4598
  /**
4599
4599
  * Pushes a route object into a storage. Takes the UI state mapped by the state
4600
4600
  * mapping configured in the mapping
4601
4601
  */
4602
- write(route: TRouteState): void;
4602
+ write: (route: TRouteState) => void;
4603
4603
  /**
4604
4604
  * Transforms a route object into a URL. It receives an object and should
4605
4605
  * return a string. It may return an empty string.
4606
4606
  */
4607
- createURL(state: TRouteState): string;
4607
+ createURL: (state: TRouteState) => string;
4608
4608
  /**
4609
4609
  * Called when InstantSearch is disposed. Used to remove subscriptions.
4610
4610
  */
4611
- dispose(): void;
4611
+ dispose: () => void;
4612
4612
  /**
4613
4613
  * Called when InstantSearch is started.
4614
4614
  */
@@ -4836,7 +4836,7 @@ declare type SharedRenderOptions = {
4836
4836
  };
4837
4837
  status: InstantSearch['status'];
4838
4838
  error: InstantSearch['error'];
4839
- createURL(state: SearchParameters): string;
4839
+ createURL: (state: SearchParameters) => string;
4840
4840
  };
4841
4841
 
4842
4842
  declare function simpleStateMapping<TUiState extends UiState = UiState>(): StateMapping<TUiState, TUiState>;
@@ -5041,13 +5041,13 @@ declare type StateMapping<TUiState = UiState, TRouteState = TUiState> = {
5041
5041
  * It should return an object of any form as long as this form can be read by
5042
5042
  * the `routeToState` function.
5043
5043
  */
5044
- stateToRoute(uiState: TUiState): TRouteState;
5044
+ stateToRoute: (uiState: TUiState) => TRouteState;
5045
5045
  /**
5046
5046
  * Transforms route object into a UI state representation.
5047
5047
  * It receives an object that contains the UI state stored by the router.
5048
5048
  * The format is the output of `stateToRoute`.
5049
5049
  */
5050
- routeToState(routeState: TRouteState): TUiState;
5050
+ routeToState: (routeState: TRouteState) => TUiState;
5051
5051
  /**
5052
5052
  * Identifier for this stateMapping. Used to differentiate between stateMappings.
5053
5053
  */