@scayle/storefront-nuxt 7.74.0 → 7.75.1

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 (72) hide show
  1. package/CHANGELOG.md +50 -1
  2. package/dist/index.d.mts +12 -2
  3. package/dist/index.d.ts +12 -2
  4. package/dist/index.mjs +15 -0
  5. package/dist/module.d.mts +2 -2
  6. package/dist/module.d.ts +2 -2
  7. package/dist/module.json +1 -1
  8. package/dist/module.mjs +32 -1
  9. package/dist/rpc.d.mts +1 -1
  10. package/dist/rpc.d.ts +1 -1
  11. package/dist/runtime/composables/core/useIDP.d.ts +5 -5
  12. package/dist/runtime/composables/core/useIDP.mjs +2 -2
  13. package/dist/runtime/composables/core/useRpc.d.ts +38 -9
  14. package/dist/runtime/composables/core/useRpc.mjs +29 -49
  15. package/dist/runtime/composables/core/useUser.d.ts +21 -6
  16. package/dist/runtime/composables/core/useUser.mjs +26 -10
  17. package/dist/runtime/composables/storefront/useBasket.d.ts +69 -8
  18. package/dist/runtime/composables/storefront/useBasket.mjs +16 -18
  19. package/dist/runtime/composables/storefront/useBrand.d.ts +4 -9
  20. package/dist/runtime/composables/storefront/useBrand.mjs +5 -12
  21. package/dist/runtime/composables/storefront/useBrands.d.ts +4 -9
  22. package/dist/runtime/composables/storefront/useBrands.mjs +5 -12
  23. package/dist/runtime/composables/storefront/useCategories.d.ts +23 -13
  24. package/dist/runtime/composables/storefront/useCategories.mjs +8 -12
  25. package/dist/runtime/composables/storefront/useCategoryById.d.ts +4 -9
  26. package/dist/runtime/composables/storefront/useCategoryById.mjs +5 -12
  27. package/dist/runtime/composables/storefront/useCategoryByPath.d.ts +4 -9
  28. package/dist/runtime/composables/storefront/useCategoryByPath.mjs +5 -12
  29. package/dist/runtime/composables/storefront/useCurrentPromotions.d.ts +4 -9
  30. package/dist/runtime/composables/storefront/useCurrentPromotions.mjs +5 -12
  31. package/dist/runtime/composables/storefront/useFacet.d.ts +60 -15
  32. package/dist/runtime/composables/storefront/useFacet.mjs +117 -110
  33. package/dist/runtime/composables/storefront/useFilters.d.ts +4 -12
  34. package/dist/runtime/composables/storefront/useFilters.mjs +5 -12
  35. package/dist/runtime/composables/storefront/useNavigationTree.d.ts +4 -9
  36. package/dist/runtime/composables/storefront/useNavigationTree.mjs +5 -12
  37. package/dist/runtime/composables/storefront/useNavigationTrees.d.ts +4 -9
  38. package/dist/runtime/composables/storefront/useNavigationTrees.mjs +5 -12
  39. package/dist/runtime/composables/storefront/useOrder.d.ts +6 -5
  40. package/dist/runtime/composables/storefront/useOrder.mjs +2 -2
  41. package/dist/runtime/composables/storefront/useOrderConfirmation.d.ts +6 -5
  42. package/dist/runtime/composables/storefront/useOrderConfirmation.mjs +2 -2
  43. package/dist/runtime/composables/storefront/useProduct.d.ts +4 -9
  44. package/dist/runtime/composables/storefront/useProduct.mjs +5 -12
  45. package/dist/runtime/composables/storefront/useProducts.d.ts +4 -21
  46. package/dist/runtime/composables/storefront/useProducts.mjs +5 -12
  47. package/dist/runtime/composables/storefront/useProductsByIds.d.ts +4 -9
  48. package/dist/runtime/composables/storefront/useProductsByIds.mjs +5 -12
  49. package/dist/runtime/composables/storefront/useProductsByReferenceKeys.d.ts +4 -9
  50. package/dist/runtime/composables/storefront/useProductsByReferenceKeys.mjs +5 -12
  51. package/dist/runtime/composables/storefront/useProductsCount.d.ts +4 -11
  52. package/dist/runtime/composables/storefront/useProductsCount.mjs +5 -12
  53. package/dist/runtime/composables/storefront/usePromotions.d.ts +4 -9
  54. package/dist/runtime/composables/storefront/usePromotions.mjs +5 -12
  55. package/dist/runtime/composables/storefront/usePromotionsByIds.d.ts +4 -9
  56. package/dist/runtime/composables/storefront/usePromotionsByIds.mjs +5 -12
  57. package/dist/runtime/composables/storefront/useShopConfiguration.d.ts +4 -9
  58. package/dist/runtime/composables/storefront/useShopConfiguration.mjs +5 -12
  59. package/dist/runtime/composables/storefront/useUserAddresses.d.ts +4 -9
  60. package/dist/runtime/composables/storefront/useUserAddresses.mjs +5 -12
  61. package/dist/runtime/composables/storefront/useVariant.d.ts +4 -9
  62. package/dist/runtime/composables/storefront/useVariant.mjs +5 -12
  63. package/dist/runtime/composables/storefront/useWishlist.d.ts +42 -4
  64. package/dist/runtime/composables/storefront/useWishlist.mjs +17 -14
  65. package/dist/runtime/log.mjs +1 -1
  66. package/dist/runtime/utils/promise.d.ts +9 -0
  67. package/dist/runtime/utils/promise.mjs +12 -0
  68. package/dist/runtime/utils/zodSchema.d.ts +22 -22
  69. package/dist/runtime/utils/zodSchema.mjs +4 -4
  70. package/dist/shared/{storefront-nuxt.db7a2f93.d.mts → storefront-nuxt.257df9a6.d.mts} +8 -8
  71. package/dist/shared/{storefront-nuxt.db7a2f93.d.ts → storefront-nuxt.257df9a6.d.ts} +8 -8
  72. package/package.json +2 -2
