The main aim of this PR was to convert the product-control component to TypeScript. However, since the component is coupled with many other parts (it is itself wrapped into 4 HOCs), many refactoring changes were needed to make the types work.
In particular:
* Add `convertProductResponseItemToSearchItem` utility function
The function allows to clean up the `ProductResponseItem` in order
to make its shape compatible with the `SearchListItem`, instead of
passing the entire object.
Because data from the object might need to be used in certain
circumstance (e.g. render functions), the data is now allowed to be
scoped within a `details` key.
This commit also converts `utils/products` to TypeScript.
* Fix `ProductResponseItem` type missing `slug`
The `slug` is returned by the API but didn't appear in the type def.
* Improve certain HOCs types
The `withSearchedProducts` and `withTransformSingleSelectToMultipleSelect`
HOCs are now typed in such a way that it is clear what incoming props
they expect and what they inject.
* Refactor `ProductAttrributeTermControl` for further type safety
Make sure that `count` is always a `number` as required by the
component types.
* Refactor `search-list-control.tsx` and `item.tsx`
The new `SearchItem` allows for the `details` key to be passed.
All the components are now aware of it.