diff --git a/src/widgets/dynamic-widgets/dynamic-widgets.ts b/src/widgets/dynamic-widgets/dynamic-widgets.ts index 9d06bb23eb..b26acb7338 100644 --- a/src/widgets/dynamic-widgets/dynamic-widgets.ts +++ b/src/widgets/dynamic-widgets/dynamic-widgets.ts @@ -20,13 +20,15 @@ export type DynamicWidgetsWidgetParams = { widgets: Array<(container: HTMLElement) => Widget>; }; -export type DynamicWidgets = WidgetFactory< +export type DynamicWidgetsWidget = WidgetFactory< DynamicWidgetsWidgetDescription & { $$widgetType: 'ais.dynamicWidgets' }, Omit<DynamicWidgetsConnectorParams, 'widgets'>, DynamicWidgetsWidgetParams >; -const dynamicWidgets: DynamicWidgets = function dynamicWidgets(widgetParams) { +const dynamicWidgets: DynamicWidgetsWidget = function dynamicWidgets( + widgetParams +) { const { container: containerSelector, transformItems, widgets } = widgetParams || {}; diff --git a/src/widgets/query-rule-context/query-rule-context.tsx b/src/widgets/query-rule-context/query-rule-context.tsx index 1d7ed71c8b..78c8862fd3 100644 --- a/src/widgets/query-rule-context/query-rule-context.tsx +++ b/src/widgets/query-rule-context/query-rule-context.tsx @@ -7,12 +7,12 @@ import connectQueryRules, { QueryRulesWidgetDescription, } from '../../connectors/query-rules/connectQueryRules'; -type QueryRuleContextWidgetParams = { +export type QueryRuleContextWidgetParams = { trackedFilters: ParamTrackedFilters; transformRuleContexts?: ParamTransformRuleContexts; }; -type QueryRuleContext = WidgetFactory< +export type QueryRuleContextWidget = WidgetFactory< QueryRulesWidgetDescription & { $$widgetType: 'ais.queryRuleContext' }, QueryRulesConnectorParams, QueryRuleContextWidgetParams @@ -22,7 +22,7 @@ const withUsage = createDocumentationMessageGenerator({ name: 'query-rule-context', }); -const queryRuleContext: QueryRuleContext = ( +const queryRuleContext: QueryRuleContextWidget = ( widgetParams = {} as QueryRuleContextWidgetParams ) => { if (!widgetParams.trackedFilters) { diff --git a/src/widgets/query-rule-custom-data/query-rule-custom-data.tsx b/src/widgets/query-rule-custom-data/query-rule-custom-data.tsx index 6e3854e3ed..09d76ca007 100644 --- a/src/widgets/query-rule-custom-data/query-rule-custom-data.tsx +++ b/src/widgets/query-rule-custom-data/query-rule-custom-data.tsx @@ -27,13 +27,13 @@ export type QueryRuleCustomDataTemplates = Partial<{ default: Template<{ items: any[] }>; }>; -type QueryRuleCustomDataWidgetParams = { +export type QueryRuleCustomDataWidgetParams = { container: string | HTMLElement; cssClasses?: QueryRuleCustomDataCSSClasses; templates?: QueryRuleCustomDataTemplates; }; -type QueryRuleCustomDataWidget = WidgetFactory< +export type QueryRuleCustomDataWidget = WidgetFactory< QueryRulesWidgetDescription & { $$widgetType: 'ais.queryRuleCustomData' }, QueryRulesConnectorParams, QueryRuleCustomDataWidgetParams diff --git a/src/widgets/relevant-sort/relevant-sort.tsx b/src/widgets/relevant-sort/relevant-sort.tsx index 7eb8c4c1a7..a0de6800a7 100644 --- a/src/widgets/relevant-sort/relevant-sort.tsx +++ b/src/widgets/relevant-sort/relevant-sort.tsx @@ -37,7 +37,7 @@ export type RelevantSortWidgetParams = { templates?: RelevantSortTemplates; }; -type RelevantSortWidget = WidgetFactory< +export type RelevantSortWidget = WidgetFactory< RelevantSortWidgetDescription & { $$widgetType: 'ais.relevantSort' }, RelevantSortConnectorParams, RelevantSortWidgetParams diff --git a/src/widgets/voice-search/voice-search.tsx b/src/widgets/voice-search/voice-search.tsx index f63fa395d3..b1813f919e 100644 --- a/src/widgets/voice-search/voice-search.tsx +++ b/src/widgets/voice-search/voice-search.tsx @@ -56,7 +56,7 @@ export type VoiceSearchWidgetParams = { createVoiceSearchHelper?: CreateVoiceSearchHelper; }; -type VoiceSearch = WidgetFactory< +export type VoiceSearchWidget = WidgetFactory< VoiceSearchWidgetDescription & { $$type: 'ais.voiceSearch' }, VoiceSearchConnectorParams, VoiceSearchWidgetParams @@ -89,7 +89,7 @@ const renderer = ({ ); }; -const voiceSearch: VoiceSearch = widgetParams => { +const voiceSearch: VoiceSearchWidget = widgetParams => { const { container, cssClasses: userCssClasses = {},