@@ -34,25 +34,30 @@ export const checkUsage = ({attributeName, operator, usageMessage}) => {
3434} ;
3535
3636/**
37- * refinementList connector, allows you to create your own refinement list and completely tune
38- * the rendering of it.
39- * @name connectRefinementList
40- * @TODO : I do not know how to document the dual ()() call in an efficient way with jsDoc that will also be easy
41- * to crawl with the doc crawler (maybe re-use exposed props and provided props but rename it for non react people?)
42- * @param {function } renderFn The rendering function.
43- * @providedProp isFirstRender
44- * @providedProp isFromSearch
45- * @providedProp createURL
46- * @providedProp items
47- * @providedProp refine
48- * @providedProp searchForItems
49- * @providedProp instantSearchInstance
50- * @providedProp canRefine
51- * @exposedProp attributeName
52- * @exposedProp operator
53- * @exposedProp limit
54- * @exposedProp sortBy
55- * @return {[type] } [description]
37+ * @typedef {Object } RefinementListRenderingOptions
38+ * @property {string } attributeName the attribute in the records that are used by the widget
39+ * @property {string } operator how the filters are combined together
40+ * @property {number } limit the max number of items displayed
41+ * @property {string[] } sortBy how the values are ordered
42+ */
43+
44+ /**
45+ * @typedef {Object } RefinementListRenderingOptions
46+ * @property {Object[] } items the list of filtering values returned from Algolia
47+ * @property {function } createURL create the next state url
48+ * @property {function } refine set the next state url
49+ * @property {function } searchForItems search for values inside the list
50+ * @property {boolean } isFromSearch indicates if the values are from an index search
51+ * @property {boolean } canRefine indicates if a refinement can be applied
52+ * @property {InstantSearch } instantSearchInstance the instance of instantsearch on which the widget is attached
53+ */
54+
55+ /**
56+ * Creates a custom widget for a refinement list.
57+ *
58+ * @function connectRefinementList
59+ * @param {function(RefinementListRenderingOptions, boolean) } renderFn function that renders the refinement list widget
60+ * @returns {function(RefinementListWidgetOptions) } a custom refinement list widget factory
5661 */
5762export default function connectRefinementList ( renderFn ) {
5863 checkRendering ( renderFn , usage ) ;
0 commit comments