@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
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Actions } from '@ngrx/effects';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { ErrorTransformer } from '@daffodil/core/state';
|
|
4
|
-
import { DaffProduct } from '@daffodil/product';
|
|
5
|
-
import { DaffProductServiceInterface } from '@daffodil/product/driver';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* Effects for handling product actions and for triggering corresponding service requests.
|
|
9
|
-
*
|
|
10
|
-
* @param action$ - Redux action object
|
|
11
|
-
* @param driver - A product service driver
|
|
12
|
-
*/
|
|
13
|
-
export declare class DaffProductPageEffects<T extends DaffProduct> {
|
|
14
|
-
private actions$;
|
|
15
|
-
private driver;
|
|
16
|
-
private errorMatcher;
|
|
17
|
-
constructor(actions$: Actions, driver: DaffProductServiceInterface<T>, errorMatcher: ErrorTransformer);
|
|
18
|
-
/**
|
|
19
|
-
* Handles ProductPageLoadAction by making a service call for a product and returning a success or
|
|
20
|
-
* failure action to the action stream.
|
|
21
|
-
*
|
|
22
|
-
* @returns An Observable of a ProductLoadAction
|
|
23
|
-
*/
|
|
24
|
-
load$: Observable<any>;
|
|
25
|
-
loadByUrl$: Observable<any>;
|
|
26
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductPageEffects<any>, never>;
|
|
27
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductPageEffects<any>>;
|
|
28
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Actions } from '@ngrx/effects';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { ErrorTransformer } from '@daffodil/core/state';
|
|
4
|
-
import { DaffProduct } from '@daffodil/product';
|
|
5
|
-
import { DaffProductServiceInterface } from '@daffodil/product/driver';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* Effects for handling product actions and for triggering corresponding service requests.
|
|
9
|
-
*
|
|
10
|
-
* @param action$ - Redux action object
|
|
11
|
-
* @param driver - A product service driver
|
|
12
|
-
*/
|
|
13
|
-
export declare class DaffProductEffects<T extends DaffProduct> {
|
|
14
|
-
private actions$;
|
|
15
|
-
private driver;
|
|
16
|
-
private errorMatcher;
|
|
17
|
-
constructor(actions$: Actions, driver: DaffProductServiceInterface<T>, errorMatcher: ErrorTransformer);
|
|
18
|
-
/**
|
|
19
|
-
* Handles ProductLoadAction by making a service call for a product and returning a success or
|
|
20
|
-
* failure action to the action stream.
|
|
21
|
-
*
|
|
22
|
-
* @returns An Observable of a ProductLoadAction
|
|
23
|
-
*/
|
|
24
|
-
load$: Observable<any>;
|
|
25
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductEffects<any>, never>;
|
|
26
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductEffects<any>>;
|
|
27
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Action } from '@ngrx/store';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { DaffStoreFacade } from '@daffodil/core/state';
|
|
4
|
-
import { DaffProduct } from '@daffodil/product';
|
|
5
|
-
/**
|
|
6
|
-
* A facade for getting state about a particular product.
|
|
7
|
-
*/
|
|
8
|
-
export interface DaffProductFacadeInterface<T extends DaffProduct = DaffProduct> extends DaffStoreFacade<Action> {
|
|
9
|
-
/**
|
|
10
|
-
* Get a product.
|
|
11
|
-
*
|
|
12
|
-
* @param id a product id
|
|
13
|
-
*/
|
|
14
|
-
getProduct(id: T['id']): Observable<T>;
|
|
15
|
-
/**
|
|
16
|
-
* Get the original price for a product.
|
|
17
|
-
*
|
|
18
|
-
* @param id a product id
|
|
19
|
-
*/
|
|
20
|
-
getPrice(id: T['id']): Observable<number>;
|
|
21
|
-
/**
|
|
22
|
-
* Whether a particular product has a discount.
|
|
23
|
-
*
|
|
24
|
-
* @param id a product id
|
|
25
|
-
*/
|
|
26
|
-
hasDiscount(id: T['id']): Observable<boolean>;
|
|
27
|
-
/**
|
|
28
|
-
* Get the discount amount of a product.
|
|
29
|
-
*
|
|
30
|
-
* @param id a product id
|
|
31
|
-
*/
|
|
32
|
-
getDiscountAmount(id: T['id']): Observable<number>;
|
|
33
|
-
/**
|
|
34
|
-
* Get the discounted price for a product.
|
|
35
|
-
*
|
|
36
|
-
* @param id a product id
|
|
37
|
-
*/
|
|
38
|
-
getDiscountedPrice(id: T['id']): Observable<number>;
|
|
39
|
-
/**
|
|
40
|
-
* Get the discount percent of a product.
|
|
41
|
-
*
|
|
42
|
-
* @param id a product id
|
|
43
|
-
*/
|
|
44
|
-
getDiscountPercent(id: T['id']): Observable<number>;
|
|
45
|
-
/**
|
|
46
|
-
* Whether a product is out of stock.
|
|
47
|
-
*
|
|
48
|
-
* @param id a product id
|
|
49
|
-
*/
|
|
50
|
-
isOutOfStock(id: T['id']): Observable<boolean>;
|
|
51
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Store, Action } from '@ngrx/store';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { DaffProduct } from '@daffodil/product';
|
|
4
|
-
import { DaffProductFacadeInterface } from './product-facade.interface';
|
|
5
|
-
import { DaffProductStateRootSlice } from '../../reducers/product-reducers-state.interface';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* A facade for getting state about a particular product.
|
|
9
|
-
*
|
|
10
|
-
* @inheritdoc
|
|
11
|
-
*/
|
|
12
|
-
export declare class DaffProductFacade<T extends DaffProduct = DaffProduct> implements DaffProductFacadeInterface<T> {
|
|
13
|
-
private store;
|
|
14
|
-
private selectors;
|
|
15
|
-
constructor(store: Store<DaffProductStateRootSlice<T>>);
|
|
16
|
-
getProduct(id: T['id']): Observable<T>;
|
|
17
|
-
getPrice(id: T['id']): Observable<number>;
|
|
18
|
-
hasDiscount(id: T['id']): Observable<boolean>;
|
|
19
|
-
getDiscountAmount(id: T['id']): Observable<number>;
|
|
20
|
-
getDiscountedPrice(id: T['id']): Observable<number>;
|
|
21
|
-
getDiscountPercent(id: T['id']): Observable<number>;
|
|
22
|
-
isOutOfStock(id: T['id']): Observable<boolean>;
|
|
23
|
-
dispatch(action: Action): void;
|
|
24
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductFacade<any>, never>;
|
|
25
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductFacade<any>>;
|
|
26
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Action } from '@ngrx/store';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { DaffStoreFacade } from '@daffodil/core/state';
|
|
4
|
-
import { DaffProduct } from '@daffodil/product';
|
|
5
|
-
export interface DaffProductGridFacadeInterface<T extends DaffProduct = DaffProduct> extends DaffStoreFacade<Action> {
|
|
6
|
-
/**
|
|
7
|
-
* The loading state for retrieving a list of products.
|
|
8
|
-
*/
|
|
9
|
-
loading$: Observable<boolean>;
|
|
10
|
-
/**
|
|
11
|
-
* The state for a list of products.
|
|
12
|
-
*/
|
|
13
|
-
products$: Observable<T[]>;
|
|
14
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Store, Action } from '@ngrx/store';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { DaffProduct } from '@daffodil/product';
|
|
4
|
-
import { DaffProductGridFacadeInterface } from './product-grid-facade.interface';
|
|
5
|
-
import { DaffProductStateRootSlice } from '../../reducers/product-reducers-state.interface';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* A facade for accessing state for a list of products from an application component.
|
|
9
|
-
*
|
|
10
|
-
* @inheritdoc
|
|
11
|
-
*/
|
|
12
|
-
export declare class DaffProductGridFacade<T extends DaffProduct = DaffProduct> implements DaffProductGridFacadeInterface<T> {
|
|
13
|
-
private store;
|
|
14
|
-
loading$: Observable<boolean>;
|
|
15
|
-
products$: Observable<T[]>;
|
|
16
|
-
constructor(store: Store<DaffProductStateRootSlice<T>>);
|
|
17
|
-
dispatch(action: Action): void;
|
|
18
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductGridFacade<any>, never>;
|
|
19
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductGridFacade<any>>;
|
|
20
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Store, Action } from '@ngrx/store';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { DaffState, DaffStateError } from '@daffodil/core/state';
|
|
4
|
-
import { DaffProduct } from '@daffodil/product';
|
|
5
|
-
import { DaffProductPageFacadeInterface } from './facade.interface';
|
|
6
|
-
import { DaffProductStateRootSlice } from '../../reducers/product-reducers-state.interface';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
/**
|
|
9
|
-
* A facade for getting state about a particular product.
|
|
10
|
-
*
|
|
11
|
-
* @inheritdoc
|
|
12
|
-
*/
|
|
13
|
-
export declare class DaffProductPageFacade<T extends DaffProduct = DaffProduct> implements DaffProductPageFacadeInterface<T> {
|
|
14
|
-
private store;
|
|
15
|
-
loadingState$: Observable<DaffState>;
|
|
16
|
-
loading$: Observable<boolean>;
|
|
17
|
-
mutating$: Observable<boolean>;
|
|
18
|
-
resolving$: Observable<boolean>;
|
|
19
|
-
errors$: Observable<DaffStateError[]>;
|
|
20
|
-
hasErrors$: Observable<boolean>;
|
|
21
|
-
product$: Observable<T>;
|
|
22
|
-
private selectors;
|
|
23
|
-
constructor(store: Store<DaffProductStateRootSlice<T>>);
|
|
24
|
-
dispatch(action: Action): void;
|
|
25
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductPageFacade<any>, never>;
|
|
26
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffProductPageFacade<any>>;
|
|
27
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { DaffOperationStateFacadeInterface } from '@daffodil/core/state';
|
|
3
|
-
import { DaffProduct } from '@daffodil/product';
|
|
4
|
-
import { DaffProductReducerState } from '../../reducers/public_api';
|
|
5
|
-
/**
|
|
6
|
-
* A facade for getting state about a particular product.
|
|
7
|
-
*/
|
|
8
|
-
export interface DaffProductPageFacadeInterface<T extends DaffProduct = DaffProduct> extends DaffOperationStateFacadeInterface<DaffProductReducerState> {
|
|
9
|
-
/**
|
|
10
|
-
* The product loaded for the product page.
|
|
11
|
-
*/
|
|
12
|
-
product$: Observable<T>;
|
|
13
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { DaffProductFacadeInterface } from './product/product-facade.interface';
|
|
2
|
-
export { DaffProductFacade } from './product/product.facade';
|
|
3
|
-
export { DaffProductPageFacadeInterface } from './product-page/facade.interface';
|
|
4
|
-
export { DaffProductPageFacade } from './product-page/facade';
|
|
5
|
-
export { DaffProductGridFacadeInterface } from './product-grid/product-grid-facade.interface';
|
|
6
|
-
export { DaffProductGridFacade } from './product-grid/product-grid.facade';
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { daffTransformErrorToStateError } from '@daffodil/core/state';
|
|
2
|
-
export declare const DAFF_PRODUCT_ERROR_MATCHER: import("@angular/core").InjectionToken<typeof daffTransformErrorToStateError>, provideDaffProductErrorMatcher: <R extends typeof daffTransformErrorToStateError = typeof daffTransformErrorToStateError>(value: R) => import("@angular/core").ValueProvider;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './error-matcher.token';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "@ngrx/store";
|
|
3
|
-
import * as i2 from "@ngrx/effects";
|
|
4
|
-
/**
|
|
5
|
-
* A module that provides the default reducers and effects for the product redux state.
|
|
6
|
-
*/
|
|
7
|
-
export declare class DaffProductStateModule {
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffProductStateModule, never>;
|
|
9
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffProductStateModule, never, [typeof i1.StoreFeatureModule, typeof i2.EffectsFeatureModule], never>;
|
|
10
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<DaffProductStateModule>;
|
|
11
|
-
}
|
package/state/public_api.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from './actions/public_api';
|
|
2
|
-
export * from './effects/public_api';
|
|
3
|
-
export * from './facades/public_api';
|
|
4
|
-
export * from './reducers/public_api';
|
|
5
|
-
export * from './selectors/public_api';
|
|
6
|
-
export * from './injection-tokens/public_api';
|
|
7
|
-
export { DaffProductStateModule } from './product-state.module';
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { StoreConfig } from '@ngrx/store';
|
|
2
|
-
import { DaffProductReducersState } from '../product-reducers-state.interface';
|
|
3
|
-
export declare const DAFF_PRODUCT_STORE_CONFIG: import("@angular/core").InjectionToken<StoreConfig<DaffProductReducersState<import("@daffodil/product").DaffProduct>, import("@ngrx/store").Action<string>>>, provideDaffProductStoreConfig: <R extends StoreConfig<DaffProductReducersState<import("@daffodil/product").DaffProduct>, import("@ngrx/store").Action<string>> = StoreConfig<DaffProductReducersState<import("@daffodil/product").DaffProduct>, import("@ngrx/store").Action<string>>>(value: R) => import("@angular/core").ValueProvider;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ActionReducer } from '@ngrx/store';
|
|
2
|
-
import { DaffProductReducersState } from '../product-reducers-state.interface';
|
|
3
|
-
export declare const DAFF_PRODUCT_EXTRA_REDUCERS: import("@angular/core").InjectionToken<ActionReducer<DaffProductReducersState<import("@daffodil/product").DaffProduct>, import("@ngrx/store").Action<string>>[]>, daffProductProvideExtraReducers: <R extends ActionReducer<DaffProductReducersState<import("@daffodil/product").DaffProduct>, import("@ngrx/store").Action<string>> = ActionReducer<DaffProductReducersState<import("@daffodil/product").DaffProduct>, import("@ngrx/store").Action<string>>>(...values: R[]) => Array<import("@angular/core").ValueProvider>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { MetaReducer } from '@ngrx/store';
|
|
2
|
-
import { DaffProductReducersState } from '../product-reducers-state.interface';
|
|
3
|
-
export declare const DAFF_PRODUCT_META_REDUCERS: import("@angular/core").InjectionToken<MetaReducer<DaffProductReducersState<import("@daffodil/product").DaffProduct>>[]>, daffProductProvideMetaReducers: <R extends MetaReducer<DaffProductReducersState<import("@daffodil/product").DaffProduct>> = MetaReducer<DaffProductReducersState<import("@daffodil/product").DaffProduct>>>(...values: R[]) => Array<import("@angular/core").ValueProvider>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ActionReducer } from '@ngrx/store';
|
|
2
|
-
import { DaffProductReducersState } from '../product-reducers-state.interface';
|
|
3
|
-
export declare const DAFF_PRODUCT_REDUCERS: import("@angular/core").InjectionToken<ActionReducer<DaffProductReducersState<import("@daffodil/product").DaffProduct>, import("@ngrx/store").Action<string>>>, provideDaffProductReducers: <R extends ActionReducer<DaffProductReducersState<import("@daffodil/product").DaffProduct>, import("@ngrx/store").Action<string>> = ActionReducer<DaffProductReducersState<import("@daffodil/product").DaffProduct>, import("@ngrx/store").Action<string>>>(value: R) => import("@angular/core").ValueProvider;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DaffOperationState } from '@daffodil/core/state';
|
|
2
|
-
import { DaffProduct } from '@daffodil/product';
|
|
3
|
-
/**
|
|
4
|
-
* An interface describing product redux state. This state describes the current product that is loaded for a product page.
|
|
5
|
-
*/
|
|
6
|
-
export interface DaffProductReducerState extends DaffOperationState {
|
|
7
|
-
/**
|
|
8
|
-
* The id of the current product.
|
|
9
|
-
*/
|
|
10
|
-
currentProductId: DaffProduct['id'];
|
|
11
|
-
/**
|
|
12
|
-
* The quantity chosen for the current product.
|
|
13
|
-
*/
|
|
14
|
-
qty: number;
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DaffProduct } from '@daffodil/product';
|
|
2
|
-
import { DaffProductReducerState } from './product-reducer-state.interface';
|
|
3
|
-
import { DaffProductPageActions } from '../../actions/public_api';
|
|
4
|
-
/**
|
|
5
|
-
* Initial values of the product state.
|
|
6
|
-
*/
|
|
7
|
-
export declare const daffProductReducerInitialState: DaffProductReducerState;
|
|
8
|
-
/**
|
|
9
|
-
* Reducer function that catches actions and changes/overwrites product state.
|
|
10
|
-
*
|
|
11
|
-
* @param state current State of the redux store
|
|
12
|
-
* @param action a product action
|
|
13
|
-
* @returns product state
|
|
14
|
-
*/
|
|
15
|
-
export declare function daffProductReducer<T extends DaffProduct>(state: DaffProductReducerState, action: DaffProductPageActions<T>): DaffProductReducerState;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EntityState } from '@ngrx/entity';
|
|
2
|
-
import { DaffProduct } from '@daffodil/product';
|
|
3
|
-
import { DaffProductGridActions, DaffProductActions, DaffProductPageActions } from '../../actions/public_api';
|
|
4
|
-
/**
|
|
5
|
-
* Reducer function that catches actions and changes/overwrites product entities state.
|
|
6
|
-
*
|
|
7
|
-
* @param state current State of the redux store
|
|
8
|
-
* @param action ProductGrid, BestSellers, or Product actions
|
|
9
|
-
* @returns Product entities state
|
|
10
|
-
*/
|
|
11
|
-
export declare function daffProductEntitiesReducer<T extends DaffProduct>(state: EntityState<T>, action: DaffProductGridActions<T> | DaffProductActions<T> | DaffProductPageActions<T>): EntityState<T>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { DaffStateError } from '@daffodil/core/state';
|
|
2
|
-
import { DaffProduct } from '@daffodil/product';
|
|
3
|
-
/**
|
|
4
|
-
* Interface for product grid redux state.
|
|
5
|
-
*/
|
|
6
|
-
export interface DaffProductGridReducerState<T extends DaffProduct = DaffProduct> {
|
|
7
|
-
/**
|
|
8
|
-
* The array of products that have already been loaded.
|
|
9
|
-
*/
|
|
10
|
-
products: T[];
|
|
11
|
-
/**
|
|
12
|
-
* Whether a grid of products is loading.
|
|
13
|
-
*/
|
|
14
|
-
loading: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Errors associated with loading a grid of products.
|
|
17
|
-
*/
|
|
18
|
-
errors: DaffStateError[];
|
|
19
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DaffProduct } from '@daffodil/product';
|
|
2
|
-
import { DaffProductGridReducerState } from './product-grid-reducer-state.interface';
|
|
3
|
-
import { DaffProductGridActions } from '../../actions/public_api';
|
|
4
|
-
/**
|
|
5
|
-
* Initial values of the product grid state.
|
|
6
|
-
*/
|
|
7
|
-
export declare const initialState: DaffProductGridReducerState<any>;
|
|
8
|
-
/**
|
|
9
|
-
* Reducer function that catches actions and changes/overwrites product grid state.
|
|
10
|
-
*
|
|
11
|
-
* @param state current State of the redux store
|
|
12
|
-
* @param action a product grid action
|
|
13
|
-
* @returns Product grid state
|
|
14
|
-
*/
|
|
15
|
-
export declare function daffProductGridReducer<T extends DaffProduct>(state: DaffProductGridReducerState<any>, action: DaffProductGridActions<T>): DaffProductGridReducerState<T>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { EntityState } from '@ngrx/entity';
|
|
2
|
-
import { DaffProduct } from '@daffodil/product';
|
|
3
|
-
import { DaffProductReducerState } from './product/product-reducer-state.interface';
|
|
4
|
-
import { DaffProductGridReducerState } from './product-grid/product-grid-reducer-state.interface';
|
|
5
|
-
import { DAFF_PRODUCT_STORE_FEATURE_KEY } from './product-store-feature-key';
|
|
6
|
-
/**
|
|
7
|
-
* Interface for the redux store of the product feature area.
|
|
8
|
-
*/
|
|
9
|
-
export interface DaffProductReducersState<T extends DaffProduct = DaffProduct> {
|
|
10
|
-
products: EntityState<T>;
|
|
11
|
-
productGrid: DaffProductGridReducerState<T>;
|
|
12
|
-
product: DaffProductReducerState;
|
|
13
|
-
}
|
|
14
|
-
export interface DaffProductStateRootSlice<T extends DaffProduct = DaffProduct> {
|
|
15
|
-
[DAFF_PRODUCT_STORE_FEATURE_KEY]: DaffProductReducersState<T>;
|
|
16
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ActionReducerMap } from '@ngrx/store';
|
|
2
|
-
import { DaffProductReducersState } from './product-reducers-state.interface';
|
|
3
|
-
/**
|
|
4
|
-
* Returns state values from all product related reducers.
|
|
5
|
-
*/
|
|
6
|
-
export declare const daffProductReducers: ActionReducerMap<DaffProductReducersState>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const DAFF_PRODUCT_STORE_FEATURE_KEY = "daffProduct";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { daffProductReducers } from './product-reducers';
|
|
2
|
-
export { DaffProductReducersState, DaffProductStateRootSlice, } from './product-reducers-state.interface';
|
|
3
|
-
export { DaffProductGridReducerState } from './product-grid/product-grid-reducer-state.interface';
|
|
4
|
-
export { daffProductGridReducer } from './product-grid/product-grid.reducer';
|
|
5
|
-
export { daffProductEntitiesAdapter } from './product-entities/product-entities-reducer-adapter';
|
|
6
|
-
export { daffProductEntitiesReducer } from './product-entities/product-entities.reducer';
|
|
7
|
-
export { DaffProductReducerState } from './product/product-reducer-state.interface';
|
|
8
|
-
export { daffProductReducer, daffProductReducerInitialState, } from './product/product.reducer';
|
|
9
|
-
export { DAFF_PRODUCT_STORE_FEATURE_KEY } from './product-store-feature-key';
|
|
10
|
-
export * from './injection-tokens/public_api';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DaffProduct } from '@daffodil/product';
|
|
2
|
-
import { DaffProductPageMemoizedSelectors } from './product/product.selectors';
|
|
3
|
-
import { DaffProductEntitiesMemoizedSelectors } from './product-entities/product-entities.selectors';
|
|
4
|
-
import { DaffProductFeatureMemoizedSelector } from './product-feature.selector';
|
|
5
|
-
import { DaffProductGridMemoizedSelectors } from './product-grid/product-grid.selectors';
|
|
6
|
-
/**
|
|
7
|
-
* An interface for all selectors in the entire product feature area.
|
|
8
|
-
*/
|
|
9
|
-
export interface DaffProductAllSelectors<T extends DaffProduct = DaffProduct> extends DaffProductPageMemoizedSelectors<T>, DaffProductEntitiesMemoizedSelectors<T>, DaffProductGridMemoizedSelectors<T>, DaffProductFeatureMemoizedSelector<T> {
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* A function that returns all selectors in the entire product feature area.
|
|
13
|
-
* Returns {@link DaffProductAllSelectors}.
|
|
14
|
-
*/
|
|
15
|
-
export declare const getDaffProductSelectors: <T extends DaffProduct = DaffProduct>() => DaffProductAllSelectors<T>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { MemoizedSelector } from '@ngrx/store';
|
|
2
|
-
import { DaffOperationStateSelectors } from '@daffodil/core/state';
|
|
3
|
-
import { DaffProduct } from '@daffodil/product';
|
|
4
|
-
import { DaffProductReducerState } from '../../reducers/product/product-reducer-state.interface';
|
|
5
|
-
import { DaffProductStateRootSlice } from '../../reducers/product-reducers-state.interface';
|
|
6
|
-
/**
|
|
7
|
-
* An interface for selectors related to the current product page.
|
|
8
|
-
*/
|
|
9
|
-
export interface DaffProductPageMemoizedSelectors<T extends DaffProduct = DaffProduct> extends DaffOperationStateSelectors<DaffProductStateRootSlice, DaffProductReducerState> {
|
|
10
|
-
/**
|
|
11
|
-
* Selects the entire state object for the product page feature area.
|
|
12
|
-
*/
|
|
13
|
-
selectCurrentProductState: MemoizedSelector<DaffProductStateRootSlice, DaffProductReducerState>;
|
|
14
|
-
/**
|
|
15
|
-
* Selects the id of the current product.
|
|
16
|
-
*/
|
|
17
|
-
selectCurrentProductId: MemoizedSelector<DaffProductStateRootSlice, T['id']>;
|
|
18
|
-
/**
|
|
19
|
-
* Selects the current product, which is the product loaded for a product page.
|
|
20
|
-
*/
|
|
21
|
-
selectCurrentProduct: MemoizedSelector<DaffProductStateRootSlice, T>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* A function that returns all selectors related to the product page.
|
|
25
|
-
* Returns {@link DaffProductPageMemoizedSelectors}.
|
|
26
|
-
*/
|
|
27
|
-
export declare const getDaffProductPageSelectors: <T extends DaffProduct>() => DaffProductPageMemoizedSelectors<T>;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { EntityState } from '@ngrx/entity';
|
|
2
|
-
import { MemoizedSelector } from '@ngrx/store';
|
|
3
|
-
import { DaffProduct } from '@daffodil/product';
|
|
4
|
-
import { DaffProductStateRootSlice } from '../../reducers/product-reducers-state.interface';
|
|
5
|
-
/**
|
|
6
|
-
* An interface for selectors related to product entities and prices for simple products.
|
|
7
|
-
*/
|
|
8
|
-
export interface DaffProductEntitiesMemoizedSelectors<T extends DaffProduct = DaffProduct> {
|
|
9
|
-
/**
|
|
10
|
-
* Selects the ngrx entities state for products.
|
|
11
|
-
*/
|
|
12
|
-
selectProductEntitiesState: MemoizedSelector<DaffProductStateRootSlice<T>, EntityState<T>>;
|
|
13
|
-
/**
|
|
14
|
-
* Selects all ids for products in state.
|
|
15
|
-
*/
|
|
16
|
-
selectProductIds: MemoizedSelector<DaffProductStateRootSlice<T>, EntityState<T>['ids']>;
|
|
17
|
-
/**
|
|
18
|
-
* Selects the ngrx entities for all products in state.
|
|
19
|
-
*/
|
|
20
|
-
selectProductEntities: MemoizedSelector<DaffProductStateRootSlice<T>, EntityState<T>['entities']>;
|
|
21
|
-
/**
|
|
22
|
-
* Selects all products in state as an array.
|
|
23
|
-
*/
|
|
24
|
-
selectAllProducts: MemoizedSelector<DaffProductStateRootSlice<T>, T[]>;
|
|
25
|
-
/**
|
|
26
|
-
* Selects the total number of products in state.
|
|
27
|
-
*/
|
|
28
|
-
selectProductTotal: MemoizedSelector<DaffProductStateRootSlice<T>, number>;
|
|
29
|
-
/**
|
|
30
|
-
* Selects a product by id.
|
|
31
|
-
*
|
|
32
|
-
* @param productId the id of the product.
|
|
33
|
-
*/
|
|
34
|
-
selectProduct: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, T>;
|
|
35
|
-
/**
|
|
36
|
-
* Selects the price of a product.
|
|
37
|
-
*
|
|
38
|
-
* @param productId the id of the product.
|
|
39
|
-
*/
|
|
40
|
-
selectProductPrice: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number>;
|
|
41
|
-
/**
|
|
42
|
-
* Selects the discount of a product as some amount of currency.
|
|
43
|
-
*
|
|
44
|
-
* @param productId the id of the product.
|
|
45
|
-
*/
|
|
46
|
-
selectProductDiscountAmount: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number>;
|
|
47
|
-
/**
|
|
48
|
-
* Selects the discounted price of a product.
|
|
49
|
-
*
|
|
50
|
-
* @param productId the id of the product.
|
|
51
|
-
*/
|
|
52
|
-
selectProductDiscountedPrice: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number>;
|
|
53
|
-
/**
|
|
54
|
-
* Selects the discount of a product as a percent of the original price.
|
|
55
|
-
*
|
|
56
|
-
* @param productId the id of the product.
|
|
57
|
-
*/
|
|
58
|
-
selectProductDiscountPercent: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, number>;
|
|
59
|
-
/**
|
|
60
|
-
* Selects whether or not the product has a discount.
|
|
61
|
-
*
|
|
62
|
-
* @param productId the id of the product.
|
|
63
|
-
*/
|
|
64
|
-
selectProductHasDiscount: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, boolean>;
|
|
65
|
-
/**
|
|
66
|
-
* Selects whether or not a product is out of stock.
|
|
67
|
-
*
|
|
68
|
-
* @param productId the id of the product.
|
|
69
|
-
*/
|
|
70
|
-
selectIsProductOutOfStock: (productId: T['id']) => MemoizedSelector<DaffProductStateRootSlice<T>, boolean>;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* A function that returns all selectors related to product entities and simple product prices.
|
|
74
|
-
*/
|
|
75
|
-
export declare const getDaffProductEntitiesSelectors: <T extends DaffProduct>() => DaffProductEntitiesMemoizedSelectors<T>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MemoizedSelector } from '@ngrx/store';
|
|
2
|
-
import { DaffProduct } from '@daffodil/product';
|
|
3
|
-
import { DaffProductReducersState } from '../reducers/product-reducers-state.interface';
|
|
4
|
-
/**
|
|
5
|
-
* An interface for the entire product feature state.
|
|
6
|
-
*/
|
|
7
|
-
export interface DaffProductFeatureMemoizedSelector<T extends DaffProduct = DaffProduct> {
|
|
8
|
-
selectProductState: MemoizedSelector<Record<string, any>, DaffProductReducersState<T>>;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* A function that returns a selector for the entire product feature state.
|
|
12
|
-
*/
|
|
13
|
-
export declare const getDaffProductFeatureSelector: <T extends DaffProduct>() => DaffProductFeatureMemoizedSelector<T>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { MemoizedSelector } from '@ngrx/store';
|
|
2
|
-
import { DaffProduct } from '@daffodil/product';
|
|
3
|
-
import { DaffProductGridReducerState } from '../../reducers/product-grid/product-grid-reducer-state.interface';
|
|
4
|
-
import { DaffProductStateRootSlice } from '../../reducers/product-reducers-state.interface';
|
|
5
|
-
/**
|
|
6
|
-
* An interface for selectors related to loading a grid of products.
|
|
7
|
-
*/
|
|
8
|
-
export interface DaffProductGridMemoizedSelectors<T extends DaffProduct = DaffProduct> {
|
|
9
|
-
/**
|
|
10
|
-
* Selects the redux state for the product grid feature area. Returns {@link DaffProductGridReducerState}.
|
|
11
|
-
*/
|
|
12
|
-
selectProductGridState: MemoizedSelector<DaffProductStateRootSlice<T>, DaffProductGridReducerState<T>>;
|
|
13
|
-
/**
|
|
14
|
-
* Selects whether any product grid requests are loading.
|
|
15
|
-
*/
|
|
16
|
-
selectProductGridLoadingState: MemoizedSelector<DaffProductStateRootSlice<T>, boolean>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* A function that returns all selectors related to loading a grid of products.
|
|
20
|
-
* Returns {@link DaffProductGridMemoizedSelectors}.
|
|
21
|
-
*/
|
|
22
|
-
export declare const getDaffProductGridSelectors: <T extends DaffProduct>() => DaffProductGridMemoizedSelectors<T>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { BehaviorSubject } from 'rxjs';
|
|
2
|
-
import { DaffProduct } from '@daffodil/product';
|
|
3
|
-
import { DaffProductFacadeInterface } from '@daffodil/product/state';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
/**
|
|
6
|
-
* @inheritdoc
|
|
7
|
-
*/
|
|
8
|
-
export declare class MockDaffProductFacade implements DaffProductFacadeInterface {
|
|
9
|
-
getProduct(id: DaffProduct['id']): BehaviorSubject<DaffProduct>;
|
|
10
|
-
getPrice(id: DaffProduct['id']): BehaviorSubject<number>;
|
|
11
|
-
hasDiscount(id: DaffProduct['id']): BehaviorSubject<boolean>;
|
|
12
|
-
getDiscountAmount(id: DaffProduct['id']): BehaviorSubject<number>;
|
|
13
|
-
getDiscountedPrice(id: DaffProduct['id']): BehaviorSubject<number>;
|
|
14
|
-
getDiscountPercent(id: DaffProduct['id']): BehaviorSubject<number>;
|
|
15
|
-
isOutOfStock(id: DaffProduct['id']): BehaviorSubject<boolean>;
|
|
16
|
-
dispatch(action: any): void;
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffProductFacade, never>;
|
|
18
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffProductFacade>;
|
|
19
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BehaviorSubject } from 'rxjs';
|
|
2
|
-
import { DaffProduct } from '@daffodil/product';
|
|
3
|
-
import { DaffProductGridFacadeInterface } from '@daffodil/product/state';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
/**
|
|
6
|
-
* @inheritdoc
|
|
7
|
-
*/
|
|
8
|
-
export declare class MockDaffProductGridFacade implements DaffProductGridFacadeInterface {
|
|
9
|
-
loading$: BehaviorSubject<boolean>;
|
|
10
|
-
products$: BehaviorSubject<DaffProduct[]>;
|
|
11
|
-
dispatch(action: any): void;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffProductGridFacade, never>;
|
|
13
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffProductGridFacade>;
|
|
14
|
-
}
|