@shoppexio/storefront 0.3.12 → 0.3.14
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.
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/modules/products.d.ts.map +1 -1
- package/dist/modules/search.d.ts +4 -0
- package/dist/modules/search.d.ts.map +1 -1
- package/dist/shoppex.esm.js +2 -2
- package/dist/shoppex.esm.js.map +1 -1
- package/dist/shoppex.umd.js +1 -1
- package/dist/shoppex.umd.js.map +1 -1
- package/dist/utils/storefront-catalog.d.ts +4 -0
- package/dist/utils/storefront-catalog.d.ts.map +1 -0
- package/dist/utils/storefront-search.d.ts +21 -0
- package/dist/utils/storefront-search.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Product, ProductGroup } from '../types/index.js';
|
|
2
|
+
export declare function getStorefrontGroupProducts(group: ProductGroup): Product[];
|
|
3
|
+
export declare function getMergedStorefrontProducts(products?: Product[], groups?: ProductGroup[]): Product[];
|
|
4
|
+
//# sourceMappingURL=storefront-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storefront-catalog.d.ts","sourceRoot":"","sources":["../../src/utils/storefront-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAM/D,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,EAAE,CAMzE;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,GAAE,OAAO,EAAO,EACxB,MAAM,GAAE,YAAY,EAAO,GAC1B,OAAO,EAAE,CAkBX"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Product, ProductGroup } from '../types/index.js';
|
|
2
|
+
export interface StorefrontSearchFilterOptions {
|
|
3
|
+
hideOutOfStock?: boolean;
|
|
4
|
+
maxResults?: number;
|
|
5
|
+
}
|
|
6
|
+
export type StorefrontCatalogSearchItem = {
|
|
7
|
+
type: 'product';
|
|
8
|
+
product: Product;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'group';
|
|
11
|
+
group: ProductGroup;
|
|
12
|
+
};
|
|
13
|
+
export declare function stripHtmlFromText(value: string | null | undefined): string;
|
|
14
|
+
export declare function normalizeSearchQuery(query: string): string;
|
|
15
|
+
export declare function collectProductSearchHaystack(product: Product): string[];
|
|
16
|
+
export declare function productMatchesSearchQuery(product: Product, query: string): boolean;
|
|
17
|
+
export declare function groupMatchesSearchQuery(group: ProductGroup, query: string): boolean;
|
|
18
|
+
export declare function filterProductsBySearchQuery(products: Product[], query: string, options?: StorefrontSearchFilterOptions): Product[];
|
|
19
|
+
export declare function searchMergedStorefrontCatalogItems(products: Product[], groups: ProductGroup[], query: string, options?: StorefrontSearchFilterOptions): StorefrontCatalogSearchItem[];
|
|
20
|
+
export declare function searchMergedStorefrontCatalog(products: Product[], groups: ProductGroup[], query: string, options?: StorefrontSearchFilterOptions): Product[];
|
|
21
|
+
//# sourceMappingURL=storefront-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storefront-search.d.ts","sourceRoot":"","sources":["../../src/utils/storefront-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAI/D,MAAM,WAAW,6BAA6B;IAC5C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,2BAA2B,GACnC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,CAAC;AAE3C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GA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