UNPKG

@convermax/api

Version:

A package for searching products via Convermax API

109 lines 3.05 kB
export declare namespace ServerModel { interface Action { Type: 'Redirect'; RedirectUrl: string; } interface AutocompletePopularSearchItem { Type: 'PopularSearch'; Text: string; TextHighlight: string; SessionCount: number; } interface AutocompleteFreetextItem { Type: 'Freetext'; Text: string; TextHighlight: string; HitCount: number; } interface AutocompleteProductItem extends SearchItem { Type: 'Product'; SuggestionGroup: string; TotalHits: number; Redirect?: true; } interface AutocompleteCategoryItem extends SearchItem { Type: 'Category'; Value: string; FacetValue: string; HitCount: number; FieldName: string; SuggestionGroup: string; ImageUrl?: string; Payload?: string; RedirectUrl?: string; Redirect?: true; } type AutocompleteItem = AutocompletePopularSearchItem | AutocompleteFreetextItem | AutocompleteProductItem | AutocompleteCategoryItem; type AutocompleteResponse = AutocompleteItem[]; interface FacetsResponse { Facets: FacetCategory[]; } interface Facet { Value: string; HitCount: number; Term: string; Selected: boolean; Payload: string; Url: string; ImageUrl: string; } type FacetCategory = { FieldName: string; DisplayName: string; DisplayMode: DisplayMode; AlwaysShowCount: number; Ranges: string[] | null; Values: Facet[] | null; Selection: Facet[] | null; TotalHits: number | null; TreeSeparator: string | null; }; interface FitmentsResponseType { Fitment: FitmentFieldValues; Fields: FitmentField[] | null; Fitments: GenericItem[] | null; } interface FitmentField { Name: string; Title: string; } interface SearchResponse { Items: SearchItem[]; Actions: Action[]; Facets: FacetCategory[]; Query: string; OriginalQuery: string; } type GenericItem = { id?: string; } & { [key: string]: string | string[] | number | number[] | boolean | Record<string, string>; }; type SearchItem = { __docid?: string; __score?: string; id?: string; fitsTheVehicle?: string; variants?: GenericItem[]; Styles?: string[]; }; } export declare enum FitmentFieldValues { VehicleSpecific = "Vehicle Specific", ManyFitments = "Many Fitments", NoFitmentData = "No Fitment Data", UniversalFit = "Universal Fit", NonVehicleProducts = "Non-Vehicle Products" } export declare enum DisplayMode { Default = "Default", None = "None", Ranges = "Ranges", Slider = "Slider", Select = "Select", Size = "Size", Toggle = "Toggle", AdvancedColor = "AdvancedColor", Switch = "Switch" } //# sourceMappingURL=types.d.ts.map