@shoppexio/storefront 0.3.8 → 0.3.9
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/__tests__/search.test.d.ts +2 -0
- package/dist/__tests__/search.test.d.ts.map +1 -0
- package/dist/__tests__/storefront-stock.test.d.ts +2 -0
- package/dist/__tests__/storefront-stock.test.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- 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-stock.d.ts +10 -0
- package/dist/utils/storefront-stock.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Product, PriceVariant, ProductVariant } from '../types/index.js';
|
|
2
|
+
type VariantLike = Pick<ProductVariant, 'stock'> | Pick<PriceVariant, 'stock'>;
|
|
3
|
+
type ProductLike = Pick<Product, 'type' | 'stock' | 'price_variants' | 'variants'>;
|
|
4
|
+
export declare function resolveDisplayStock(product: ProductLike | null | undefined): number;
|
|
5
|
+
export declare function isProductOutOfStock(product: ProductLike | null | undefined): boolean;
|
|
6
|
+
export declare function isProductInStock(product: ProductLike | null | undefined): boolean;
|
|
7
|
+
export declare function isVariantOutOfStock(variant: VariantLike | null | undefined): boolean;
|
|
8
|
+
export declare function resolveVariantStockValue(variant: VariantLike | null | undefined): number;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=storefront-stock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storefront-stock.d.ts","sourceRoot":"","sources":["../../src/utils/storefront-stock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE/E,KAAK,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAE/E,KAAK,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,gBAAgB,GAAG,UAAU,CAAC,CAAC;AAyBnF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAqBnF;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEpF;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEjF;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEpF;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAExF"}
|