@soma-vertical-web/multi-lib 0.0.32 → 0.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/__vite-browser-external-CpdIDx9o.mjs +79 -0
  2. package/__vite-browser-external-DDWPeg5L.js +1 -0
  3. package/constants.d.ts +32 -0
  4. package/contexts/contexts/search/Facets.d.ts +5 -0
  5. package/contexts/contexts/search/Products.d.ts +5 -0
  6. package/contexts/contexts/search/Root.d.ts +5 -0
  7. package/contexts/contexts/search/Search.d.ts +5 -0
  8. package/contexts/contexts/search/SuggestedTerms.d.ts +5 -0
  9. package/contexts/contexts/search/TopSearches.d.ts +6 -0
  10. package/contexts/index.d.ts +24 -0
  11. package/data/api/fetchVtex.d.ts +2 -1
  12. package/data/api/search/autoCompleteSuggestions/index.d.ts +11 -0
  13. package/data/api/search/crosseling/index.d.ts +91 -0
  14. package/data/api/search/facets/index.d.ts +4 -0
  15. package/data/api/search/index.d.ts +6 -0
  16. package/data/api/search/product/index.d.ts +3 -0
  17. package/data/api/search/searchFetch.d.ts +3 -0
  18. package/data/api/search/suggestedTerms/index.d.ts +12 -0
  19. package/data/api/search/topSearch/index.d.ts +3 -0
  20. package/data/helpers/search/facets.d.ts +48 -0
  21. package/data/helpers/search/index.d.ts +12 -0
  22. package/data/helpers/search/product/index.d.ts +279 -0
  23. package/data/helpers/search/product/utils/canonical.d.ts +1 -0
  24. package/data/helpers/search/product/utils/enhanceSku.d.ts +9 -0
  25. package/data/helpers/search/product/utils/images.d.ts +7 -0
  26. package/data/helpers/search/product/utils/index.d.ts +8 -0
  27. package/data/helpers/search/product/utils/productStock.d.ts +7 -0
  28. package/data/helpers/search/product/utils/propertyValue.d.ts +20 -0
  29. package/data/helpers/search/product/utils/sanitizeHtml.d.ts +18 -0
  30. package/data/helpers/search/product/utils/sku.d.ts +5 -0
  31. package/data/helpers/search/product/utils/slugify.d.ts +1 -0
  32. package/data/helpers/search/root.d.ts +11 -0
  33. package/data/helpers/search/search.d.ts +7 -0
  34. package/index.js +19 -19
  35. package/index.mjs +4336 -3979
  36. package/index2.js +1 -1
  37. package/index2.mjs +891 -400
  38. package/package.json +1 -1
  39. package/server.d.ts +13 -0
  40. package/types/constants.d.ts +9 -15
  41. package/types/contexts/contexts/plp.d.ts +13 -0
  42. package/types/contexts/contexts/search.d.ts +10 -4
  43. package/types/data/api/index.d.ts +5 -2
  44. package/types/data/api/search/facets/index.d.ts +13 -13
  45. package/types/data/api/search/index.d.ts +25 -12
  46. package/types/data/api/search/product/index.d.ts +1 -8
  47. package/types/data/events/index.d.ts +0 -4
  48. package/types/data/helpers/index.d.ts +9 -1
  49. package/types/global/product/index.d.ts +5 -4
  50. package/types/layout/team-components/AddToCart/index.d.ts +2 -2
  51. package/types/layout/team-components/Sort/index.d.ts +2 -3
  52. package/types/data/api/search/autoCompleteSuggestions/index.d.ts +0 -7
  53. package/types/data/api/search/suggestedTerms/index.d.ts +0 -7