@@ -6,37 +6,35 @@ import {
6
6
  HttpStatusCode,
7
7
  HttpStatusMessage
8
8
  } from "@scayle/storefront-core";
9
- import { useNuxtApp, useAsyncData } from "nuxt/app";
9
+ import { useNuxtApp } from "nuxt/app";
10
10
  import { computed } from "vue";
11
11
  import { rpcCall } from "../../rpc/rpcCall.mjs";
12
+ import { extendPromise } from "../../utils/promise.mjs";
13
+ import { useRpc } from "../core/useRpc.mjs";
12
14
  import { useCurrentShop } from "../core/useCurrentShop.mjs";
13
15
  import { toValue, toRef } from "#imports";
14
- export async function useBasket({
16
+ export function useBasket({
15
17
  params,
16
18
  key = "useBasket"
17
19
  } = {}) {
18
20
  const nuxtApp = useNuxtApp();
19
21
  const shop = useCurrentShop();
22
+ const asyncData = useRpc("getBasket", key, params, {
23
+ server: false,
24
+ // TODO: In some cases it might be ok to fetch on server
25
+ watch: [toRef(params)],
26
+ dedupe: "defer",
27
+ getCachedData: (key2) => {
28
+ return toValue(nuxtApp._asyncData[key2]?.data) ?? void 0;
29
+ }
30
+ });
20
31
  const {
21
32
  data,
22
33
  pending: fetching,
23
34
  error,
24
35
  refresh: fetch,
25
36
  status
26
- } = await useAsyncData(
27
- key,
28
- () => rpcCall(nuxtApp, "getBasket", toValue(shop))(toValue(params)),
29
- {
30
- server: false,
31
- // TODO: In some cases it might be ok to fetch on server
32
- watch: [toRef(params)],
33
- dedupe: "defer",
34
- getCachedData: (key2) => {
35
- return toValue(nuxtApp._asyncData[key2]?.data) ?? void 0;
36
- },
37
- default: () => void 0
38
- }
39
- );
37
+ } = asyncData;
40
38
  const addItem = async ({
41
39
  variantId,
42
40
  promotionId,
@@ -134,7 +132,7 @@ export async function useBasket({
134
132
  const shippingDates = computed(
135
133
  () => packages.value ? getShippingDates(packages.value) : void 0
136
134
  );
137
- return {
135
+ return extendPromise(asyncData, {
138
136
  data,
139
137
  items,
140
138
  cost,
@@ -157,5 +155,5 @@ export async function useBasket({
157
155
  mergeBaskets,
158
156
  error,
159
157
  status
160
- };
158
+ });
161
159
  }
@@ -1,16 +1,11 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { RpcOptions } from '../core/useRpc';
2
+ import type { UseRpcOptions, UseRpcReturn } from '../core/useRpc';
3
3
  import type { MaybeRefOrGetter } from '#imports';
4
4
  type Options = Partial<{
5
5
  params: MaybeRefOrGetter<RpcMethodParameters<'getBrandById'>>;
6
- options: RpcOptions;
6
+ options: UseRpcOptions<'getBrandById'>;
7
+ /** @deprecated use the second argument of the composable to define the key */
7
8
  key: string;
8
9
  }>;
9
- export declare function useBrand({ params, options, key, }?: Options): Promise<{
10
- data: import("vue").Ref<import("@scayle/storefront-api").Brand | undefined>;
11
- fetching: import("vue").Ref<boolean>;
12
- fetch: () => Promise<void>;
13
- error: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | undefined>;
14
- status: import("vue").Ref<import("../core/useRpc").Status>;
15
- }>;
10
+ export declare function useBrand({ params, options, key: _key, }?: Options, key?: string): UseRpcReturn<'getBrandById'>;
16
11
  export {};
@@ -1,20 +1,13 @@
1
1
  import { useRpc } from "../core/useRpc.mjs";
2
- export async function useBrand({
2
+ export function useBrand({
3
3
  params,
4
4
  options,
5
- key = "useBrand"
6
- } = {}) {
7
- const { data, fetching, fetch, error, status } = await useRpc(
5
+ key: _key
6
+ } = {}, key) {
7
+ return useRpc(
8
8
  "getBrandById",
9
- key,
9
+ _key ?? key ?? "useBrand",
10
10
  params,
11
11
  options
12
12
  );
13
- return {
14
- data,
15
- fetching,
16
- fetch,
17
- error,
18
- status
19
- };
20
13
  }
@@ -1,16 +1,11 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { RpcOptions } from '../core/useRpc';
2
+ import type { UseRpcOptions, UseRpcReturn } from '../core/useRpc';
3
3
  import type { MaybeRefOrGetter } from '#imports';
4
4
  type Options = Partial<{
5
5
  params: MaybeRefOrGetter<RpcMethodParameters<'getBrands'>>;
6
- options: RpcOptions;
6
+ options: UseRpcOptions<'getBrands'>;
7
+ /** @deprecated use the second argument of the composable to define the key */
7
8
  key: string;
8
9
  }>;
9
- export declare function useBrands({ params, options, key, }?: Options): Promise<{
10
- data: import("vue").Ref<import("@scayle/storefront-api").BrandsEndpointResponseData | undefined>;
11
- fetching: import("vue").Ref<boolean>;
12
- fetch: () => Promise<void>;
13
- error: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | undefined>;
14
- status: import("vue").Ref<import("../core/useRpc").Status>;
15
- }>;
10
+ export declare function useBrands({ params, options, key: _key, }?: Options, key?: string): UseRpcReturn<'getBrands'>;
16
11
  export {};
@@ -1,20 +1,13 @@
1
1
  import { useRpc } from "../core/useRpc.mjs";
2
- export async function useBrands({
2
+ export function useBrands({
3
3
  params,
4
4
  options,
5
- key = "useBrands"
6
- } = {}) {
7
- const { data, fetching, fetch, error, status } = await useRpc(
5
+ key: _key
6
+ } = {}, key) {
7
+ return useRpc(
8
8
  "getBrands",
9
- key,
9
+ _key ?? key ?? "useBrand",
10
10
  params,
11
11
  options
12
12
  );
13
- return {
14
- data,
15
- fetching,
16
- fetch,
17
- error,
18
- status
19
- };
20
13
  }
@@ -1,23 +1,33 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { RpcOptions } from '../core/useRpc';
2
+ import type { UseRpcOptions } from '../core/useRpc';
3
3
  import type { MaybeRefOrGetter } from '#imports';
4
4
  type Options = Partial<{
5
5
  params: MaybeRefOrGetter<RpcMethodParameters<'getCategoriesByPath'>>;
6
- options: RpcOptions;
6
+ options: UseRpcOptions<'getCategoriesByPath'>;
7
+ /** @deprecated use the second argument of the composable to define the key */
7
8
  key: string;
8
9
  }>;
9
- export declare function useCategories({ params, options, key, }?: Options): Promise<{
10
- data: import("vue").Ref<{
11
- categories: import("@scayle/storefront-api").Category[];
12
- activeNode: undefined;
13
- } | {
14
- categories: import("@scayle/storefront-api").Category;
15
- activeNode: import("@scayle/storefront-api").Category;
16
- } | undefined>;
10
+ export declare function useCategories({ params, options, key: _key, }?: Options, key?: string): import("nuxt/dist/app/composables/asyncData")._AsyncData<{
11
+ categories: import("@scayle/storefront-api").Category[];
12
+ activeNode: undefined;
13
+ } | {
14
+ categories: import("@scayle/storefront-api").Category;
15
+ activeNode: import("@scayle/storefront-api").Category;
16
+ }, import("nuxt/app").NuxtError<unknown> | null> & {
17
17
  fetching: import("vue").Ref<boolean>;
18
- fetch: () => Promise<void>;
19
- error: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | undefined>;
20
- status: import("vue").Ref<import("../core/useRpc").Status>;
18
+ fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions | undefined) => Promise<void>;
19
+ } & {
20
+ getCategoryById: (id: number, includeHidden?: true) => Promise<import("@scayle/storefront-api").Category>;
21
+ } & Promise<import("nuxt/dist/app/composables/asyncData")._AsyncData<{
22
+ categories: import("@scayle/storefront-api").Category[];
23
+ activeNode: undefined;
24
+ } | {
25
+ categories: import("@scayle/storefront-api").Category;
26
+ activeNode: import("@scayle/storefront-api").Category;
27
+ }, import("nuxt/app").NuxtError<unknown> | null> & {
28
+ fetching: import("vue").Ref<boolean>;
29
+ fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions | undefined) => Promise<void>;
30
+ } & {
21
31
  getCategoryById: (id: number, includeHidden?: true) => Promise<import("@scayle/storefront-api").Category>;
22
32
  }>;
23
33
  export {};
@@ -2,16 +2,17 @@ import { useNuxtApp } from "nuxt/app";
2
2
  import { useRpc } from "../core/useRpc.mjs";
3
3
  import { useCurrentShop } from "../core/useCurrentShop.mjs";
4
4
  import { rpcCall } from "../../rpc/rpcCall.mjs";
5
- export async function useCategories({
5
+ import { extendPromise } from "../../utils/promise.mjs";
6
+ export function useCategories({
6
7
  params,
7
8
  options,
8
- key = "useCategories"
9
- } = {}) {
9
+ key: _key
10
+ } = {}, key) {
10
11
  const currentShop = useCurrentShop();
11
12
  const nuxtApp = useNuxtApp();
12
- const { data, fetching, fetch, error, status } = await useRpc(
13
+ const useRpcPromise = useRpc(
13
14
  "getCategoriesByPath",
14
- key,
15
+ _key ?? key ?? "useCategories",
15
16
  params,
16
17
  options
17
18
  );
@@ -20,12 +21,7 @@ export async function useCategories({
20
21
  "getCategoryById",
21
22
  currentShop.value ?? void 0
22
23
  );
23
- return {
24
- data,
25
- fetching,
26
- fetch,
27
- error,
28
- status,
24
+ return extendPromise(useRpcPromise, {
29
25
  getCategoryById: (id, includeHidden) => getCategoryById({ id, includeHidden })
30
- };
26
+ });
31
27
  }
@@ -1,16 +1,11 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { RpcOptions } from '../core/useRpc';
2
+ import type { UseRpcOptions, UseRpcReturn } from '../core/useRpc';
3
3
  import type { MaybeRefOrGetter } from '#imports';
4
4
  type Options = Partial<{
5
5
  params: MaybeRefOrGetter<RpcMethodParameters<'getCategoryById'>>;
6
- options: RpcOptions;
6
+ options: UseRpcOptions<'getCategoryById'>;
7
+ /** @deprecated use the second argument of the composable to define the key */
7
8
  key: string;
8
9
  }>;
9
- export declare function useCategoryById({ params, options, key, }?: Options): Promise<{
10
- data: import("vue").Ref<import("@scayle/storefront-api").Category | undefined>;
11
- fetching: import("vue").Ref<boolean>;
12
- fetch: () => Promise<void>;
13
- error: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | undefined>;
14
- status: import("vue").Ref<import("../core/useRpc").Status>;
15
- }>;
10
+ export declare function useCategoryById({ params, options, key: _key, }?: Options, key?: string): UseRpcReturn<'getCategoryById'>;
16
11
  export {};
@@ -1,20 +1,13 @@
1
1
  import { useRpc } from "../core/useRpc.mjs";
2
- export async function useCategoryById({
2
+ export function useCategoryById({
3
3
  params,
4
4
  options,
5
- key = "useCategoryById"
6
- } = {}) {
7
- const { data, fetching, fetch, error, status } = await useRpc(
5
+ key: _key
6
+ } = {}, key) {
7
+ return useRpc(
8
8
  "getCategoryById",
9
- key,
9
+ _key ?? key ?? "useCategoryById",
10
10
  params,
11
11
  options
12
12
  );
13
- return {
14
- data,
15
- fetching,
16
- fetch,
17
- error,
18
- status
19
- };
20
13
  }
@@ -1,16 +1,11 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { RpcOptions } from '../core/useRpc';
2
+ import type { UseRpcOptions, UseRpcReturn } from '../core/useRpc';
3
3
  import type { MaybeRefOrGetter } from '#imports';
4
4
  type Options = {
5
5
  params: MaybeRefOrGetter<RpcMethodParameters<'getCategoryByPath'>>;
6
- options?: RpcOptions;
6
+ options?: UseRpcOptions<'getCategoryByPath'>;
7
+ /** @deprecated use the second argument of the composable to define the key */
7
8
  key: string;
8
9
  };
9
- export declare function useCategoryByPath({ params, options, key, }: Options): Promise<{
10
- data: import("vue").Ref<import("@scayle/storefront-api").Category | undefined>;
11
- fetching: import("vue").Ref<boolean>;
12
- fetch: () => Promise<void>;
13
- error: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | undefined>;
14
- status: import("vue").Ref<import("../core/useRpc").Status>;
15
- }>;
10
+ export declare function useCategoryByPath({ params, options, key: _key, }: Options, key?: string): UseRpcReturn<'getCategoryByPath'>;
16
11
  export {};
@@ -1,20 +1,13 @@
1
1
  import { useRpc } from "../core/useRpc.mjs";
2
- export async function useCategoryByPath({
2
+ export function useCategoryByPath({
3
3
  params,
4
4
  options,
5
- key = "useCategoryByPath"
6
- }) {
7
- const { data, fetching, fetch, error, status } = await useRpc(
5
+ key: _key
6
+ }, key) {
7
+ return useRpc(
8
8
  "getCategoryByPath",
9
- key,
9
+ _key ?? key ?? "useCategoryByPath",
10
10
  params,
11
11
  options
12
12
  );
13
- return {
14
- data,
15
- fetching,
16
- fetch,
17
- error,
18
- status
19
- };
20
13
  }
@@ -1,16 +1,11 @@
1
1
  import { type RpcMethodParameters } from '@scayle/storefront-core';
2
- import { type RpcOptions } from '../core/useRpc';
2
+ import { type UseRpcOptions, type UseRpcReturn } from '../core/useRpc';
3
3
  import { type MaybeRefOrGetter } from '#imports';
4
4
  type Options = Partial<{
5
5
  params: MaybeRefOrGetter<RpcMethodParameters<'getCurrentPromotions'>>;
6
- options: RpcOptions;
6
+ options: UseRpcOptions<'getCurrentPromotions'>;
7
+ /** @deprecated use the second argument of the composable to define the key */
7
8
  key: string;
8
9
  }>;
9
- export declare function useCurrentPromotions({ params, options, key, }?: Options): Promise<{
10
- data: import("vue").Ref<import("@scayle/storefront-api").PromotionsEndpointResponseData | undefined>;
11
- fetching: import("vue").Ref<boolean>;
12
- fetch: () => Promise<void>;
13
- error: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | undefined>;
14
- status: import("vue").Ref<import("../core/useRpc").Status>;
15
- }>;
10
+ export declare function useCurrentPromotions({ params, options, key: _key, }?: Options, key?: string): UseRpcReturn<'getCurrentPromotions'>;
16
11
  export {};
@@ -1,20 +1,13 @@
1
1
  import { useRpc } from "../core/useRpc.mjs";
2
- export async function useCurrentPromotions({
2
+ export function useCurrentPromotions({
3
3
  params,
4
4
  options,
5
- key = "useCurrentPromotions"
6
- } = {}) {
7
- const { data, fetching, fetch, error, status } = await useRpc(
5
+ key: _key
6
+ } = {}, key) {
7
+ return useRpc(
8
8
  "getCurrentPromotions",
9
- key,
9
+ _key ?? key ?? "useCurrentPromotions",
10
10
  params,
11
11
  options
12
12
  );
13
- return {
14
- data,
15
- fetching,
16
- fetch,
17
- error,
18
- status
19
- };
20
13
  }
@@ -11,22 +11,23 @@ type FacetParams = Partial<{
11
11
  };
12
12
  type Options = Partial<{
13
13
  params: FacetParams;
14
+ /** @deprecated use the second argument of the composable to define the key */
14
15
  key: string;
15
16
  }>;
16
- export declare function useFacet({ key, params, }?: Options): Promise<{
17
- filters: import("vue").ComputedRef<import("@scayle/storefront-api").FiltersEndpointResponseData | undefined>;
17
+ export declare function useFacet({ key: optionsKey, params, }?: Options, _key?: string): {
18
+ filters: import("vue").ComputedRef<import("@scayle/storefront-api").FiltersEndpointResponseData>;
18
19
  filtersFetching: import("vue").Ref<boolean>;
19
- unfilteredCount: import("vue").ComputedRef<number | undefined>;
20
- filterStatus: import("vue").Ref<import("..").Status>;
21
- filterError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | undefined>;
20
+ unfilteredCount: import("vue").ComputedRef<number>;
21
+ filterStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
22
+ filterError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null>;
22
23
  productCountData: import("vue").Ref<{
23
24
  count: number;
24
- } | undefined>;
25
+ }>;
25
26
  refreshProductCount: ({ where, }?: FilterParams) => Promise<void>;
26
27
  productCountFetching: import("vue").Ref<boolean>;
27
- productCountError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | undefined>;
28
- productCountStatus: import("vue").Ref<import("..").Status>;
29
- products: import("vue").ComputedRef<import("@scayle/storefront-api").Product[] | undefined>;
28
+ productCountError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null>;
29
+ productCountStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
30
+ products: import("vue").ComputedRef<import("@scayle/storefront-api").Product[]>;
30
31
  pagination: import("vue").ComputedRef<{
31
32
  current: number;
32
33
  total: number;
@@ -36,16 +37,60 @@ export declare function useFacet({ key, params, }?: Options): Promise<{
36
37
  prev: number;
37
38
  next: number;
38
39
  last: number;
39
- } | undefined>;
40
+ }>;
40
41
  productsFetching: import("vue").Ref<boolean>;
41
42
  filterProducts: ({ where, page, sort, orFiltersOperator, }: FilterParams) => Promise<void>;
42
- productError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | undefined>;
43
- productStatus: import("vue").Ref<import("..").Status>;
44
- categories: import("vue").ComputedRef<import("@scayle/storefront-api").Category | import("@scayle/storefront-api").Category[] | undefined>;
43
+ productError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null>;
44
+ productStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
45
+ categories: import("vue").ComputedRef<import("@scayle/storefront-api").Category | import("@scayle/storefront-api").Category[]>;
45
46
  selectedCategory: import("vue").ComputedRef<import("@scayle/storefront-api").Category | undefined>;
46
47
  categoriesFetching: import("vue").Ref<boolean>;
47
- categoriesError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | undefined>;
48
- categoriesStatus: import("vue").Ref<import("..").Status>;
48
+ categoriesError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null>;
49
+ categoriesStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
50
+ fetchProducts: ({ path, page, perPage, where, sort, pricePromotionKey, cache, orFiltersOperator, }: FilterParams & {
51
+ path: string;
52
+ pricePromotionKey?: string | undefined;
53
+ cache?: Partial<{
54
+ ttl: number;
55
+ cacheKey: string;
56
+ cacheKeyPrefix: string;
57
+ timeout: number;
58
+ }> | undefined;
59
+ }) => Promise<true | undefined>;
60
+ fetchPage: (pageToFetch: number) => Promise<void>;
61
+ } & Promise<{
62
+ filters: import("vue").ComputedRef<import("@scayle/storefront-api").FiltersEndpointResponseData>;
63
+ filtersFetching: import("vue").Ref<boolean>;
64
+ unfilteredCount: import("vue").ComputedRef<number>;
65
+ filterStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
66
+ filterError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null>;
67
+ productCountData: import("vue").Ref<{
68
+ count: number;
69
+ }>;
70
+ refreshProductCount: ({ where, }?: FilterParams) => Promise<void>;
71
+ productCountFetching: import("vue").Ref<boolean>;
72
+ productCountError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null>;
73
+ productCountStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
74
+ products: import("vue").ComputedRef<import("@scayle/storefront-api").Product[]>;
75
+ pagination: import("vue").ComputedRef<{
76
+ current: number;
77
+ total: number;
78
+ perPage: number;
79
+ page: number;
80
+ first: number;
81
+ prev: number;
82
+ next: number;
83
+ last: number;
84
+ }>;
85
+ productsFetching: import("vue").Ref<boolean>;
86
+ filterProducts: ({ where, page, sort, orFiltersOperator, }: FilterParams) => Promise<void>;
87
+ productError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null>;
88
+ productStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
89
+ categories: import("vue").ComputedRef<import("@scayle/storefront-api").Category | import("@scayle/storefront-api").Category[]>;
90
+ selectedCategory: import("vue").ComputedRef<import("@scayle/storefront-api").Category | undefined>;
91
+ categoriesFetching: import("vue").Ref<boolean>;
92
+ categoriesError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null>;
93
+ categoriesStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
49
94
  fetchProducts: ({ path, page, perPage, where, sort, pricePromotionKey, cache, orFiltersOperator, }: FilterParams & {
50
95
  path: string;
51
96
  pricePromotionKey?: string | undefined;