Skip to content

Commit

Permalink
fix(types): Export all search response types
Browse files Browse the repository at this point in the history
  • Loading branch information
joerideg committed Nov 26, 2024
1 parent 01f961d commit 2817d35
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/features/search/search-response.type.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Category facet fields in the search response.
*/
interface SearchResponseFacetCountsFacetFieldsCategory {
export interface SearchResponseFacetCountsFacetFieldsCategory {
count?: number;
crumb?: string;
parent?: string;
Expand All @@ -13,12 +13,12 @@ interface SearchResponseFacetCountsFacetFieldsCategory {
/**
* Represents the general facet fields in the search response.
*/
interface SearchResponseFacetCountsFacetFieldsGeneral {
export interface SearchResponseFacetCountsFacetFieldsGeneral {
count: number;
name: string;
}

type SearchResponseFacetCountsFacetFields = {
export type SearchResponseFacetCountsFacetFields = {
category?: SearchResponseFacetCountsFacetFieldsCategory[];
} & {
[key: string]: SearchResponseFacetCountsFacetFieldsGeneral[];
Expand All @@ -27,7 +27,7 @@ type SearchResponseFacetCountsFacetFields = {
/**
* Represents the price range facet counts in the search response.
*/
interface SearchResponseFacetCountsFacetRangesPrice {
export interface SearchResponseFacetCountsFacetRangesPrice {
count: number;
start: number | '*';
end: number | '*';
Expand All @@ -36,14 +36,14 @@ interface SearchResponseFacetCountsFacetRangesPrice {
/**
* Represents the facet ranges in the search response.
*/
interface SearchResponseFacetCountsFacetRanges {
export interface SearchResponseFacetCountsFacetRanges {
price?: SearchResponseFacetCountsFacetRangesPrice[];
}

/**
* Represents the facet counts in the search response.
*/
interface SearchResponseFacetCounts {
export interface SearchResponseFacetCounts {
facet_ranges?: SearchResponseFacetCountsFacetRanges;
facet_fields?: SearchResponseFacetCountsFacetFields;
facet_queries?: object;
Expand All @@ -55,7 +55,7 @@ interface SearchResponseFacetCounts {
/**
* Represents a product variant in the search response.
*/
interface Variant {
export interface Variant {
skuid?: string;
sku_color_group: string;
sku_swatch_images: string[];
Expand All @@ -67,7 +67,7 @@ interface Variant {
/**
* Represents a document in the search response.
*/
interface SearchResponseDoc {
export interface SearchResponseDoc {
sale_price: number;
price: number;
description: string;
Expand All @@ -86,7 +86,7 @@ interface SearchResponseDoc {
/**
* Represents the response section of the search response.
*/
interface SearchResponseResponse {
export interface SearchResponseResponse {
numFound?: number;
start?: number;
docs?: SearchResponseDoc[];
Expand All @@ -96,53 +96,53 @@ interface SearchResponseResponse {
/**
* Represents a group in the group list of the search response.
*/
interface SearchResponseGroupResponseGroupListGroup {
export interface SearchResponseGroupResponseGroupListGroup {
groupValue: string;
doclist?: SearchResponseResponse;
}

/**
* Represents a list of groups in the group response of the search response.
*/
interface SearchResponseGroupResponseGroupList {
export interface SearchResponseGroupResponseGroupList {
matches: number;
groups: SearchResponseGroupResponseGroupListGroup[];
}

/**
* Represents the group response in the search response.
*/
interface SearchResponseGroupResponse {
export interface SearchResponseGroupResponse {
[groupName: string]: SearchResponseGroupResponseGroupList;
}

/**
* Represents the price statistics fields in the search response.
*/
interface SearchResponseStatsStatsFieldsPrice {
export interface SearchResponseStatsStatsFieldsPrice {
max: number;
min: number;
}

/**
* Represents the statistics fields in the search response.
*/
interface SearchResponseStatsStatsFields {
export interface SearchResponseStatsStatsFields {
price?: SearchResponseStatsStatsFieldsPrice;
sale_price?: SearchResponseStatsStatsFieldsPrice;
}

/**
* Represents the statistics in the search response.
*/
interface SearchResponseStats {
export interface SearchResponseStats {
stats_fields: SearchResponseStatsStatsFields;
}

/**
* Represents the keywords in the search response.
*/
interface SearchResponseKeywords {
export interface SearchResponseKeywords {
'original query': string;
'redirected query': string;
'redirected url': string;
Expand Down

0 comments on commit 2817d35

Please sign in to comment.