@@ -0,0 +1,79 @@
1
+ const c = "fuzzy", l = "operator", i = (e) => ({
2
+ isDepartment: e != null && e.length ? e[0].key === "category-1" : !1
3
+ }), _ = (e, t) => {
4
+ const n = decodeURIComponent(t ?? "").slice(1).split("/");
5
+ return e.map((o) => {
6
+ if (o.key === "category-2" && o.__typename === "FacetBoolean") {
7
+ const a = o.values;
8
+ return {
9
+ ...o,
10
+ values: a.filter(
11
+ (r) => !n.find(
12
+ (s) => s.toLowerCase() === r.value || s.toLowerCase() === r.name.toLowerCase()
13
+ )
14
+ )
15
+ };
16
+ }
17
+ return o;
18
+ });
19
+ }, p = (e, t) => t ? e === "category-1" : !1, u = (e) => e.key === "operator" && (e.value === "and" || e.value === "or"), f = (e) => e.type === "TEXT", y = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), m = (e) => {
20
+ const { key: t, name: n, values: o } = e;
21
+ return {
22
+ __typename: "FacetBoolean",
23
+ key: t,
24
+ label: n,
25
+ values: o.slice().sort((a, r) => a.name.localeCompare(r.name))
26
+ };
27
+ }, g = ({ key: e, values: t }) => ({
28
+ __typename: "FacetRange",
29
+ key: e,
30
+ values: t
31
+ }), R = (e, t, n) => {
32
+ if (!(e instanceof Object) || !("facets" in e))
33
+ return [];
34
+ const { facets: o = [] } = e, a = t != null && t.length ? t[0].key === "category-1" : !1;
35
+ return o.filter(
36
+ (s) => !n || !p(s.key, a)
37
+ ).map(
38
+ (s) => f(s) ? m(s) : g(s)
39
+ );
40
+ }, C = (e, t) => {
41
+ const n = e.find(({ key: a }) => a === c) ?? null, o = e.find(({ key: a }) => a === l) ?? null;
42
+ n && y(n) && t.append(c, n.value), o && u(o) && t.append(l, o.value);
43
+ }, d = (e) => e.map((t) => {
44
+ const [n, o] = t.split("/");
45
+ return { key: n, value: o };
46
+ }), z = (e, t) => {
47
+ const n = decodeURIComponent(t ?? "").slice(1).split("/"), o = e.filter(({ value: r }) => !n.includes(decodeURIComponent(r))).map((r) => ({
48
+ ...r,
49
+ value: decodeURIComponent(r.value)
50
+ })), { isDepartment: a } = i(o);
51
+ return o == null ? void 0 : o.filter((r) => !p(r.key, a));
52
+ }, b = ({ pathname: e, searchParams: t }, n) => {
53
+ const o = t.get("sort") ?? "", a = t.get("query") ?? null, r = parseInt(t.get("page") ?? "1", 10);
54
+ return {
55
+ sort: o,
56
+ facets: d(n),
57
+ term: a,
58
+ base: a ? "" : e,
59
+ page: r
60
+ };
61
+ }, k = (e) => {
62
+ const t = new URLSearchParams();
63
+ return Object.entries(e).forEach(([n, o]) => {
64
+ Array.isArray(o) ? o.forEach((a) => t.append(n, a)) : o !== void 0 && t.append(n, o);
65
+ }), t;
66
+ }, v = {}, S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
67
+ __proto__: null,
68
+ default: v
69
+ }, Symbol.toStringTag, { value: "Module" }));
70
+ export {
71
+ S as _,
72
+ C as a,
73
+ R as b,
74
+ k as c,
75
+ _ as d,
76
+ z as e,
77
+ v as f,
78
+ b as p
79
+ };
@@ -0,0 +1 @@
1
+ "use strict";const c="fuzzy",l="operator",p=e=>({isDepartment:e!=null&&e.length?e[0].key==="category-1":!1}),f=(e,t)=>{const n=decodeURIComponent(t??"").slice(1).split("/");return e.map(o=>{if(o.key==="category-2"&&o.__typename==="FacetBoolean"){const a=o.values;return{...o,values:a.filter(r=>!n.find(s=>s.toLowerCase()===r.value||s.toLowerCase()===r.name.toLowerCase()))}}return o})},i=(e,t)=>t?e==="category-1":!1,y=e=>e.key==="operator"&&(e.value==="and"||e.value==="or"),m=e=>e.type==="TEXT",d=e=>e.key==="fuzzy"&&(e.value==="0"||e.value==="1"||e.value==="auto"),g=e=>{const{key:t,name:n,values:o}=e;return{__typename:"FacetBoolean",key:t,label:n,values:o.slice().sort((a,r)=>a.name.localeCompare(r.name))}},v=({key:e,values:t})=>({__typename:"FacetRange",key:e,values:t}),_=(e,t,n)=>{if(!(e instanceof Object)||!("facets"in e))return[];const{facets:o=[]}=e,a=t!=null&&t.length?t[0].key==="category-1":!1;return o.filter(s=>!n||!i(s.key,a)).map(s=>m(s)?g(s):v(s))},S=(e,t)=>{const n=e.find(({key:a})=>a===c)??null,o=e.find(({key:a})=>a===l)??null;n&&d(n)&&t.append(c,n.value),o&&y(o)&&t.append(l,o.value)},R=e=>e.map(t=>{const[n,o]=t.split("/");return{key:n,value:o}}),C=(e,t)=>{const n=decodeURIComponent(t??"").slice(1).split("/"),o=e.filter(({value:r})=>!n.includes(decodeURIComponent(r))).map(r=>({...r,value:decodeURIComponent(r.value)})),{isDepartment:a}=p(o);return o==null?void 0:o.filter(r=>!i(r.key,a))},F=({pathname:e,searchParams:t},n)=>{const o=t.get("sort")??"",a=t.get("query")??null,r=parseInt(t.get("page")??"1",10);return{sort:o,facets:R(n),term:a,base:a?"":e,page:r}},h=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([n,o])=>{Array.isArray(o)?o.forEach(a=>t.append(n,a)):o!==void 0&&t.append(n,o)}),t},u={},z=Object.freeze(Object.defineProperty({__proto__:null,default:u},Symbol.toStringTag,{value:"Module"}));exports.__viteBrowserExternal=z;exports.addSearchParamsFacets=S;exports.convertSearchParams=h;exports.filterNonCategorySelected=f;exports.filterNonRootFacets=C;exports.formattedFacets=_;exports.fs=u;exports.parseSearchState=F;
package/constants.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ export declare const PLP_FILTERS_SORT: {
2
+ placeholder: string;
3
+ options: {
4
+ score_desc: string;
5
+ orders_desc: string;
6
+ price_desc: string;
7
+ price_asc: string;
8
+ release_desc: string;
9
+ discount_desc: string;
10
+ name_asc: string;
11
+ };
12
+ default_option: string;
13
+ };
14
+ export declare const PDPShelfType: readonly ["whosawalsosaw", "whosawalsobought", "whoboughtalsobought", "accessories", "similars", "showtogether", "suggestions"];
15
+ export declare const FACET_CROSS_SELLING_MAP: {
16
+ readonly buy: "whoboughtalsobought";
17
+ readonly view: "whosawalsosaw";
18
+ readonly similars: "similars";
19
+ readonly viewAndBought: "whosawalsobought";
20
+ readonly accessories: "accessories";
21
+ readonly suggestions: "suggestions";
22
+ };
23
+ export declare const SORT_OPTIONS: string[];
24
+ export declare const ObjectFitsDefault: readonly ["contain", "cover", "fill", "none"];
25
+ export declare const SEARCH_PAGE_DEFAULT_PAGINATION: {
26
+ nextPage: boolean;
27
+ previousPage: boolean;
28
+ startCursor: string;
29
+ endCursor: string;
30
+ count: number;
31
+ total: number;
32
+ };
@@ -0,0 +1,5 @@
1
+ import { FacetsContextProps, FacetsProviderProps } from '../../../types/contexts/contexts/search';
2
+
3
+ declare const FacetsProvider: ({ children, searchParams, forceUpdate, }: FacetsProviderProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const useFacetsContext: () => FacetsContextProps;
5
+ export { FacetsProvider, useFacetsContext };
@@ -0,0 +1,5 @@
1
+ import { ProductsContextProps, ProductsProviderProps } from '../../../types/contexts/contexts/search';
2
+
3
+ declare const ProductsProvider: ({ children, query, state, selectedFacets, forceUpdate, }: ProductsProviderProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const useProductsContext: () => ProductsContextProps;
5
+ export { ProductsProvider, useProductsContext };
@@ -0,0 +1,5 @@
1
+ import { RootContextProps, RootProviderProps } from '../../../types/contexts/contexts/search';
2
+
3
+ declare const RootProvider: ({ children, fetch }: RootProviderProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const useRootContext: () => RootContextProps;
5
+ export { RootProvider, useRootContext };
@@ -0,0 +1,5 @@
1
+ import { SearchProviderProps, SearchContextProps } from '../../../types/contexts/contexts/search';
2
+
3
+ declare const SearchProvider: ({ children, sort, state, count, collectionId, CONSTANTS }: SearchProviderProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const useSearchContext: () => SearchContextProps;
5
+ export { SearchProvider, useSearchContext };
@@ -0,0 +1,5 @@
1
+ import { SuggestedTermsContextProps, SuggestedTermsProviderProps } from '../../../types/contexts/contexts/search';
2
+
3
+ declare const SuggestedTermsProvider: ({ children, ...props }: SuggestedTermsProviderProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const useSuggestedTermsContext: () => SuggestedTermsContextProps;
5
+ export { SuggestedTermsProvider, useSuggestedTermsContext, };
@@ -0,0 +1,6 @@
1
+ import { TopSearchesContextProps } from '../../../types/contexts/contexts/search';
2
+ import { PropsWithChildren } from 'react';
3
+
4
+ declare const TopSearchesProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
5
+ declare const useTopSearches: () => TopSearchesContextProps;
6
+ export { TopSearchesProvider, useTopSearches };
@@ -74,6 +74,30 @@ export declare const contexts: {
74
74
  hook: () => import('../types/contexts/contexts/pdp').PDPDataContextProps;
75
75
  provider: ({ children, productData, isKit, PDP_INFO, NAME_SPLIT_SYMBOL }: import('../types/contexts/contexts/pdp').PDPDataProviderProps) => import("react/jsx-runtime").JSX.Element;
76
76
  };
77
+ searchFacets: {
78
+ hook: () => import('../types/contexts/contexts/search').FacetsContextProps;
79
+ provider: ({ children, searchParams, forceUpdate, }: import('../types/contexts/contexts/search').FacetsProviderProps) => import("react/jsx-runtime").JSX.Element;
80
+ };
81
+ searchProducts: {
82
+ hook: () => import('../types/contexts/contexts/search').ProductsContextProps;
83
+ provider: ({ children, query, state, selectedFacets, forceUpdate, }: import('../types/contexts/contexts/search').ProductsProviderProps) => import("react/jsx-runtime").JSX.Element;
84
+ };
85
+ searchRoot: {
86
+ hook: () => import('../types/contexts/contexts/search').RootContextProps;
87
+ provider: ({ children, fetch }: import('../types/contexts/contexts/search').RootProviderProps) => import("react/jsx-runtime").JSX.Element;
88
+ };
89
+ searchSearch: {
90
+ hook: () => import('../types/contexts/contexts/search').SearchContextProps;
91
+ provider: ({ children, sort, state, count, collectionId, CONSTANTS }: import('../types/contexts/contexts/search').SearchProviderProps) => import("react/jsx-runtime").JSX.Element;
92
+ };
93
+ searchSuggestedTerms: {
94
+ hook: () => import('../types/contexts/contexts/search').SuggestedTermsContextProps;
95
+ provider: ({ children, ...props }: import('../types/contexts/contexts/search').SuggestedTermsProviderProps) => import("react/jsx-runtime").JSX.Element;
96
+ };
97
+ searchTopSearchs: {
98
+ hook: () => import('../types/contexts/contexts/search').TopSearchesContextProps;
99
+ provider: ({ children }: import('react').PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
100
+ };
77
101
  ui: {
78
102
  hook: () => import('../types/contexts/contexts/cart').UIContextProps;
79
103
  provider: ({ children, ...props }: import('../types/contexts/contexts/cart').UIProviderProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { FetchOptions } from '../../types/data/api';
2
2
 
3
- export declare const fetchVtexOrderForm: (url: string, options?: FetchOptions) => Promise<Record<string, any>>;
4
3
  export declare const fetchVtex: (url: string, options?: FetchOptions) => Promise<any>;
4
+ export declare const fetchVtexOrderForm: (url: string, options?: FetchOptions) => Promise<Record<string, any>>;
5
+ export declare function fetchVtexWithAbortController<T>(url: string, options?: FetchOptions): Promise<T | undefined>;
@@ -0,0 +1,11 @@
1
+ import { FetchFunctionsProps } from '../../../../types/data/api';
2
+
3
+ import * as yup from 'yup';
4
+ declare const schema: yup.ObjectSchema<{
5
+ query: string | undefined;
6
+ }, yup.AnyObject, {
7
+ query: undefined;
8
+ }, "">;
9
+ type SchemaType = yup.InferType<typeof schema>;
10
+ export declare function getSearchAutoCompleteSuggestions({ apiUrl, body, fetchOptions }: FetchFunctionsProps<SchemaType>): Promise<any>;
11
+ export {};
@@ -0,0 +1,91 @@
1
+ import { FetchFunctionsProps } from '../../../../types/data/api';
2
+ import * as yup from 'yup';
3
+ declare const schema: yup.ArraySchema<{
4
+ value: string;
5
+ key: string;
6
+ }[], yup.AnyObject, "", "">;
7
+ type SchemaType = yup.InferType<typeof schema>;
8
+ export declare function getSearchCrossellingProducts({ apiUrl, body, fetchOptions }: FetchFunctionsProps<SchemaType>): Promise<{
9
+ node: {
10
+ sku: any;
11
+ gtin: any;
12
+ name: any;
13
+ description: any;
14
+ releaseDate: any;
15
+ slug: any;
16
+ video: any;
17
+ categories: any;
18
+ categoriesIds: any;
19
+ collection: any;
20
+ collectionId: any;
21
+ id: any;
22
+ brand: {
23
+ name: any;
24
+ brandName: any;
25
+ };
26
+ seo: {
27
+ description: any;
28
+ title: any;
29
+ canonical: string;
30
+ };
31
+ cluster: {
32
+ generals: any;
33
+ highlights: never[];
34
+ };
35
+ availability: {
36
+ status: boolean;
37
+ };
38
+ breadcrumbList: {
39
+ itemListElement: any[];
40
+ numberOfItems: any;
41
+ };
42
+ image: {
43
+ alternateName: string;
44
+ url: string;
45
+ keywords: string;
46
+ }[];
47
+ offers: {
48
+ lowPrice: number;
49
+ highPrice: number;
50
+ offers: {
51
+ availability: boolean;
52
+ listPrice: number;
53
+ price: number;
54
+ priceValidUntil: string;
55
+ priceCurrency: string;
56
+ installments: import('../../../../types/global/product').InstallmentType[];
57
+ lowPrice: number;
58
+ quantity: number;
59
+ seller: {
60
+ identifier: string;
61
+ };
62
+ }[];
63
+ };
64
+ additionalProperty: ({
65
+ name: string;
66
+ value: Record<string, string>;
67
+ valueReference: "ATTACHMENT";
68
+ } | {
69
+ propertyID: string;
70
+ name: string;
71
+ value: string;
72
+ valueReference: {
73
+ valueReference: "ATTRIBUTE";
74
+ visible: boolean;
75
+ };
76
+ } | {
77
+ name: string;
78
+ value: string;
79
+ valueReference: "SPECIFICATION";
80
+ })[];
81
+ isVariantOf: {
82
+ productGroupID: any;
83
+ hasVariant: any;
84
+ };
85
+ installments: {
86
+ count: number;
87
+ value: number;
88
+ };
89
+ };
90
+ }[] | undefined>;
91
+ export {};
@@ -0,0 +1,4 @@
1
+ import { FetchFunctionsProps } from '../../../../types/data/api';
2
+ import { GetSearchFacetsResponse } from '../../../../types/data/api/search';
3
+
4
+ export declare function getSearchFacets({ body, extraData, ...props }: FetchFunctionsProps<any>): GetSearchFacetsResponse;
@@ -0,0 +1,6 @@
1
+ export * from './autoCompleteSuggestions';
2
+ export * from './crosseling';
3
+ export * from './product';
4
+ export * from './facets';
5
+ export * from './suggestedTerms';
6
+ export * from './topSearch';
@@ -0,0 +1,3 @@
1
+ import { FetchFunctionsProps } from '../../../../types/data/api';
2
+
3
+ export declare function getSearchProducts({ body, extraData, ...props }: FetchFunctionsProps<any>): Promise<any>;
@@ -0,0 +1,3 @@
1
+ import { SearchAPIProps } from '../../../types/data/api/search';
2
+
3
+ export declare const search: ({ apiUrl, body, fetchOptions, extraData }: SearchAPIProps) => Promise<unknown> | undefined;
@@ -0,0 +1,12 @@
1
+ import { FetchFunctionsProps } from '../../../../types/data/api';
2
+ import * as yup from 'yup';
3
+ declare const schema: yup.ObjectSchema<{
4
+ query: string | undefined;
5
+ locale: string | undefined;
6
+ }, yup.AnyObject, {
7
+ query: undefined;
8
+ locale: undefined;
9
+ }, "">;
10
+ type SchemaType = yup.InferType<typeof schema>;
11
+ export declare function getSearchSuggestedTerms({ apiUrl, body, fetchOptions }: FetchFunctionsProps<SchemaType>): Promise<any>;
12
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare function getSearchTopSearchs({ apiUrl }: {
2
+ apiUrl: string;
3
+ }): Promise<any>;
@@ -0,0 +1,48 @@
1
+ import { Facet, FacetSearchResult, FacetValueBoolean, FacetValueRange, FuzzyFacet, OperatorFacet, SelectedFacet } from '../../../types/data/api/search/facets';
2
+ import { Channel, StoreSelectedFacet } from '../../../types/data/api/search';
3
+ import { CrossSellingFacet } from '../../../types/constants';
4
+
5
+ export declare const isRootFacet: (facetKey: string, isDepartment: boolean) => boolean;
6
+ export declare const isOperatorFacet: (facet: SelectedFacet) => facet is OperatorFacet;
7
+ export declare const isFacetBoolean: (facet: Facet) => facet is Facet<FacetValueBoolean>;
8
+ export declare const isCrossSelling: (x: string) => x is CrossSellingFacet["key"];
9
+ export declare const findCrossSelling: (facets?: SelectedFacet[]) => CrossSellingFacet | null;
10
+ export declare const findSlug: (facets?: SelectedFacet[]) => string | null;
11
+ export declare const findSkuId: (facets?: SelectedFacet[]) => string | null;
12
+ export declare const findLocale: (facets?: SelectedFacet[]) => string | null;
13
+ export declare const findChannel: (facets?: SelectedFacet[]) => string | null;
14
+ export declare const isFuzzyFacet: (facet: SelectedFacet) => facet is FuzzyFacet;
15
+ export declare const facetBoolean: (item: Facet<FacetValueBoolean>) => {
16
+ __typename: string;
17
+ key: string;
18
+ label: string;
19
+ values: FacetValueBoolean[];
20
+ };
21
+ export declare const facetRange: ({ key, values }: Facet<FacetValueRange>) => {
22
+ __typename: string;
23
+ key: string;
24
+ values: FacetValueRange[];
25
+ };
26
+ export declare const formattedFacets: (data: FacetSearchResult, selectedFacets: SelectedFacet[], isCollectionPage?: any) => ({
27
+ __typename: string;
28
+ key: string;
29
+ label: string;
30
+ values: FacetValueBoolean[];
31
+ } | {
32
+ __typename: string;
33
+ key: string;
34
+ values: FacetValueRange[];
35
+ })[];
36
+ export declare const addSearchParamsFacets: (facets: SelectedFacet[], params: URLSearchParams) => void;
37
+ export declare const selectedFacets: (facets: string[]) => {
38
+ key: string;
39
+ value: string;
40
+ }[];
41
+ export declare const filterRootFacets: (selectedFacets: SelectedFacet[]) => SelectedFacet[];
42
+ export declare const filterNonRootFacets: (selectedFacets: SelectedFacet[], base?: string | null) => {
43
+ value: string;
44
+ key: string;
45
+ }[];
46
+ export declare const addDefaultFacets: (facets: SelectedFacet[], channel: Channel, policy?: string, region?: string) => SelectedFacet[];
47
+ export declare const getRegionFacet: (channel: Channel, region?: string) => StoreSelectedFacet | null;
48
+ export declare const getPolicyFacet: (channel: Channel, key?: string) => StoreSelectedFacet | null;
@@ -0,0 +1,12 @@
1
+ declare const searchHelpers: {
2
+ parseSearchState: ({ pathname, searchParams }: URL, facets: string[]) => import('../../../types/data/api/search').State;
3
+ convertSearchParams: (searchParams: {
4
+ [key: string]: string | string[] | undefined;
5
+ }) => URLSearchParams;
6
+ filterNonRootFacets: (selectedFacets: import('../../../types/data/api/search/facets').SelectedFacet[], base?: string | null) => {
7
+ value: string;
8
+ key: string;
9
+ }[];
10
+ filterNonCategorySelected: (facets: import('../../../types/data/api/search/facets').Facet[], base?: string | null) => import('../../../types/data/api/search/facets').Facet<import('../../../types/data/api/search/facets').FacetValueBoolean | import('../../../types/data/api/search/facets').FacetValueRange>[];
11
+ };
12
+ export default searchHelpers;