ingeniuscliq-core 0.4.8 → 0.4.10
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.
|
@@ -2,26 +2,26 @@ import { CoreBuilder } from '../../../classes/CoreBuilder';
|
|
|
2
2
|
import { CoreProductBaseService } from '../services/base';
|
|
3
3
|
import { CoreProduct, CoreProductStore } from '../types/CoreProduct';
|
|
4
4
|
import { CoreProductCategory } from '../types';
|
|
5
|
-
export declare class CoreProductBuilder implements CoreBuilder {
|
|
5
|
+
export declare class CoreProductBuilder<T extends CoreProduct, K extends CoreProductCategory> implements CoreBuilder {
|
|
6
6
|
protected productService: CoreProductBaseService;
|
|
7
|
-
protected initialState: Pick<CoreProductStore<
|
|
7
|
+
protected initialState: Pick<CoreProductStore<T, K>, "productDetails" | "products" | "categories" | "loading" | "error">;
|
|
8
8
|
constructor(service?: CoreProductBaseService, initialState?: any);
|
|
9
|
-
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreProductStore<
|
|
9
|
+
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreProductStore<T, K>>, "persist"> & {
|
|
10
10
|
persist: {
|
|
11
|
-
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreProductStore<
|
|
12
|
-
productDetails:
|
|
13
|
-
products: import('../../../types').BasePagination<
|
|
14
|
-
categories:
|
|
11
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreProductStore<T, K>, {
|
|
12
|
+
productDetails: T | null;
|
|
13
|
+
products: import('../../../types').BasePagination<T> | null;
|
|
14
|
+
categories: K[] | null;
|
|
15
15
|
}>>) => void;
|
|
16
16
|
clearStorage: () => void;
|
|
17
17
|
rehydrate: () => Promise<void> | void;
|
|
18
18
|
hasHydrated: () => boolean;
|
|
19
|
-
onHydrate: (fn: (state: CoreProductStore<
|
|
20
|
-
onFinishHydration: (fn: (state: CoreProductStore<
|
|
21
|
-
getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreProductStore<
|
|
22
|
-
productDetails:
|
|
23
|
-
products: import('../../../types').BasePagination<
|
|
24
|
-
categories:
|
|
19
|
+
onHydrate: (fn: (state: CoreProductStore<T, K>) => void) => () => void;
|
|
20
|
+
onFinishHydration: (fn: (state: CoreProductStore<T, K>) => void) => () => void;
|
|
21
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreProductStore<T, K>, {
|
|
22
|
+
productDetails: T | null;
|
|
23
|
+
products: import('../../../types').BasePagination<T> | null;
|
|
24
|
+
categories: K[] | null;
|
|
25
25
|
}>>;
|
|
26
26
|
};
|
|
27
27
|
}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseService } from '../../../services/base';
|
|
2
|
+
import { BaseApiResponse } from '../../../types';
|
|
2
3
|
import { AxiosResponse } from 'axios';
|
|
3
4
|
/**
|
|
4
5
|
* Base class that can be extended by concrete services
|
|
@@ -6,4 +7,5 @@ import { AxiosResponse } from 'axios';
|
|
|
6
7
|
export declare class CoreProductBaseService extends BaseService {
|
|
7
8
|
constructor();
|
|
8
9
|
getAllCategories: <T>(params?: Record<string, any>) => Promise<AxiosResponse<T>>;
|
|
10
|
+
bestSellers: <T>(params?: Record<string, any>) => Promise<AxiosResponse<BaseApiResponse<T[]>>>;
|
|
9
11
|
}
|
|
@@ -35,6 +35,7 @@ export interface CoreProductStore<T extends CoreProduct, K extends CoreProductCa
|
|
|
35
35
|
getProductDetails: () => T | null;
|
|
36
36
|
fetchCategories: (params?: Record<string, any>) => Promise<BaseApiResponse<K[]>>;
|
|
37
37
|
getCategories: () => K[] | null;
|
|
38
|
+
getBestSellers: (params?: Record<string, any>, actions?: CoreActions) => Promise<BaseApiResponse<T[]>>;
|
|
38
39
|
}
|
|
39
40
|
export interface CoreProductible extends BaseType {
|
|
40
41
|
order_id: number;
|