@daffodil/product 0.88.1 → 0.90.0
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/driver/in-memory/index.d.ts +99 -1
- package/driver/index.d.ts +78 -1
- package/driver/magento/index.d.ts +378 -1
- package/driver/magento/testing/index.d.ts +114 -1
- package/driver/shopify/index.d.ts +89 -1
- package/driver/testing/index.d.ts +38 -1
- package/fesm2022/daffodil-product-driver-in-memory.mjs +10 -10
- package/fesm2022/daffodil-product-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver-magento-testing.mjs +24 -24
- package/fesm2022/daffodil-product-driver-magento-testing.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver-magento.mjs +19 -19
- package/fesm2022/daffodil-product-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver-shopify.mjs +28 -16
- package/fesm2022/daffodil-product-driver-shopify.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver-testing.mjs +7 -7
- package/fesm2022/daffodil-product-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver.mjs.map +1 -1
- package/fesm2022/daffodil-product-routing.mjs +16 -16
- package/fesm2022/daffodil-product-routing.mjs.map +1 -1
- package/fesm2022/daffodil-product-state-testing.mjs +13 -13
- package/fesm2022/daffodil-product-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-product-state.mjs +22 -22
- package/fesm2022/daffodil-product-state.mjs.map +1 -1
- package/fesm2022/daffodil-product-testing.mjs +19 -19
- package/fesm2022/daffodil-product-testing.mjs.map +1 -1
- package/fesm2022/daffodil-product.mjs.map +1 -1
- package/index.d.ts +141 -1
- package/package.json +1 -1
- package/routing/index.d.ts +168 -1
- package/state/index.d.ts +574 -1
- package/state/testing/index.d.ts +56 -1
- package/testing/index.d.ts +133 -1
- package/driver/errors/codes.enum.d.ts +0 -4
- package/driver/errors/invalid-api-response.d.ts +0 -6
- package/driver/errors/map.d.ts +0 -9
- package/driver/errors/product-not-found.d.ts +0 -8
- package/driver/errors/public_api.d.ts +0 -4
- package/driver/in-memory/backend/product.service.d.ts +0 -48
- package/driver/in-memory/collection-name.const.d.ts +0 -1
- package/driver/in-memory/driver/product-driver.module.d.ts +0 -13
- package/driver/in-memory/driver/product.service.d.ts +0 -24
- package/driver/in-memory/driver/provider.d.ts +0 -5
- package/driver/in-memory/injection-tokens/public_api.d.ts +0 -2
- package/driver/in-memory/injection-tokens/transforms/product-response/response-extra.token.d.ts +0 -2
- package/driver/in-memory/injection-tokens/transforms/product-response/response.token.d.ts +0 -2
- package/driver/in-memory/interfaces/product-response-extra-transform.type.d.ts +0 -3
- package/driver/in-memory/interfaces/product-response-transform.type.d.ts +0 -3
- package/driver/in-memory/interfaces/public_api.d.ts +0 -2
- package/driver/in-memory/public_api.d.ts +0 -6
- package/driver/interfaces/product-service.interface.d.ts +0 -27
- package/driver/magento/config/default.d.ts +0 -5
- package/driver/magento/config/public_api.d.ts +0 -1
- package/driver/magento/injection-tokens/fragments/product-page.token.d.ts +0 -2
- package/driver/magento/injection-tokens/fragments/product-preview.token.d.ts +0 -2
- package/driver/magento/injection-tokens/fragments/product.token.d.ts +0 -2
- package/driver/magento/injection-tokens/public_api.d.ts +0 -9
- package/driver/magento/injection-tokens/transforms/product/extra.token.d.ts +0 -20
- package/driver/magento/injection-tokens/transforms/product/token.d.ts +0 -2
- package/driver/magento/injection-tokens/transforms/product-preview/preview-extra.token.d.ts +0 -20
- package/driver/magento/injection-tokens/transforms/product-preview/preview.token.d.ts +0 -2
- package/driver/magento/injection-tokens/transforms/product-response/response-extra.token.d.ts +0 -2
- package/driver/magento/injection-tokens/transforms/product-response/response.token.d.ts +0 -2
- package/driver/magento/interfaces/config.interface.d.ts +0 -11
- package/driver/magento/interfaces/product-preview-extra-transform.type.d.ts +0 -3
- package/driver/magento/interfaces/product-preview-transform.type.d.ts +0 -3
- package/driver/magento/interfaces/product-response-extra-transform.type.d.ts +0 -3
- package/driver/magento/interfaces/product-response-transform.type.d.ts +0 -3
- package/driver/magento/interfaces/public_api.d.ts +0 -5
- package/driver/magento/models/aggregation.d.ts +0 -17
- package/driver/magento/models/filter-type-field.interface.d.ts +0 -7
- package/driver/magento/models/filter-type.enum.d.ts +0 -5
- package/driver/magento/models/filters.d.ts +0 -13
- package/driver/magento/models/get-filter-types-response.interface.d.ts +0 -6
- package/driver/magento/models/get-product-response.interface.d.ts +0 -8
- package/driver/magento/models/magento-product.d.ts +0 -27
- package/driver/magento/models/product-preview.interface.d.ts +0 -35
- package/driver/magento/models/public_api.d.ts +0 -11
- package/driver/magento/models/simple-product.d.ts +0 -6
- package/driver/magento/models/sort-fields.d.ts +0 -9
- package/driver/magento/models/sort.d.ts +0 -7
- package/driver/magento/product-driver.module.d.ts +0 -14
- package/driver/magento/product.service.d.ts +0 -28
- package/driver/magento/provider.d.ts +0 -3
- package/driver/magento/public_api.d.ts +0 -9
- package/driver/magento/queries/fragments/product-aggregations.d.ts +0 -1
- package/driver/magento/queries/fragments/product-page.d.ts +0 -1
- package/driver/magento/queries/fragments/product-preview.d.ts +0 -1
- package/driver/magento/queries/fragments/product.d.ts +0 -1
- package/driver/magento/queries/fragments/public_api.d.ts +0 -5
- package/driver/magento/queries/fragments/sort-fields.d.ts +0 -1
- package/driver/magento/queries/get-all-products.d.ts +0 -3
- package/driver/magento/queries/get-filter-types.d.ts +0 -2
- package/driver/magento/queries/get-product-by-url/public_api.d.ts +0 -4
- package/driver/magento/queries/get-product-by-url/query.d.ts +0 -5
- package/driver/magento/queries/get-product-by-url/response.type.d.ts +0 -5
- package/driver/magento/queries/get-product-by-url/validator.d.ts +0 -3
- package/driver/magento/queries/get-product-by-url/variables.type.d.ts +0 -3
- package/driver/magento/queries/get-product.d.ts +0 -3
- package/driver/magento/queries/public_api.d.ts +0 -5
- package/driver/magento/testing/factories/aggregation/aggregation.factory.d.ts +0 -12
- package/driver/magento/testing/factories/aggregation/public_api.d.ts +0 -3
- package/driver/magento/testing/factories/aggregation/type/price.factory.d.ts +0 -8
- package/driver/magento/testing/factories/aggregation/type/select.factory.d.ts +0 -8
- package/driver/magento/testing/factories/core/product-preview.factory.d.ts +0 -42
- package/driver/magento/testing/factories/core/product.factory.d.ts +0 -28
- package/driver/magento/testing/factories/filter-type-field.factory.d.ts +0 -8
- package/driver/magento/testing/factories/public_api.d.ts +0 -7
- package/driver/magento/testing/factories/simple/simple.factory.d.ts +0 -15
- package/driver/magento/testing/factories/sort-fields.factory.d.ts +0 -8
- package/driver/magento/testing/public_api.d.ts +0 -1
- package/driver/magento/transforms/aggregate/add-metadata-types-to-aggregates.d.ts +0 -2
- package/driver/magento/transforms/aggregate/get-matched-attribute-type.d.ts +0 -2
- package/driver/magento/transforms/aggregate/public_api.d.ts +0 -3
- package/driver/magento/transforms/aggregate/transform.d.ts +0 -3
- package/driver/magento/transforms/aggregate/type/equal.d.ts +0 -3
- package/driver/magento/transforms/aggregate/type/range.d.ts +0 -8
- package/driver/magento/transforms/applied-filter-transformer.service.d.ts +0 -18
- package/driver/magento/transforms/applied-sort-option.d.ts +0 -3
- package/driver/magento/transforms/collection-metadata.d.ts +0 -8
- package/driver/magento/transforms/product-preview.d.ts +0 -12
- package/driver/magento/transforms/product-response.d.ts +0 -17
- package/driver/magento/transforms/product-transformers.d.ts +0 -20
- package/driver/magento/transforms/public_api.d.ts +0 -7
- package/driver/magento/transforms/simple-product-transformers.d.ts +0 -16
- package/driver/magento/transforms/sort-options/sort-default-option-first.d.ts +0 -2
- package/driver/models/public_api.d.ts +0 -1
- package/driver/models/response.interface.d.ts +0 -18
- package/driver/public_api.d.ts +0 -3
- package/driver/shopify/product-driver.module.d.ts +0 -12
- package/driver/shopify/product.service.d.ts +0 -20
- package/driver/shopify/public_api.d.ts +0 -4
- package/driver/shopify/queries/gql/get-all-products.d.ts +0 -6
- package/driver/shopify/queries/gql/get-product-by-url.d.ts +0 -8
- package/driver/shopify/queries/gql/get-product.d.ts +0 -6
- package/driver/shopify/queries/gql/public_api.d.ts +0 -3
- package/driver/shopify/queries/public_api.d.ts +0 -3
- package/driver/shopify/queries/response.types.d.ts +0 -6
- package/driver/shopify/queries/variables.types.d.ts +0 -9
- package/driver/shopify/transforms/public_api.d.ts +0 -1
- package/driver/shopify/transforms/shopify-daff-product-transform.d.ts +0 -9
- package/driver/testing/drivers/product-driver.module.d.ts +0 -13
- package/driver/testing/drivers/product.service.d.ts +0 -22
- package/driver/testing/public_api.d.ts +0 -2
- package/helpers/has-discount.d.ts +0 -7
- package/helpers/has-price-range.d.ts +0 -7
- package/helpers/public_api.d.ts +0 -2
- package/models/collection.interface.d.ts +0 -8
- package/models/prices.d.ts +0 -31
- package/models/product-image.d.ts +0 -10
- package/models/product.d.ts +0 -76
- package/models/public_api.d.ts +0 -4
- package/public_api.d.ts +0 -2
- package/routing/config/default.d.ts +0 -9
- package/routing/config/interface.d.ts +0 -18
- package/routing/config/public_api.d.ts +0 -3
- package/routing/config/token.d.ts +0 -2
- package/routing/constants/collection-request-fields.d.ts +0 -5
- package/routing/constants/public_api.d.ts +0 -1
- package/routing/discrete-filter-params/public_api.d.ts +0 -1
- package/routing/discrete-filter-params/token.d.ts +0 -10
- package/routing/effects/collection.effects.d.ts +0 -20
- package/routing/effects/public_api.d.ts +0 -1
- package/routing/models/collection-request-query-param-transforms.interface.d.ts +0 -22
- package/routing/models/collection-request-query-params.interface.d.ts +0 -8
- package/routing/models/public_api.d.ts +0 -2
- package/routing/module.d.ts +0 -9
- package/routing/public_api.d.ts +0 -8
- package/routing/resolvers/product-page-id/product-page-id.resolver.d.ts +0 -18
- package/routing/resolvers/product-page-url/product-page-url.resolver.d.ts +0 -22
- package/routing/resolvers/public_api.d.ts +0 -2
- package/routing/services/get-query-params-from-request.service.d.ts +0 -17
- package/routing/services/get-request-from-route.service.d.ts +0 -18
- package/routing/services/public_api.d.ts +0 -2
- package/state/actions/product-grid.actions.d.ts +0 -47
- package/state/actions/product-page.actions.d.ts +0 -67
- package/state/actions/product.actions.d.ts +0 -43
- package/state/actions/public_api.d.ts +0 -3
- package/state/effects/product-grid.effects.d.ts +0 -27
- package/state/effects/product-page.effects.d.ts +0 -28
- package/state/effects/product.effects.d.ts +0 -27
- package/state/effects/public_api.d.ts +0 -2
- package/state/facades/product/product-facade.interface.d.ts +0 -51
- package/state/facades/product/product.facade.d.ts +0 -26
- package/state/facades/product-grid/product-grid-facade.interface.d.ts +0 -14
- package/state/facades/product-grid/product-grid.facade.d.ts +0 -20
- package/state/facades/product-page/facade.d.ts +0 -27
- package/state/facades/product-page/facade.interface.d.ts +0 -13
- package/state/facades/public_api.d.ts +0 -6
- package/state/injection-tokens/error-matcher.token.d.ts +0 -2
- package/state/injection-tokens/public_api.d.ts +0 -1
- package/state/product-state.module.d.ts +0 -11
- package/state/public_api.d.ts +0 -7
- package/state/reducers/injection-tokens/config.token.d.ts +0 -3
- package/state/reducers/injection-tokens/extra.token.d.ts +0 -3
- package/state/reducers/injection-tokens/meta.token.d.ts +0 -3
- package/state/reducers/injection-tokens/public_api.d.ts +0 -2
- package/state/reducers/injection-tokens/reducers.token.d.ts +0 -3
- package/state/reducers/product/product-reducer-state.interface.d.ts +0 -15
- package/state/reducers/product/product.reducer.d.ts +0 -15
- package/state/reducers/product-entities/product-entities-reducer-adapter.d.ts +0 -6
- package/state/reducers/product-entities/product-entities.reducer.d.ts +0 -11
- package/state/reducers/product-grid/product-grid-reducer-state.interface.d.ts +0 -19
- package/state/reducers/product-grid/product-grid.reducer.d.ts +0 -15
- package/state/reducers/product-reducers-state.interface.d.ts +0 -16
- package/state/reducers/product-reducers.d.ts +0 -6
- package/state/reducers/product-store-feature-key.d.ts +0 -1
- package/state/reducers/public_api.d.ts +0 -10
- package/state/selectors/all-selectors.selectors.d.ts +0 -15
- package/state/selectors/product/product.selectors.d.ts +0 -27
- package/state/selectors/product-entities/product-entities.selectors.d.ts +0 -75
- package/state/selectors/product-feature.selector.d.ts +0 -13
- package/state/selectors/product-grid/product-grid.selectors.d.ts +0 -22
- package/state/selectors/public_api.d.ts +0 -5
- package/state/testing/mock-product-facade.d.ts +0 -19
- package/state/testing/mock-product-grid-facade.d.ts +0 -14
- package/state/testing/mock-product-page-facade.d.ts +0 -20
- package/state/testing/product-testing.module.d.ts +0 -6
- package/state/testing/public_api.d.ts +0 -4
- package/testing/factories/collection.factory.d.ts +0 -18
- package/testing/factories/default-product.factory.d.ts +0 -39
- package/testing/factories/extension.factory.d.ts +0 -21
- package/testing/factories/kind.factory.d.ts +0 -20
- package/testing/factories/product-image.factory.d.ts +0 -19
- package/testing/factories/public_api.d.ts +0 -6
- package/testing/helpers.d.ts +0 -7
- package/testing/injection-tokens/factories/extra.token.d.ts +0 -3
- package/testing/injection-tokens/factories/type.token.d.ts +0 -3
- package/testing/injection-tokens/public_api.d.ts +0 -2
- package/testing/public_api.d.ts +0 -4
- package/testing/testing.module.d.ts +0 -9
package/state/index.d.ts
CHANGED
|
@@ -1 +1,574 @@
|
|
|
1
|
-
|
|
1
|
+
import * as _ngrx_store from '@ngrx/store';
|
|
2
|
+
import { Action, Store, ActionReducerMap, MetaReducer, ActionReducer, MemoizedSelector } from '@ngrx/store';
|
|
3
|
+
import { DaffStateError, ErrorTransformer, DaffStoreFacade, DaffOperationState, DaffOperationStateFacadeInterface, DaffState, DaffOperationStateSelectors, daffTransformErrorToStateError } from '@daffodil/core/state';
|
|
4
|
+
import * as _daffodil_product from '@daffodil/product';
|
|
5
|
+
import { DaffProduct } from '@daffodil/product';
|
|
6
|
+
import { DaffProductDriverResponse, DaffProductServiceInterface } from '@daffodil/product/driver';
|
|
7
|
+
import * as i2 from '@ngrx/effects';
|
|
8
|
+
import { Actions } from '@ngrx/effects';
|
|
9
|
+
import { Observable } from 'rxjs';
|
|
10
|
+
import * as i0 from '@angular/core';
|
|
11
|
+
import { EntityState, EntityAdapter } from '@ngrx/entity';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Action types for Product Grid Actions.
|
|
15
|
+
*/
|
|
16
|
+
declare enum DaffProductGridActionTypes {
|
|
17
|
+
ProductGridLoadAction = "[@daffodil/product] ProductGrid Load Action",
|
|
18
|
+
ProductGridLoadSuccessAction = "[@daffodil/product] ProductGrid Load Success Action",
|
|
19
|
+
ProductGridLoadFailureAction = "[@daffodil/product] ProductGrid Load Failure Action",
|
|
20
|
+
ProductGridResetAction = "[@daffodil/product] ProductGrid Reset Action"
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Triggers a request for an array of products.
|
|
24
|
+
*/
|
|
25
|
+
declare class DaffProductGridLoad implements Action {
|
|
26
|
+
readonly type = DaffProductGridActionTypes.ProductGridLoadAction;
|
|
27
|
+
constructor();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* An action called when a request for of an array of products succeeded.
|
|
31
|
+
*
|
|
32
|
+
* @param payload - An array of Products
|
|
33
|
+
*/
|
|
34
|
+
declare class DaffProductGridLoadSuccess<T extends DaffProduct = DaffProduct> implements Action {
|
|
35
|
+
payload: T[];
|
|
36
|
+
readonly type = DaffProductGridActionTypes.ProductGridLoadSuccessAction;
|
|
37
|
+
constructor(payload: T[]);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* An action called when a request for an array of products failed.
|
|
41
|
+
*
|
|
42
|
+
* @param payload - An error message
|
|
43
|
+
*/
|
|
44
|
+
declare class DaffProductGridLoadFailure implements Action {
|
|
45
|
+
payload: DaffStateError;
|
|
46
|
+
readonly type = DaffProductGridActionTypes.ProductGridLoadFailureAction;
|
|
47
|
+
constructor(payload: DaffStateError);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Resets the state of the product grid redux store to its initial state.
|
|
51
|
+
*/
|
|
52
|
+
declare class DaffProductGridReset implements Action {
|
|
53
|
+
readonly type = DaffProductGridActionTypes.ProductGridResetAction;
|
|
54
|
+
constructor();
|
|
55
|
+
}
|
|
56
|
+
type DaffProductGridActions<T extends DaffProduct = DaffProduct> = DaffProductGridLoad | DaffProductGridLoadSuccess<T> | DaffProductGridLoadFailure | DaffProductGridReset;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Action types for Product Actions.
|
|
60
|
+
*/
|
|
61
|
+
declare enum DaffProductActionTypes {
|
|
62
|
+
ProductLoadAction = "[@daffodil/product] Product Load Action",
|
|
63
|
+
ProductLoadSuccessAction = "[@daffodil/product] Product Load Success Action",
|
|
64
|
+
ProductLoadFailureAction = "[@daffodil/product] Product Load Failure Action"
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Triggers a request for a Product.
|
|
68
|
+
*
|
|
69
|
+
* @param payload - Id of requested Product
|
|
70
|
+
*/
|
|
71
|
+
declare class DaffProductLoad implements Action {
|
|
72
|
+
payload: string;
|
|
73
|
+
readonly type = DaffProductActionTypes.ProductLoadAction;
|
|
74
|
+
constructor(payload: string);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* An action called when a request for a Product succeeded.
|
|
78
|
+
*
|
|
79
|
+
* @param payload - A Product
|
|
80
|
+
*/
|
|
81
|
+
declare class DaffProductLoadSuccess<T extends DaffProduct = DaffProduct> implements Action {
|
|
82
|
+
payload: DaffProductDriverResponse<T>;
|
|
83
|
+
readonly type = DaffProductActionTypes.ProductLoadSuccessAction;
|
|
84
|
+
constructor(payload: DaffProductDriverResponse<T>);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* An action called when a request for a Product failed.
|
|
88
|
+
*
|
|
89
|
+
* @param payload - An error message
|
|
90
|
+
*/
|
|
91
|
+
declare class DaffProductLoadFailure implements Action {
|
|
92
|
+
payload: DaffStateError;
|
|
93
|
+
readonly type = DaffProductActionTypes.ProductLoadFailureAction;
|
|
94
|
+
constructor(payload: DaffStateError);
|
|
95
|
+
}
|
|
96
|
+
type DaffProductActions<T extends DaffProduct = DaffProduct> = DaffProductLoad | DaffProductLoadSuccess<T> | DaffProductLoadFailure;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Action types for Product Page Actions.
|
|
100
|
+
*/
|
|
101
|
+
declare enum DaffProductPageActionTypes {
|
|
102
|
+
ProductPageLoadByUrlAction = "[@daffodil/product] Product Page Load By URL Action",
|
|
103
|
+
ProductPageLoadAction = "[@daffodil/product] Product Page Load Action",
|
|
104
|
+
ProductPageLoadSuccessAction = "[@daffodil/product] Product Page Load Success Action",
|
|
105
|
+
ProductPageLoadFailureAction = "[@daffodil/product] Product Page Load Failure Action",
|
|
106
|
+
UpdateQtyAction = "[@daffodil/product] Product Page Update Qty Action"
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* An action triggered to initialize a product page load.
|
|
110
|
+
* This is intended to be used for loading a product page rather than only a product.
|
|
111
|
+
*
|
|
112
|
+
* @param payload - URL of the requested product
|
|
113
|
+
*/
|
|
114
|
+
declare class DaffProductPageLoadByUrl<T extends DaffProduct = DaffProduct> implements Action {
|
|
115
|
+
payload: T['url'];
|
|
116
|
+
readonly type = DaffProductPageActionTypes.ProductPageLoadByUrlAction;
|
|
117
|
+
constructor(payload: T['url']);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* An action triggered to initialize a product page load.
|
|
121
|
+
* This is intended to be used for loading a product page rather than only a product.
|
|
122
|
+
*
|
|
123
|
+
* @param payload - Id of the requested product
|
|
124
|
+
*/
|
|
125
|
+
declare class DaffProductPageLoad implements Action {
|
|
126
|
+
payload: string;
|
|
127
|
+
readonly type = DaffProductPageActionTypes.ProductPageLoadAction;
|
|
128
|
+
constructor(payload: string);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* An action triggered upon a successful product page request.
|
|
132
|
+
*
|
|
133
|
+
* @param payload - A DaffProduct
|
|
134
|
+
*/
|
|
135
|
+
declare class DaffProductPageLoadSuccess<T extends DaffProduct = DaffProduct> implements Action {
|
|
136
|
+
payload: DaffProductDriverResponse<T>;
|
|
137
|
+
readonly type = DaffProductPageActionTypes.ProductPageLoadSuccessAction;
|
|
138
|
+
constructor(payload: DaffProductDriverResponse<T>);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* An action triggered upon a failed product page request.
|
|
142
|
+
*
|
|
143
|
+
* @param payload - an error message
|
|
144
|
+
*/
|
|
145
|
+
declare class DaffProductPageLoadFailure implements Action {
|
|
146
|
+
payload: DaffStateError;
|
|
147
|
+
readonly type = DaffProductPageActionTypes.ProductPageLoadFailureAction;
|
|
148
|
+
constructor(payload: DaffStateError);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Update the qty of the current product.
|
|
152
|
+
*
|
|
153
|
+
* @param payload - The qty of the product.
|
|
154
|
+
*/
|
|
155
|
+
declare class DaffProductPageUpdateQty implements Action {
|
|
156
|
+
payload: number;
|
|
157
|
+
readonly type = DaffProductPageActionTypes.UpdateQtyAction;
|
|
158
|
+
constructor(payload: number);
|
|
159
|
+
}
|
|
160
|
+
type DaffProductPageActions<T extends DaffProduct = DaffProduct> = DaffProductPageLoadByUrl<T> | DaffProductPageLoad | DaffProductPageLoadSuccess<T> | DaffProductPageLoadFailure | DaffProductPageUpdateQty;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Effects for handling product grid actions and for triggering corresponding service requests.
|
|
164
|
+
*
|
|
165
|
+
* @param action$ - Redux action object
|
|
166
|
+
* @param driver - A product service driver
|
|
167
|
+
*/
|
|
168
|
+
declare class DaffProductGridEffects<T extends DaffProduct> {
|
|
169
|
+
private actions$;
|
|
170
|
+
private driver;
|
|
171
|
+
private errorMatcher;
|
|
172
|
+
constructor(actions$: Actions, driver: DaffProductServiceInterface<T>, errorMatcher: ErrorTransformer);
|
|
173
|
+
/**
|
|
174
|
+
* Handles ProductGridLoadAction by making a service call for products and returning a success or failure action
|
|
175
|
+
* to the action stream.
|
|
176
|
+
*
|
|
177
|
+
* @returns An Observable of a DaffProductGridAction
|
|
178
|
+
*/
|
|
179
|
+
loadAll$: Observable<any>;
|
|
180
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductGridEffects<any>, never>;
|
|
181
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductGridEffects<any>>;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Effects for handling product actions and for triggering corresponding service requests.
|
|
186
|
+
*
|
|
187
|
+
* @param action$ - Redux action object
|
|
188
|
+
* @param driver - A product service driver
|
|
189
|
+
*/
|
|
190
|
+
declare class DaffProductEffects<T extends DaffProduct> {
|
|
191
|
+
private actions$;
|
|
192
|
+
private driver;
|
|
193
|
+
private errorMatcher;
|
|
194
|
+
constructor(actions$: Actions, driver: DaffProductServiceInterface<T>, errorMatcher: ErrorTransformer);
|
|
195
|
+
/**
|
|
196
|
+
* Handles ProductLoadAction by making a service call for a product and returning a success or
|
|
197
|
+
* failure action to the action stream.
|
|
198
|
+
*
|
|
199
|
+
* @returns An Observable of a ProductLoadAction
|
|
200
|
+
*/
|
|
201
|
+
load$: Observable<any>;
|
|
202
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductEffects<any>, never>;
|
|
203
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductEffects<any>>;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* A facade for getting state about a particular product.
|
|
208
|
+
*/
|
|
209
|
+
interface DaffProductFacadeInterface<T extends DaffProduct = DaffProduct> extends DaffStoreFacade<Action> {
|
|
210
|
+
/**
|
|
211
|
+
* Get a product.
|
|
212
|
+
*
|
|
213
|
+
* @param id a product id
|
|
214
|
+
*/
|
|
215
|
+
getProduct(id: T['id']): Observable<T>;
|
|
216
|
+
/**
|
|
217
|
+
* Get the original price for a product.
|
|
218
|
+
*
|
|
219
|
+
* @param id a product id
|
|
220
|
+
*/
|
|
221
|
+
getPrice(id: T['id']): Observable<number>;
|
|
222
|
+
/**
|
|
223
|
+
* Whether a particular product has a discount.
|
|
224
|
+
*
|
|
225
|
+
* @param id a product id
|
|
226
|
+
*/
|
|
227
|
+
hasDiscount(id: T['id']): Observable<boolean>;
|
|
228
|
+
/**
|
|
229
|
+
* Get the discount amount of a product.
|
|
230
|
+
*
|
|
231
|
+
* @param id a product id
|
|
232
|
+
*/
|
|
233
|
+
getDiscountAmount(id: T['id']): Observable<number>;
|
|
234
|
+
/**
|
|
235
|
+
* Get the discounted price for a product.
|
|
236
|
+
*
|
|
237
|
+
* @param id a product id
|
|
238
|
+
*/
|
|
239
|
+
getDiscountedPrice(id: T['id']): Observable<number>;
|
|
240
|
+
/**
|
|
241
|
+
* Get the discount percent of a product.
|
|
242
|
+
*
|
|
243
|
+
* @param id a product id
|
|
244
|
+
*/
|
|
245
|
+
getDiscountPercent(id: T['id']): Observable<number>;
|
|
246
|
+
/**
|
|
247
|
+
* Whether a product is out of stock.
|
|
248
|
+
*
|
|
249
|
+
* @param id a product id
|
|
250
|
+
*/
|
|
251
|
+
isOutOfStock(id: T['id']): Observable<boolean>;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* An interface describing product redux state. This state describes the current product that is loaded for a product page.
|
|
256
|
+
*/
|
|
257
|
+
interface DaffProductReducerState extends DaffOperationState {
|
|
258
|
+
/**
|
|
259
|
+
* The id of the current product.
|
|
260
|
+
*/
|
|
261
|
+
currentProductId: DaffProduct['id'];
|
|
262
|
+
/**
|
|
263
|
+
* The quantity chosen for the current product.
|
|
264
|
+
*/
|
|
265
|
+
qty: number;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Interface for product grid redux state.
|
|
270
|
+
*/
|
|
271
|
+
interface DaffProductGridReducerState<T extends DaffProduct = DaffProduct> {
|
|
272
|
+
/**
|
|
273
|
+
* The array of products that have already been loaded.
|
|
274
|
+
*/
|
|
275
|
+
products: T[];
|
|
276
|
+
/**
|
|
277
|
+
* Whether a grid of products is loading.
|
|
278
|
+
*/
|
|
279
|
+
loading: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Errors associated with loading a grid of products.
|
|
282
|
+
*/
|
|
283
|
+
errors: DaffStateError[];
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
declare const DAFF_PRODUCT_STORE_FEATURE_KEY = "daffProduct";
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Interface for the redux store of the product feature area.
|
|
290
|
+
*/
|
|
291
|
+
interface DaffProductReducersState<T extends DaffProduct = DaffProduct> {
|
|
292
|
+
products: EntityState<T>;
|
|
293
|
+
productGrid: DaffProductGridReducerState<T>;
|
|
294
|
+
product: DaffProductReducerState;
|
|
295
|
+
}
|
|
296
|
+
interface DaffProductStateRootSlice<T extends DaffProduct = DaffProduct> {
|
|
297
|
+
[DAFF_PRODUCT_STORE_FEATURE_KEY]: DaffProductReducersState<T>;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* A facade for getting state about a particular product.
|
|
302
|
+
*
|
|
303
|
+
* @inheritdoc
|
|
304
|
+
*/
|
|
305
|
+
declare class DaffProductFacade<T extends DaffProduct = DaffProduct> implements DaffProductFacadeInterface<T> {
|
|
306
|
+
private store;
|
|
307
|
+
private selectors;
|
|
308
|
+
constructor(store: Store<DaffProductStateRootSlice<T>>);
|
|
309
|
+
getProduct(id: T['id']): Observable<T>;
|
|
310
|
+
getPrice(id: T['id']): Observable<number>;
|
|
311
|
+
hasDiscount(id: T['id']): Observable<boolean>;
|
|
312
|
+
getDiscountAmount(id: T['id']): Observable<number>;
|
|
313
|
+
getDiscountedPrice(id: T['id']): Observable<number>;
|
|
314
|
+
getDiscountPercent(id: T['id']): Observable<number>;
|
|
315
|
+
isOutOfStock(id: T['id']): Observable<boolean>;
|
|
316
|
+
dispatch(action: Action): void;
|
|
317
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductFacade<any>, never>;
|
|
318
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductFacade<any>>;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Returns state values from all product related reducers.
|
|
323
|
+
*/
|
|
324
|
+
declare const daffProductReducers: ActionReducerMap<DaffProductReducersState>;
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Reducer function that catches actions and changes/overwrites product grid state.
|
|
328
|
+
*
|
|
329
|
+
* @param state current State of the redux store
|
|
330
|
+
* @param action a product grid action
|
|
331
|
+
* @returns Product grid state
|
|
332
|
+
*/
|
|
333
|
+
declare function daffProductGridReducer<T extends DaffProduct>(state: DaffProductGridReducerState<any>, action: DaffProductGridActions<T>): DaffProductGridReducerState<T>;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Product Adapter for changing/overwriting entity state.
|
|
337
|
+
*/
|
|
338
|
+
declare const daffProductEntitiesAdapter: <T extends DaffProduct>() => EntityAdapter<T>;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Reducer function that catches actions and changes/overwrites product entities state.
|
|
342
|
+
*
|
|
343
|
+
* @param state current State of the redux store
|
|
344
|
+
* @param action ProductGrid, BestSellers, or Product actions
|
|
345
|
+
* @returns Product entities state
|
|
346
|
+
*/
|
|
347
|
+
declare function daffProductEntitiesReducer<T extends DaffProduct>(state: EntityState<T>, action: DaffProductGridActions<T> | DaffProductActions<T> | DaffProductPageActions<T>): EntityState<T>;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Initial values of the product state.
|
|
351
|
+
*/
|
|
352
|
+
declare const daffProductReducerInitialState: DaffProductReducerState;
|
|
353
|
+
/**
|
|
354
|
+
* Reducer function that catches actions and changes/overwrites product state.
|
|
355
|
+
*
|
|
356
|
+
* @param state current State of the redux store
|
|
357
|
+
* @param action a product action
|
|
358
|
+
* @returns product state
|
|
359
|
+
*/
|
|
360
|
+
declare function daffProductReducer<T extends DaffProduct>(state: DaffProductReducerState, action: DaffProductPageActions<T>): DaffProductReducerState;
|
|
361
|
+
|
|
362
|
+
declare const DAFF_PRODUCT_META_REDUCERS: i0.InjectionToken<MetaReducer<DaffProductReducersState<_daffodil_product.DaffProduct>>[]>;
|
|
363
|
+
declare const daffProductProvideMetaReducers: <R extends MetaReducer<DaffProductReducersState<_daffodil_product.DaffProduct>> = MetaReducer<DaffProductReducersState<_daffodil_product.DaffProduct>>>(...values: R[]) => Array<i0.ValueProvider>;
|
|
364
|
+
|
|
365
|
+
declare const DAFF_PRODUCT_EXTRA_REDUCERS: i0.InjectionToken<ActionReducer<DaffProductReducersState<_daffodil_product.DaffProduct>, _ngrx_store.Action<string>>[]>;
|
|
366
|
+
declare const daffProductProvideExtraReducers: <R extends ActionReducer<DaffProductReducersState<_daffodil_product.DaffProduct>, _ngrx_store.Action<string>> = ActionReducer<DaffProductReducersState<_daffodil_product.DaffProduct>, _ngrx_store.Action<string>>>(...values: R[]) => Array<i0.ValueProvider>;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* A facade for getting state about a particular product.
|
|
370
|
+
*/
|
|
371
|
+
interface DaffProductPageFacadeInterface<T extends DaffProduct = DaffProduct> extends DaffOperationStateFacadeInterface<DaffProductReducerState> {
|
|
372
|
+
/**
|
|
373
|
+
* The product loaded for the product page.
|
|
374
|
+
*/
|
|
375
|
+
product$: Observable<T>;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* A facade for getting state about a particular product.
|
|
380
|
+
*
|
|
381
|
+
* @inheritdoc
|
|
382
|
+
*/
|
|
383
|
+
declare class DaffProductPageFacade<T extends DaffProduct = DaffProduct> implements DaffProductPageFacadeInterface<T> {
|
|
384
|
+
private store;
|
|
385
|
+
loadingState$: Observable<DaffState>;
|
|
386
|
+
loading$: Observable<boolean>;
|
|
387
|
+
mutating$: Observable<boolean>;
|
|
388
|
+
resolving$: Observable<boolean>;
|
|
389
|
+
errors$: Observable<DaffStateError[]>;
|
|
390
|
+
hasErrors$: Observable<boolean>;
|
|
391
|
+
product$: Observable<T>;
|
|
392
|
+
private selectors;
|
|
393
|
+
constructor(store: Store<DaffProductStateRootSlice<T>>);
|
|
394
|
+
dispatch(action: Action): void;
|
|
395
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductPageFacade<any>, never>;
|
|
396
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductPageFacade<any>>;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
interface DaffProductGridFacadeInterface<T extends DaffProduct = DaffProduct> extends DaffStoreFacade<Action> {
|
|
400
|
+
/**
|
|
401
|
+
* The loading state for retrieving a list of products.
|
|
402
|
+
*/
|
|
403
|
+
loading$: Observable<boolean>;
|
|
404
|
+
/**
|
|
405
|
+
* The state for a list of products.
|
|
406
|
+
*/
|
|
407
|
+
products$: Observable<T[]>;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* A facade for accessing state for a list of products from an application component.
|
|
412
|
+
*
|
|
413
|
+
* @inheritdoc
|
|
414
|
+
*/
|
|
415
|
+
declare class DaffProductGridFacade<T extends DaffProduct = DaffProduct> implements DaffProductGridFacadeInterface<T> {
|
|
416
|
+
private store;
|
|
417
|
+
loading$: Observable<boolean>;
|
|
418
|
+
products$: Observable<T[]>;
|
|
419
|
+
constructor(store: Store<DaffProductStateRootSlice<T>>);
|
|
420
|
+
dispatch(action: Action): void;
|
|
421
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductGridFacade<any>, never>;
|
|
422
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductGridFacade<any>>;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* An interface for selectors related to the current product page.
|
|
427
|
+
*/
|
|
428
|
+
interface DaffProductPageMemoizedSelectors<T extends DaffProduct = DaffProduct> extends DaffOperationStateSelectors<DaffProductStateRootSlice, DaffProductReducerState> {
|
|
429
|
+
/**
|
|
430
|
+
* Selects the entire state object for the product page feature area.
|
|
431
|
+
*/
|
|
432
|
+
selectCurrentProductState: MemoizedSelector<DaffProductStateRootSlice, DaffProductReducerState>;
|
|
433
|
+
/**
|
|
434
|
+
* Selects the id of the current product.
|
|
435
|
+
*/
|
|
436
|
+
selectCurrentProductId: MemoizedSelector<DaffProductStateRootSlice, T['id']>;
|
|
437
|
+
/**
|
|
438
|
+
* Selects the current product, which is the product loaded for a product page.
|
|
439
|
+
*/
|
|
440
|
+
selectCurrentProduct: MemoizedSelector<DaffProductStateRootSlice, T>;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* A function that returns all selectors related to the product page.
|
|
444
|
+
* Returns {@link DaffProductPageMemoizedSelectors}.
|
|
445
|
+
*/
|
|
446
|
+
declare const getDaffProductPageSelectors: <T extends DaffProduct>() => DaffProductPageMemoizedSelectors<T>;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* An interface for selectors related to product entities and prices for simple products.
|
|
450
|
+
*/
|
|
451
|
+
interface DaffProductEntitiesMemoizedSelectors<T extends DaffProduct = DaffProduct> {
|
|
452
|
+
/**
|
|
453
|
+
* Selects the ngrx entities state for products.
|
|
454
|
+
*/
|
|
455
|
+
selectProductEntitiesState: MemoizedSelector<DaffProductStateRootSlice<T>, EntityState<T>>;
|
|
456
|
+
/**
|
|
457
|
+
* Selects all ids for products in state.
|
|
458
|
+
*/
|
|
459
|
+
selectProductIds: MemoizedSelector<DaffProductStateRootSlice<T>, EntityState<T>['ids']>;
|
|
460
|
+
/**
|
|
461
|
+
* Selects the ngrx entities for all products in state.
|
|
462
|
+
*/
|
|
463
|
+
selectProductEntities: MemoizedSelector<DaffProductStateRootSlice<T>, EntityState<T>['entities']>;
|
|
464
|
+
/**
|
|
465
|
+
* Selects all products in state as an array.
|
|
466
|
+
*/
|
|
467
|
+
selectAllProducts: MemoizedSelector<DaffProductStateRootSlice<T>, T[]>;
|
|
468
|
+
/**
|
|
469
|
+
* Selects the total number of products in state.
|
|
470
|
+
*/
|
|
471
|
+
selectProductTotal: MemoizedSelector<DaffProductStateRootSlice<T>, number>;
|
|
472
|
+
/**
|
|
473
|
+
* Selects a product by id.
|
|
474
|
+
*
|
|
475
|
+
* @param productId the id of the product.
|
|
476
|
+
*/
|
|
477
|
+
selectProduct: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, T>;
|
|
478
|
+
/**
|
|
479
|
+
* Selects the price of a product.
|
|
480
|
+
*
|
|
481
|
+
* @param productId the id of the product.
|
|
482
|
+
*/
|
|
483
|
+
selectProductPrice: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number>;
|
|
484
|
+
/**
|
|
485
|
+
* Selects the discount of a product as some amount of currency.
|
|
486
|
+
*
|
|
487
|
+
* @param productId the id of the product.
|
|
488
|
+
*/
|
|
489
|
+
selectProductDiscountAmount: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number>;
|
|
490
|
+
/**
|
|
491
|
+
* Selects the discounted price of a product.
|
|
492
|
+
*
|
|
493
|
+
* @param productId the id of the product.
|
|
494
|
+
*/
|
|
495
|
+
selectProductDiscountedPrice: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number>;
|
|
496
|
+
/**
|
|
497
|
+
* Selects the discount of a product as a percent of the original price.
|
|
498
|
+
*
|
|
499
|
+
* @param productId the id of the product.
|
|
500
|
+
*/
|
|
501
|
+
selectProductDiscountPercent: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number>;
|
|
502
|
+
/**
|
|
503
|
+
* Selects whether or not the product has a discount.
|
|
504
|
+
*
|
|
505
|
+
* @param productId the id of the product.
|
|
506
|
+
*/
|
|
507
|
+
selectProductHasDiscount: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, boolean>;
|
|
508
|
+
/**
|
|
509
|
+
* Selects whether or not a product is out of stock.
|
|
510
|
+
*
|
|
511
|
+
* @param productId the id of the product.
|
|
512
|
+
*/
|
|
513
|
+
selectIsProductOutOfStock: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, boolean>;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* A function that returns all selectors related to product entities and simple product prices.
|
|
517
|
+
*/
|
|
518
|
+
declare const getDaffProductEntitiesSelectors: <T extends DaffProduct>() => DaffProductEntitiesMemoizedSelectors<T>;
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* An interface for the entire product feature state.
|
|
522
|
+
*/
|
|
523
|
+
interface DaffProductFeatureMemoizedSelector<T extends DaffProduct = DaffProduct> {
|
|
524
|
+
selectProductState: MemoizedSelector<Record<string, any>, DaffProductReducersState<T>>;
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* A function that returns a selector for the entire product feature state.
|
|
528
|
+
*/
|
|
529
|
+
declare const getDaffProductFeatureSelector: <T extends DaffProduct>() => DaffProductFeatureMemoizedSelector<T>;
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* An interface for selectors related to loading a grid of products.
|
|
533
|
+
*/
|
|
534
|
+
interface DaffProductGridMemoizedSelectors<T extends DaffProduct = DaffProduct> {
|
|
535
|
+
/**
|
|
536
|
+
* Selects the redux state for the product grid feature area. Returns {@link DaffProductGridReducerState}.
|
|
537
|
+
*/
|
|
538
|
+
selectProductGridState: MemoizedSelector<DaffProductStateRootSlice<T>, DaffProductGridReducerState<T>>;
|
|
539
|
+
/**
|
|
540
|
+
* Selects whether any product grid requests are loading.
|
|
541
|
+
*/
|
|
542
|
+
selectProductGridLoadingState: MemoizedSelector<DaffProductStateRootSlice<T>, boolean>;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* A function that returns all selectors related to loading a grid of products.
|
|
546
|
+
* Returns {@link DaffProductGridMemoizedSelectors}.
|
|
547
|
+
*/
|
|
548
|
+
declare const getDaffProductGridSelectors: <T extends DaffProduct>() => DaffProductGridMemoizedSelectors<T>;
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* An interface for all selectors in the entire product feature area.
|
|
552
|
+
*/
|
|
553
|
+
interface DaffProductAllSelectors<T extends DaffProduct = DaffProduct> extends DaffProductPageMemoizedSelectors<T>, DaffProductEntitiesMemoizedSelectors<T>, DaffProductGridMemoizedSelectors<T>, DaffProductFeatureMemoizedSelector<T> {
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* A function that returns all selectors in the entire product feature area.
|
|
557
|
+
* Returns {@link DaffProductAllSelectors}.
|
|
558
|
+
*/
|
|
559
|
+
declare const getDaffProductSelectors: <T extends DaffProduct = DaffProduct>() => DaffProductAllSelectors<T>;
|
|
560
|
+
|
|
561
|
+
declare const DAFF_PRODUCT_ERROR_MATCHER: i0.InjectionToken<typeof daffTransformErrorToStateError>;
|
|
562
|
+
declare const provideDaffProductErrorMatcher: <R extends typeof daffTransformErrorToStateError = typeof daffTransformErrorToStateError>(value: R) => i0.ValueProvider;
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* A module that provides the default reducers and effects for the product redux state.
|
|
566
|
+
*/
|
|
567
|
+
declare class DaffProductStateModule {
|
|
568
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductStateModule, never>;
|
|
569
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffProductStateModule, never, [typeof _ngrx_store.StoreFeatureModule, typeof i2.EffectsFeatureModule], never>;
|
|
570
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffProductStateModule>;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
export { DAFF_PRODUCT_ERROR_MATCHER, DAFF_PRODUCT_EXTRA_REDUCERS, DAFF_PRODUCT_META_REDUCERS, DAFF_PRODUCT_STORE_FEATURE_KEY, DaffProductActionTypes, DaffProductEffects, DaffProductFacade, DaffProductGridActionTypes, DaffProductGridEffects, DaffProductGridFacade, DaffProductGridLoad, DaffProductGridLoadFailure, DaffProductGridLoadSuccess, DaffProductGridReset, DaffProductLoad, DaffProductLoadFailure, DaffProductLoadSuccess, DaffProductPageActionTypes, DaffProductPageFacade, DaffProductPageLoad, DaffProductPageLoadByUrl, DaffProductPageLoadFailure, DaffProductPageLoadSuccess, DaffProductPageUpdateQty, DaffProductStateModule, daffProductEntitiesAdapter, daffProductEntitiesReducer, daffProductGridReducer, daffProductProvideExtraReducers, daffProductProvideMetaReducers, daffProductReducer, daffProductReducerInitialState, daffProductReducers, getDaffProductEntitiesSelectors, getDaffProductFeatureSelector, getDaffProductGridSelectors, getDaffProductPageSelectors, getDaffProductSelectors, provideDaffProductErrorMatcher };
|
|
574
|
+
export type { DaffProductActions, DaffProductAllSelectors, DaffProductEntitiesMemoizedSelectors, DaffProductFacadeInterface, DaffProductFeatureMemoizedSelector, DaffProductGridActions, DaffProductGridFacadeInterface, DaffProductGridMemoizedSelectors, DaffProductGridReducerState, DaffProductPageActions, DaffProductPageFacadeInterface, DaffProductPageMemoizedSelectors, DaffProductReducerState, DaffProductReducersState, DaffProductStateRootSlice };
|
package/state/testing/index.d.ts
CHANGED
|
@@ -1 +1,56 @@
|
|
|
1
|
-
|
|
1
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2
|
+
import { DaffProduct } from '@daffodil/product';
|
|
3
|
+
import { DaffProductFacadeInterface, DaffProductGridFacadeInterface, DaffProductPageFacadeInterface } from '@daffodil/product/state';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { DaffState, DaffStateError } from '@daffodil/core/state';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @inheritdoc
|
|
9
|
+
*/
|
|
10
|
+
declare class MockDaffProductFacade implements DaffProductFacadeInterface {
|
|
11
|
+
getProduct(id: DaffProduct['id']): BehaviorSubject<DaffProduct>;
|
|
12
|
+
getPrice(id: DaffProduct['id']): BehaviorSubject<number>;
|
|
13
|
+
hasDiscount(id: DaffProduct['id']): BehaviorSubject<boolean>;
|
|
14
|
+
getDiscountAmount(id: DaffProduct['id']): BehaviorSubject<number>;
|
|
15
|
+
getDiscountedPrice(id: DaffProduct['id']): BehaviorSubject<number>;
|
|
16
|
+
getDiscountPercent(id: DaffProduct['id']): BehaviorSubject<number>;
|
|
17
|
+
isOutOfStock(id: DaffProduct['id']): BehaviorSubject<boolean>;
|
|
18
|
+
dispatch(action: any): void;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffProductFacade, never>;
|
|
20
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffProductFacade>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @inheritdoc
|
|
25
|
+
*/
|
|
26
|
+
declare class MockDaffProductGridFacade implements DaffProductGridFacadeInterface {
|
|
27
|
+
loading$: BehaviorSubject<boolean>;
|
|
28
|
+
products$: BehaviorSubject<DaffProduct[]>;
|
|
29
|
+
dispatch(action: any): void;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffProductGridFacade, never>;
|
|
31
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffProductGridFacade>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @inheritdoc
|
|
36
|
+
*/
|
|
37
|
+
declare class MockDaffProductPageFacade implements DaffProductPageFacadeInterface {
|
|
38
|
+
loadingState$: BehaviorSubject<DaffState>;
|
|
39
|
+
loading$: BehaviorSubject<boolean>;
|
|
40
|
+
mutating$: BehaviorSubject<boolean>;
|
|
41
|
+
resolving$: BehaviorSubject<boolean>;
|
|
42
|
+
errors$: BehaviorSubject<DaffStateError[]>;
|
|
43
|
+
hasErrors$: BehaviorSubject<boolean>;
|
|
44
|
+
product$: BehaviorSubject<DaffProduct>;
|
|
45
|
+
dispatch(action: any): void;
|
|
46
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffProductPageFacade, never>;
|
|
47
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffProductPageFacade>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare class DaffProductStateTestingModule {
|
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductStateTestingModule, never>;
|
|
52
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffProductStateTestingModule, never, never, never>;
|
|
53
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffProductStateTestingModule>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { DaffProductStateTestingModule, MockDaffProductFacade, MockDaffProductGridFacade, MockDaffProductPageFacade };
|