1 | import { ComponentClass } from 'react';
|
2 | import { CommerceTypes, FetchDataFunction, ReviewDataSource, ReviewTypes, WithCommerceProps, WithCommerceProviderProps } from '@brandingbrand/fscommerce';
|
3 | export declare type CommerceToReviewMapFunction<T extends CommerceTypes.Product = CommerceTypes.Product> = (product: T) => string;
|
4 | export interface WithProductDetailProviderProps<T extends CommerceTypes.Product = CommerceTypes.Product> extends WithCommerceProviderProps<T> {
|
5 | commerceToReviewMap: keyof T | CommerceToReviewMapFunction<T>;
|
6 | reviewDataSource?: ReviewDataSource;
|
7 | }
|
8 | export declare type WithProductDetailProps<T extends CommerceTypes.Product = CommerceTypes.Product> = WithCommerceProps<T> & {
|
9 | reviewsData?: ReviewTypes.ReviewDetails[];
|
10 | };
|
11 | export declare type WithProductDetailState<T extends CommerceTypes.Product = CommerceTypes.Product> = Pick<WithCommerceProps<T>, 'commerceData'> & {
|
12 | reviewsData?: ReviewTypes.ReviewDetails[];
|
13 | };
|
14 | export declare type ProductDetailWrapper<P, T extends CommerceTypes.Product = CommerceTypes.Product> = (WrappedComponent: ComponentClass<P & WithProductDetailProps<T>>) => ComponentClass<P & WithProductDetailProviderProps<T>>;
|
15 | export default function withProductDetailData<P, T extends CommerceTypes.Product = CommerceTypes.Product>(fetchProduct: FetchDataFunction<P, T>): ProductDetailWrapper<P, T>;
|