instantsearch.js 4.40.5 → 4.41.1
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/CHANGELOG.md +29 -0
- package/cjs/lib/InstantSearch.js +14 -7
- package/cjs/lib/utils/createSendEventForHits.js +10 -3
- package/cjs/lib/utils/safelyRunOnBrowser.js +1 -1
- package/cjs/lib/version.js +1 -1
- package/dist/instantsearch.development.d.ts +20 -12
- package/dist/instantsearch.development.js +27 -13
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +20 -12
- package/dist/instantsearch.production.min.d.ts +20 -12
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/lib/InstantSearch.d.ts +10 -9
- package/es/lib/InstantSearch.js +14 -7
- package/es/lib/utils/createSendEventForHits.js +10 -3
- package/es/lib/utils/getAppIdAndApiKey.d.ts +1 -1
- package/es/lib/utils/safelyRunOnBrowser.d.ts +1 -1
- package/es/lib/utils/safelyRunOnBrowser.js +1 -1
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/types/widget.d.ts +1 -1
- package/es/widgets/index/index.d.ts +9 -3
- package/package.json +1 -1
|
@@ -2003,9 +2003,15 @@ declare type HTMLMarkerArguments = {
|
|
|
2003
2003
|
|
|
2004
2004
|
declare const index: (widgetParams: IndexWidgetParams) => IndexWidget;
|
|
2005
2005
|
|
|
2006
|
-
declare type IndexInitOptions =
|
|
2006
|
+
declare type IndexInitOptions = {
|
|
2007
|
+
instantSearchInstance: InstantSearch;
|
|
2008
|
+
parent: IndexWidget | null;
|
|
2009
|
+
uiState: UiState;
|
|
2010
|
+
};
|
|
2007
2011
|
|
|
2008
|
-
declare type IndexRenderOptions =
|
|
2012
|
+
declare type IndexRenderOptions = {
|
|
2013
|
+
instantSearchInstance: InstantSearch;
|
|
2014
|
+
};
|
|
2009
2015
|
|
|
2010
2016
|
declare type IndexRenderState = Partial<ConnectorRenderStates & WidgetRenderStates>;
|
|
2011
2017
|
|
|
@@ -2280,7 +2286,7 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
|
|
|
2280
2286
|
client: InstantSearchOptions['searchClient'];
|
|
2281
2287
|
indexName: string;
|
|
2282
2288
|
insightsClient: InsightsClient | null;
|
|
2283
|
-
onStateChange: InstantSearchOptions['onStateChange'] | null;
|
|
2289
|
+
onStateChange: InstantSearchOptions<TUiState>['onStateChange'] | null;
|
|
2284
2290
|
helper: AlgoliaSearchHelper | null;
|
|
2285
2291
|
mainHelper: AlgoliaSearchHelper | null;
|
|
2286
2292
|
mainIndex: IndexWidget;
|
|
@@ -2290,9 +2296,9 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
|
|
|
2290
2296
|
_stalledSearchDelay: number;
|
|
2291
2297
|
_searchStalledTimer: any;
|
|
2292
2298
|
_isSearchStalled: boolean;
|
|
2293
|
-
_initialUiState:
|
|
2299
|
+
_initialUiState: TUiState;
|
|
2294
2300
|
_initialResults: InitialResults | null;
|
|
2295
|
-
_createURL: CreateURL<
|
|
2301
|
+
_createURL: CreateURL<TUiState>;
|
|
2296
2302
|
_searchFunction?: InstantSearchOptions['searchFunction'];
|
|
2297
2303
|
_mainHelperSearch?: AlgoliaSearchHelper['search'];
|
|
2298
2304
|
middleware: Array<{
|
|
@@ -2362,13 +2368,13 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
|
|
|
2362
2368
|
cancel(): void;
|
|
2363
2369
|
};
|
|
2364
2370
|
scheduleStalledRender(): void;
|
|
2365
|
-
setUiState(uiState:
|
|
2366
|
-
getUiState():
|
|
2371
|
+
setUiState(uiState: TUiState | ((previousUiState: TUiState) => TUiState)): void;
|
|
2372
|
+
getUiState(): TUiState;
|
|
2367
2373
|
onInternalStateChange: ((...args: any[]) => void) & {
|
|
2368
2374
|
wait(): Promise<void>;
|
|
2369
2375
|
cancel(): void;
|
|
2370
2376
|
};
|
|
2371
|
-
createURL(nextState?:
|
|
2377
|
+
createURL(nextState?: TUiState): string;
|
|
2372
2378
|
refresh(): void;
|
|
2373
2379
|
}
|
|
2374
2380
|
|
|
@@ -2460,8 +2466,8 @@ declare type InstantSearchOptions<TUiState extends UiState = UiState, TRouteStat
|
|
|
2460
2466
|
* become in charge of updating the UI state with the `setUiState` function.
|
|
2461
2467
|
*/
|
|
2462
2468
|
onStateChange?: (params: {
|
|
2463
|
-
uiState:
|
|
2464
|
-
setUiState(uiState:
|
|
2469
|
+
uiState: TUiState;
|
|
2470
|
+
setUiState(uiState: TUiState | ((previousUiState: TUiState) => TUiState)): void;
|
|
2465
2471
|
}) => void;
|
|
2466
2472
|
/**
|
|
2467
2473
|
* Injects a `uiState` to the `instantsearch` instance. You can use this option
|
|
@@ -2469,7 +2475,7 @@ declare type InstantSearchOptions<TUiState extends UiState = UiState, TRouteStat
|
|
|
2469
2475
|
* for the first search. To unconditionally pass additional parameters to the
|
|
2470
2476
|
* Algolia API, take a look at the `configure` widget.
|
|
2471
2477
|
*/
|
|
2472
|
-
initialUiState?: TUiState
|
|
2478
|
+
initialUiState?: NoInfer<TUiState>;
|
|
2473
2479
|
/**
|
|
2474
2480
|
* Time before a search is considered stalled. The default is 200ms
|
|
2475
2481
|
*/
|
|
@@ -2773,6 +2779,8 @@ declare namespace middlewares {
|
|
|
2773
2779
|
}
|
|
2774
2780
|
}
|
|
2775
2781
|
|
|
2782
|
+
declare type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
2783
|
+
|
|
2776
2784
|
declare const numericMenu: NumericMenuWidget;
|
|
2777
2785
|
|
|
2778
2786
|
declare type NumericMenuComponentCSSClasses = ComponentCSSClasses<NumericMenuCSSClasses>;
|
|
@@ -4595,7 +4603,7 @@ declare type SendEventForToggle = BuiltInSendEventForToggle & CustomSendEventFor
|
|
|
4595
4603
|
|
|
4596
4604
|
declare type SharedRenderOptions = {
|
|
4597
4605
|
instantSearchInstance: InstantSearch;
|
|
4598
|
-
parent: IndexWidget
|
|
4606
|
+
parent: IndexWidget;
|
|
4599
4607
|
templatesConfig: Record<string, unknown>;
|
|
4600
4608
|
scopedResults: ScopedResult[];
|
|
4601
4609
|
state: SearchParameters;
|
|
@@ -2003,9 +2003,15 @@ declare type HTMLMarkerArguments = {
|
|
|
2003
2003
|
|
|
2004
2004
|
declare const index: (widgetParams: IndexWidgetParams) => IndexWidget;
|
|
2005
2005
|
|
|
2006
|
-
declare type IndexInitOptions =
|
|
2006
|
+
declare type IndexInitOptions = {
|
|
2007
|
+
instantSearchInstance: InstantSearch;
|
|
2008
|
+
parent: IndexWidget | null;
|
|
2009
|
+
uiState: UiState;
|
|
2010
|
+
};
|
|
2007
2011
|
|
|
2008
|
-
declare type IndexRenderOptions =
|
|
2012
|
+
declare type IndexRenderOptions = {
|
|
2013
|
+
instantSearchInstance: InstantSearch;
|
|
2014
|
+
};
|
|
2009
2015
|
|
|
2010
2016
|
declare type IndexRenderState = Partial<ConnectorRenderStates & WidgetRenderStates>;
|
|
2011
2017
|
|
|
@@ -2280,7 +2286,7 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
|
|
|
2280
2286
|
client: InstantSearchOptions['searchClient'];
|
|
2281
2287
|
indexName: string;
|
|
2282
2288
|
insightsClient: InsightsClient | null;
|
|
2283
|
-
onStateChange: InstantSearchOptions['onStateChange'] | null;
|
|
2289
|
+
onStateChange: InstantSearchOptions<TUiState>['onStateChange'] | null;
|
|
2284
2290
|
helper: AlgoliaSearchHelper | null;
|
|
2285
2291
|
mainHelper: AlgoliaSearchHelper | null;
|
|
2286
2292
|
mainIndex: IndexWidget;
|
|
@@ -2290,9 +2296,9 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
|
|
|
2290
2296
|
_stalledSearchDelay: number;
|
|
2291
2297
|
_searchStalledTimer: any;
|
|
2292
2298
|
_isSearchStalled: boolean;
|
|
2293
|
-
_initialUiState:
|
|
2299
|
+
_initialUiState: TUiState;
|
|
2294
2300
|
_initialResults: InitialResults | null;
|
|
2295
|
-
_createURL: CreateURL<
|
|
2301
|
+
_createURL: CreateURL<TUiState>;
|
|
2296
2302
|
_searchFunction?: InstantSearchOptions['searchFunction'];
|
|
2297
2303
|
_mainHelperSearch?: AlgoliaSearchHelper['search'];
|
|
2298
2304
|
middleware: Array<{
|
|
@@ -2362,13 +2368,13 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
|
|
|
2362
2368
|
cancel(): void;
|
|
2363
2369
|
};
|
|
2364
2370
|
scheduleStalledRender(): void;
|
|
2365
|
-
setUiState(uiState:
|
|
2366
|
-
getUiState():
|
|
2371
|
+
setUiState(uiState: TUiState | ((previousUiState: TUiState) => TUiState)): void;
|
|
2372
|
+
getUiState(): TUiState;
|
|
2367
2373
|
onInternalStateChange: ((...args: any[]) => void) & {
|
|
2368
2374
|
wait(): Promise<void>;
|
|
2369
2375
|
cancel(): void;
|
|
2370
2376
|
};
|
|
2371
|
-
createURL(nextState?:
|
|
2377
|
+
createURL(nextState?: TUiState): string;
|
|
2372
2378
|
refresh(): void;
|
|
2373
2379
|
}
|
|
2374
2380
|
|
|
@@ -2460,8 +2466,8 @@ declare type InstantSearchOptions<TUiState extends UiState = UiState, TRouteStat
|
|
|
2460
2466
|
* become in charge of updating the UI state with the `setUiState` function.
|
|
2461
2467
|
*/
|
|
2462
2468
|
onStateChange?: (params: {
|
|
2463
|
-
uiState:
|
|
2464
|
-
setUiState(uiState:
|
|
2469
|
+
uiState: TUiState;
|
|
2470
|
+
setUiState(uiState: TUiState | ((previousUiState: TUiState) => TUiState)): void;
|
|
2465
2471
|
}) => void;
|
|
2466
2472
|
/**
|
|
2467
2473
|
* Injects a `uiState` to the `instantsearch` instance. You can use this option
|
|
@@ -2469,7 +2475,7 @@ declare type InstantSearchOptions<TUiState extends UiState = UiState, TRouteStat
|
|
|
2469
2475
|
* for the first search. To unconditionally pass additional parameters to the
|
|
2470
2476
|
* Algolia API, take a look at the `configure` widget.
|
|
2471
2477
|
*/
|
|
2472
|
-
initialUiState?: TUiState
|
|
2478
|
+
initialUiState?: NoInfer<TUiState>;
|
|
2473
2479
|
/**
|
|
2474
2480
|
* Time before a search is considered stalled. The default is 200ms
|
|
2475
2481
|
*/
|
|
@@ -2773,6 +2779,8 @@ declare namespace middlewares {
|
|
|
2773
2779
|
}
|
|
2774
2780
|
}
|
|
2775
2781
|
|
|
2782
|
+
declare type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
2783
|
+
|
|
2776
2784
|
declare const numericMenu: NumericMenuWidget;
|
|
2777
2785
|
|
|
2778
2786
|
declare type NumericMenuComponentCSSClasses = ComponentCSSClasses<NumericMenuCSSClasses>;
|
|
@@ -4595,7 +4603,7 @@ declare type SendEventForToggle = BuiltInSendEventForToggle & CustomSendEventFor
|
|
|
4595
4603
|
|
|
4596
4604
|
declare type SharedRenderOptions = {
|
|
4597
4605
|
instantSearchInstance: InstantSearch;
|
|
4598
|
-
parent: IndexWidget
|
|
4606
|
+
parent: IndexWidget;
|
|
4599
4607
|
templatesConfig: Record<string, unknown>;
|
|
4600
4608
|
scopedResults: ScopedResult[];
|
|
4601
4609
|
state: SearchParameters;
|