@daffodil/core 0.88.1 → 0.89.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/external-script/index.d.ts +95 -1
- package/external-script/testing/index.d.ts +44 -1
- package/fesm2022/daffodil-core-external-script-testing.mjs +3 -3
- package/fesm2022/daffodil-core-external-script-testing.mjs.map +1 -1
- package/fesm2022/daffodil-core-external-script.mjs +4 -5
- package/fesm2022/daffodil-core-external-script.mjs.map +1 -1
- package/fesm2022/daffodil-core-graphql.mjs +3 -3
- package/fesm2022/daffodil-core-graphql.mjs.map +1 -1
- package/fesm2022/daffodil-core-routing.mjs +3 -3
- package/fesm2022/daffodil-core-routing.mjs.map +1 -1
- package/fesm2022/daffodil-core-state-testing.mjs +6 -6
- package/fesm2022/daffodil-core-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-core-state.mjs +2 -0
- package/fesm2022/daffodil-core-state.mjs.map +1 -1
- package/fesm2022/daffodil-core-testing.mjs +67 -67
- package/fesm2022/daffodil-core-testing.mjs.map +1 -1
- package/fesm2022/daffodil-core.mjs +51 -21
- package/fesm2022/daffodil-core.mjs.map +1 -1
- package/graphql/index.d.ts +64 -1
- package/index.d.ts +1305 -1
- package/package.json +1 -1
- package/routing/index.d.ts +86 -1
- package/state/index.d.ts +649 -1
- package/state/testing/index.d.ts +46 -1
- package/testing/index.d.ts +363 -1
- package/async/maybe.type.d.ts +0 -2
- package/base64/base64.interface.d.ts +0 -14
- package/base64/browser/browser.service.d.ts +0 -12
- package/base64/public_api.d.ts +0 -3
- package/base64/server/public_api.d.ts +0 -1
- package/base64/server/server.service.d.ts +0 -14
- package/canonically-locateable/canonically-locateable.interface.d.ts +0 -9
- package/collection/build-metadata.d.ts +0 -6
- package/collection/build-request.d.ts +0 -6
- package/collection/collection.interface.d.ts +0 -16
- package/collection/countable.interface.d.ts +0 -9
- package/collection/error-map.d.ts +0 -4
- package/collection/metadata.interface.d.ts +0 -12
- package/collection/page-out-of-bounds.error.d.ts +0 -9
- package/collection/paginable.d.ts +0 -10
- package/collection/public_api.d.ts +0 -10
- package/collection/request.interface.d.ts +0 -27
- package/collection/sortable.d.ts +0 -41
- package/constructable/constructable.d.ts +0 -24
- package/decorators/debounce.decorator.d.ts +0 -47
- package/decorators/public_api.d.ts +0 -1
- package/errors/error-map.d.ts +0 -8
- package/errors/error.interface.d.ts +0 -17
- package/errors/inheritable-error.d.ts +0 -22
- package/errors/is-error.d.ts +0 -4
- package/errors/public_api.d.ts +0 -4
- package/external-script/external-script.service.d.ts +0 -50
- package/external-script/interface.d.ts +0 -11
- package/external-script/public_api.d.ts +0 -3
- package/external-script/script.d.ts +0 -32
- package/external-script/testing/constants.d.ts +0 -4
- package/external-script/testing/external-script.service.d.ts +0 -37
- package/external-script/testing/public_api.d.ts +0 -2
- package/filterable/filter-base.d.ts +0 -24
- package/filterable/filter-option-base.d.ts +0 -9
- package/filterable/filter-option.d.ts +0 -6
- package/filterable/filter-request.d.ts +0 -7
- package/filterable/filter-toggle-request.d.ts +0 -6
- package/filterable/filter.d.ts +0 -9
- package/filterable/filterable.d.ts +0 -10
- package/filterable/filters.type.d.ts +0 -5
- package/filterable/public_api.d.ts +0 -12
- package/filterable/type/equal/filter.d.ts +0 -24
- package/filterable/type/equal/option.d.ts +0 -19
- package/filterable/type/equal/public_api.d.ts +0 -4
- package/filterable/type/equal/request.d.ts +0 -18
- package/filterable/type/equal/toggle-request.d.ts +0 -18
- package/filterable/type/filter-type.d.ts +0 -7
- package/filterable/type/range/filter-base.d.ts +0 -23
- package/filterable/type/range/option.d.ts +0 -14
- package/filterable/type/range/pair.d.ts +0 -20
- package/filterable/type/range/public_api.d.ts +0 -6
- package/filterable/type/range/request-base.d.ts +0 -20
- package/filterable/type/range/request-option.d.ts +0 -14
- package/filterable/type/range/separator.d.ts +0 -5
- package/filterable/type/range-numeric/filter.d.ts +0 -11
- package/filterable/type/range-numeric/public_api.d.ts +0 -3
- package/filterable/type/range-numeric/request.d.ts +0 -11
- package/filterable/type/range-numeric/toggle-request.d.ts +0 -12
- package/filters/array-to-dict/array-to-dict.d.ts +0 -5
- package/filters/behaviors/apply/apply-filter.d.ts +0 -8
- package/filters/behaviors/apply/apply-request-to-filters.d.ts +0 -8
- package/filters/behaviors/apply/apply-requests-to-filters.d.ts +0 -8
- package/filters/behaviors/apply/public_api.d.ts +0 -3
- package/filters/behaviors/clear/clear-filter.d.ts +0 -8
- package/filters/behaviors/clear/clear-filters.d.ts +0 -8
- package/filters/behaviors/clear/public_api.d.ts +0 -2
- package/filters/behaviors/remove/public_api.d.ts +0 -3
- package/filters/behaviors/remove/remove-filter.d.ts +0 -9
- package/filters/behaviors/remove/remove-request-from-filters.d.ts +0 -8
- package/filters/behaviors/remove/remove-requests-from-filters.d.ts +0 -9
- package/filters/behaviors/toggle/public_api.d.ts +0 -2
- package/filters/behaviors/toggle/toggle-request-on-filters.d.ts +0 -6
- package/filters/behaviors/toggle/toggle.d.ts +0 -6
- package/filters/compute-applied-filters/compute-applied-filters.d.ts +0 -6
- package/filters/errors/codes.enum.d.ts +0 -9
- package/filters/errors/filter-not-found.error.d.ts +0 -8
- package/filters/errors/public_api.d.ts +0 -4
- package/filters/errors/request-name-mismatch.error.d.ts +0 -9
- package/filters/errors/request-type-mismatch.error.d.ts +0 -9
- package/filters/errors/unknown-filter-type.error.d.ts +0 -9
- package/filters/find-applied/find-applied-options.d.ts +0 -5
- package/filters/find-applied/public_api.d.ts +0 -1
- package/filters/is-applied/is-filter-applied.d.ts +0 -5
- package/filters/is-applied/is-toggle-request-applied-to-filter.d.ts +0 -5
- package/filters/is-applied/public_api.d.ts +0 -2
- package/filters/public_api.d.ts +0 -13
- package/filters/to-request/filter-to-request.d.ts +0 -6
- package/filters/to-request/filters-to-requests.d.ts +0 -6
- package/filters/to-request/public_api.d.ts +0 -2
- package/filters/type/equal/array-to-dict/option.d.ts +0 -5
- package/filters/type/equal/behaviors/apply/apply.d.ts +0 -8
- package/filters/type/equal/behaviors/clear/clear.d.ts +0 -8
- package/filters/type/equal/behaviors/remove/remove.d.ts +0 -11
- package/filters/type/equal/behaviors/toggle/toggle.d.ts +0 -11
- package/filters/type/equal/is-applied/is-applied.d.ts +0 -5
- package/filters/type/equal/is-applied/is-toggle-request-applied-to-filter.d.ts +0 -5
- package/filters/type/equal/public_api.d.ts +0 -1
- package/filters/type/equal/to-request/filter-to-request.d.ts +0 -5
- package/filters/type/range/array-to-dict/pair.d.ts +0 -5
- package/filters/type/range/behaviors/apply/apply.d.ts +0 -8
- package/filters/type/range/behaviors/clear/clear.d.ts +0 -8
- package/filters/type/range/behaviors/remove/remove.d.ts +0 -11
- package/filters/type/range/behaviors/toggle/toggle.d.ts +0 -10
- package/filters/type/range/compute-pair-label.d.ts +0 -1
- package/filters/type/range/is-applied/is-applied.d.ts +0 -5
- package/filters/type/range/is-applied/is-toggle-request-applied-to-filter.d.ts +0 -5
- package/filters/type/range/public_api.d.ts +0 -2
- package/filters/type/range/to-request/filter-to-request.d.ts +0 -5
- package/filters/type/range-numeric/to-request/filter-to-request.d.ts +0 -5
- package/filters/validators/public_api.d.ts +0 -2
- package/filters/validators/request-name-match.d.ts +0 -7
- package/filters/validators/request-type-match.d.ts +0 -7
- package/graphql/apollo/cacheable-operations/cacheable-operations-link.interface.d.ts +0 -4
- package/graphql/apollo/public_api.d.ts +0 -3
- package/graphql/apollo/queued-apollo/queued-apollo.service.d.ts +0 -29
- package/graphql/apollo/validator/type.d.ts +0 -8
- package/graphql/fragments/build-fragment-definition.d.ts +0 -8
- package/graphql/fragments/build-fragment-name-spread.d.ts +0 -11
- package/graphql/fragments/public_api.d.ts +0 -2
- package/graphql/public_api.d.ts +0 -2
- package/identifiable/array-to-dict.d.ts +0 -5
- package/identifiable/identifiable.interface.d.ts +0 -10
- package/identifiable/public_api.d.ts +0 -2
- package/injection-tokens/config.factory.d.ts +0 -9
- package/injection-tokens/config.type.d.ts +0 -18
- package/injection-tokens/multi.factory.d.ts +0 -8
- package/injection-tokens/multi.type.d.ts +0 -15
- package/injection-tokens/public_api.d.ts +0 -10
- package/injection-tokens/services.factory.d.ts +0 -8
- package/injection-tokens/services.type.d.ts +0 -15
- package/injection-tokens/single.factory.d.ts +0 -8
- package/injection-tokens/single.type.d.ts +0 -14
- package/injection-tokens/singleton.factory.d.ts +0 -8
- package/injection-tokens/singleton.type.d.ts +0 -15
- package/injection-tokens/token-constuctor-params.type.d.ts +0 -3
- package/kindable/kindable.interface.d.ts +0 -9
- package/kindable/public_api.d.ts +0 -1
- package/locateable/locateable.interface.d.ts +0 -10
- package/merge/merge.d.ts +0 -64
- package/merge/mergers/array-concat.d.ts +0 -1
- package/merge/mergers/dict-assign.d.ts +0 -1
- package/merge/mergers/public_api.d.ts +0 -3
- package/merge/mergers/type.d.ts +0 -4
- package/merge/public_api.d.ts +0 -3
- package/merge/strategy.type.d.ts +0 -8
- package/operators/all-of.pipe.d.ts +0 -6
- package/operators/any-of.pipe.d.ts +0 -6
- package/operators/backoff.pipe.d.ts +0 -7
- package/operators/catch-and-arrayify-errors.pipe.d.ts +0 -6
- package/operators/public_api.d.ts +0 -4
- package/orderable/orderable.d.ts +0 -9
- package/public_api.d.ts +0 -20
- package/routing/public_api.d.ts +0 -2
- package/routing/query-param-filter/public_api.d.ts +0 -2
- package/routing/query-param-filter/request-builder/equal.d.ts +0 -6
- package/routing/query-param-filter/request-builder/public_api.d.ts +0 -2
- package/routing/query-param-filter/request-builder/type.d.ts +0 -6
- package/routing/query-param-filter/type.d.ts +0 -16
- package/routing/uri/normalizer.service.d.ts +0 -22
- package/routing/uri/public_api.d.ts +0 -2
- package/routing/uri/truncation/file-extension.d.ts +0 -9
- package/routing/uri/truncation/leading-path-segments.d.ts +0 -5
- package/routing/uri/truncation/leading-slash.d.ts +0 -11
- package/routing/uri/truncation/public_api.d.ts +0 -4
- package/routing/uri/truncation/query-fragment.d.ts +0 -5
- package/state/actions/failure.type.d.ts +0 -13
- package/state/actions/public_api.d.ts +0 -1
- package/state/collection/actions.d.ts +0 -73
- package/state/collection/adapter.class.d.ts +0 -35
- package/state/collection/facade.d.ts +0 -34
- package/state/collection/facade.interface.d.ts +0 -54
- package/state/collection/initial-state.d.ts +0 -2
- package/state/collection/public_api.d.ts +0 -6
- package/state/collection/selector-factory.d.ts +0 -62
- package/state/errors/errorable.type.d.ts +0 -7
- package/state/errors/public_api.d.ts +0 -3
- package/state/errors/state-error.interface.d.ts +0 -18
- package/state/errors/transform-error-to-state-error.d.ts +0 -7
- package/state/operation/adapter.d.ts +0 -24
- package/state/operation/entity/adapter.d.ts +0 -84
- package/state/operation/entity/helpers/create-fake-id.d.ts +0 -7
- package/state/operation/entity/public_api.d.ts +0 -5
- package/state/operation/entity/selectors.d.ts +0 -24
- package/state/operation/entity/state.type.d.ts +0 -8
- package/state/operation/entity/type.d.ts +0 -15
- package/state/operation/facade.type.d.ts +0 -34
- package/state/operation/public_api.d.ts +0 -5
- package/state/operation/selectors.d.ts +0 -38
- package/state/operation/state.d.ts +0 -9
- package/state/operators/public_api.d.ts +0 -1
- package/state/operators/substream.pipe.d.ts +0 -26
- package/state/public_api.d.ts +0 -8
- package/state/reducers/create-meta.d.ts +0 -5
- package/state/reducers/identity.d.ts +0 -6
- package/state/reducers/public_api.d.ts +0 -2
- package/state/states/helpers.d.ts +0 -9
- package/state/states/loading.d.ts +0 -5
- package/state/states/mutable-loading.d.ts +0 -6
- package/state/states/public_api.d.ts +0 -5
- package/state/states/state.enum.d.ts +0 -48
- package/state/states/stateable.interface.d.ts +0 -8
- package/state/store/facade.d.ts +0 -3
- package/state/testing/mock-collection-facade.d.ts +0 -26
- package/state/testing/mock-operation-facade.d.ts +0 -20
- package/state/testing/public_api.d.ts +0 -2
- package/storage/error/error.d.ts +0 -7
- package/storage/error/error.service.d.ts +0 -15
- package/storage/error/public_api.d.ts +0 -2
- package/storage/localstorage/localstorage.service.d.ts +0 -23
- package/storage/noopstorage/noopstorage.service.d.ts +0 -13
- package/storage/persistence-server-safe.token.d.ts +0 -2
- package/storage/persistence.interface.d.ts +0 -7
- package/storage/public_api.d.ts +0 -6
- package/storage/server-error/public_api.d.ts +0 -2
- package/storage/server-error/server-error.d.ts +0 -11
- package/storage/server-error/server-error.service.d.ts +0 -18
- package/testing/angular/mocks/pipes/currency.d.ts +0 -13
- package/testing/factories/collection/metadata.factory.d.ts +0 -29
- package/testing/factories/collection/mock-collection.class.d.ts +0 -18
- package/testing/factories/collection/numerically-paginable.factory.d.ts +0 -8
- package/testing/factories/collection/public_api.d.ts +0 -7
- package/testing/factories/collection/request.factory.d.ts +0 -25
- package/testing/factories/collection/sort-option.factory.d.ts +0 -8
- package/testing/factories/collection/sort-options.factory.d.ts +0 -9
- package/testing/factories/collection/sortable.factory.d.ts +0 -9
- package/testing/factories/factory.d.ts +0 -42
- package/testing/factories/factory.interface.d.ts +0 -4
- package/testing/factories/filters/filter.factory.d.ts +0 -18
- package/testing/factories/filters/public_api.d.ts +0 -4
- package/testing/factories/filters/request.factory.d.ts +0 -13
- package/testing/factories/filters/toggle-request.d.ts +0 -18
- package/testing/factories/filters/type/equal/option.d.ts +0 -17
- package/testing/factories/filters/type/equal/public_api.d.ts +0 -3
- package/testing/factories/filters/type/equal/request.d.ts +0 -16
- package/testing/factories/filters/type/equal/toggle-request.d.ts +0 -16
- package/testing/factories/filters/type/equal.d.ts +0 -17
- package/testing/factories/filters/type/public_api.d.ts +0 -4
- package/testing/factories/filters/type/range-numeric/option.d.ts +0 -15
- package/testing/factories/filters/type/range-numeric/pair.d.ts +0 -23
- package/testing/factories/filters/type/range-numeric/public_api.d.ts +0 -5
- package/testing/factories/filters/type/range-numeric/request-option.d.ts +0 -15
- package/testing/factories/filters/type/range-numeric/request.d.ts +0 -23
- package/testing/factories/filters/type/range-numeric/toggle-request.d.ts +0 -20
- package/testing/factories/filters/type/range-numeric.d.ts +0 -19
- package/testing/factories/identifiable.factory.d.ts +0 -11
- package/testing/factories/public_api.d.ts +0 -5
- package/testing/public_api.d.ts +0 -4
- package/testing/testing.module.d.ts +0 -7
- package/testing/unique/enforce.d.ts +0 -7
- package/types/html.type.d.ts +0 -5
- package/types/id.type.d.ts +0 -1
- package/types/public_api.d.ts +0 -2
- package/utils/array-to-dict.d.ts +0 -7
- package/utils/collect.d.ts +0 -6
- package/utils/identity.d.ts +0 -5
- package/utils/long-arithmetic.d.ts +0 -43
- package/utils/observe.d.ts +0 -9
- package/utils/public_api.d.ts +0 -16
- package/utils/random-slice.d.ts +0 -7
- package/utils/random-subset.d.ts +0 -7
- package/utils/range.d.ts +0 -12
- package/utils/sample.d.ts +0 -4
- package/utils/shallow-compare.d.ts +0 -6
- package/utils/shuffle.d.ts +0 -5
- package/utils/unique.d.ts +0 -8
- package/validator/field-presence.d.ts +0 -6
- package/validator/public_api.d.ts +0 -1
package/state/testing/index.d.ts
CHANGED
|
@@ -1 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
import { Action } from '@ngrx/store';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { DaffCollectionMetadata, DaffCollectionRequest, DaffSortOption, DaffSortDirectionEnum, DaffFilters } from '@daffodil/core';
|
|
4
|
+
import { DaffCollectionFacadeInterface, DaffOperationStateFacadeInterface, DaffState, DaffStateError } from '@daffodil/core/state';
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Can be used to mock out the {@link DaffCollectionFacade} in testing environments.
|
|
9
|
+
*
|
|
10
|
+
* @inheritdoc
|
|
11
|
+
*/
|
|
12
|
+
declare class MockDaffCollectionFacade implements DaffCollectionFacadeInterface {
|
|
13
|
+
metadata$: BehaviorSubject<DaffCollectionMetadata>;
|
|
14
|
+
request$: BehaviorSubject<DaffCollectionRequest>;
|
|
15
|
+
count$: BehaviorSubject<number>;
|
|
16
|
+
currentPage$: BehaviorSubject<number>;
|
|
17
|
+
totalPages$: BehaviorSubject<number>;
|
|
18
|
+
pageSize$: BehaviorSubject<number>;
|
|
19
|
+
sortOptions$: BehaviorSubject<DaffSortOption[]>;
|
|
20
|
+
appliedSortOption$: BehaviorSubject<string>;
|
|
21
|
+
appliedSortDirection$: BehaviorSubject<DaffSortDirectionEnum>;
|
|
22
|
+
filters$: BehaviorSubject<DaffFilters>;
|
|
23
|
+
appliedFilters$: BehaviorSubject<DaffFilters>;
|
|
24
|
+
dispatch(action: Action): void;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffCollectionFacade, never>;
|
|
26
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffCollectionFacade>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Can be used to mock out the {@link DaffOperationStateFacade} in testing environments.
|
|
31
|
+
*
|
|
32
|
+
* @inheritdoc
|
|
33
|
+
*/
|
|
34
|
+
declare class MockDaffOperationStateFacade implements DaffOperationStateFacadeInterface {
|
|
35
|
+
loadingState$: BehaviorSubject<DaffState>;
|
|
36
|
+
loading$: BehaviorSubject<boolean>;
|
|
37
|
+
resolving$: BehaviorSubject<boolean>;
|
|
38
|
+
mutating$: BehaviorSubject<boolean>;
|
|
39
|
+
errors$: BehaviorSubject<DaffStateError[]>;
|
|
40
|
+
hasErrors$: BehaviorSubject<boolean>;
|
|
41
|
+
dispatch(action: Action): void;
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffOperationStateFacade, never>;
|
|
43
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffOperationStateFacade>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { MockDaffCollectionFacade, MockDaffOperationStateFacade };
|
package/testing/index.d.ts
CHANGED
|
@@ -1 +1,363 @@
|
|
|
1
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { PipeTransform } from '@angular/core';
|
|
3
|
+
import { EnforceOptions } from 'enforce-unique';
|
|
4
|
+
import { Constructable, DaffIdentifiable, DaffNumericallyPaginable, DaffSortOption, DaffSortOptions, DaffSortable, DaffFilterEqual, DaffFilterType, DaffFilterRangeNumeric, DaffFilter, DaffFilterEqualRequest, DaffFilterRangeRequestOption, DaffFilterRangeNumericRequest, DaffFilterRequest, DaffFilterEqualToggleRequest, DaffFilterRangeNumericToggleRequest, DaffFilterToggleRequest, DaffFilterEqualOption, DaffFilterRangeOption, DaffFilterRangePair, DaffCollectionMetadata, DaffSortDirectionEnum, DaffFilters, DaffCollectionRequest, DaffCollection } from '@daffodil/core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @docs
|
|
8
|
+
* A mock CurrencyPipe that does nothing to a given input.
|
|
9
|
+
* This pipe is useful for asserting that a CurrencyPipe is in use via a spy,
|
|
10
|
+
* but ignoring the actual underlying implementation
|
|
11
|
+
*/
|
|
12
|
+
declare class DaffMockCurrencyPipe implements PipeTransform {
|
|
13
|
+
transform(value: number): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMockCurrencyPipe, never>;
|
|
15
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<DaffMockCurrencyPipe, "currency", false>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare class DaffCoreTestingModule {
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCoreTestingModule, never>;
|
|
20
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCoreTestingModule, [typeof DaffMockCurrencyPipe], never, never>;
|
|
21
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCoreTestingModule>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type Func = (...args: Array<any>) => any;
|
|
25
|
+
/**
|
|
26
|
+
* Wraps `UniqueEnforcer` to provide function-specific instances.
|
|
27
|
+
*/
|
|
28
|
+
declare const enforceUnique: <T extends Func>(func: T, options?: EnforceOptions) => ReturnType<T>;
|
|
29
|
+
|
|
30
|
+
interface IDaffModelFactory<T> {
|
|
31
|
+
create<R extends T = T>(partial: Partial<T> & T extends R ? Partial<T> : R): T & R;
|
|
32
|
+
create(partial?: Partial<T>): T;
|
|
33
|
+
createMany(qty: number, partial: Partial<T>): T[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The base class for model factories.
|
|
38
|
+
*
|
|
39
|
+
* The mock class is passed as the first constructor arg
|
|
40
|
+
* and any additional args are passed to the mock class constructor.
|
|
41
|
+
*
|
|
42
|
+
* The constructor args can be omitted if the `create` method is overridden.
|
|
43
|
+
*
|
|
44
|
+
* @example Injecting a different factory into a mock class
|
|
45
|
+
* ```ts
|
|
46
|
+
* class MyMockModel {
|
|
47
|
+
* constructor(
|
|
48
|
+
* private otherFactory: MyOtherFactory
|
|
49
|
+
* ) {}
|
|
50
|
+
*
|
|
51
|
+
* private createOtherModel() {
|
|
52
|
+
* return this.otherFactory.create()
|
|
53
|
+
* }
|
|
54
|
+
*
|
|
55
|
+
* otherModel = this.createOtherModel()
|
|
56
|
+
* }
|
|
57
|
+
*
|
|
58
|
+
* @Injectable()
|
|
59
|
+
* class TestFactory extends DaffModelFactory<MyMockModel> {
|
|
60
|
+
* constructor(
|
|
61
|
+
* otherFactory: MyOtherFactory
|
|
62
|
+
* ) {
|
|
63
|
+
* super(MyMockModel, otherFactory)
|
|
64
|
+
* }
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
declare abstract class DaffModelFactory<T extends Record<string, any>, Klass extends Constructable<T> = Constructable<T>> implements IDaffModelFactory<T> {
|
|
69
|
+
type?: Klass;
|
|
70
|
+
_instantiationArgs: ConstructorParameters<Klass>;
|
|
71
|
+
constructor(type?: Klass, ...args: ConstructorParameters<Klass>);
|
|
72
|
+
create<R extends T = T>(partial: Partial<T> & T extends R ? Partial<T> : R): T & R;
|
|
73
|
+
create(partial?: Partial<T>): T;
|
|
74
|
+
createMany(qty?: number, partial?: Partial<T>): T[];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare class MockDaffIdentifiable implements DaffIdentifiable {
|
|
78
|
+
id: string;
|
|
79
|
+
}
|
|
80
|
+
declare class DaffIdentifiableFactory extends DaffModelFactory<DaffIdentifiable> {
|
|
81
|
+
constructor();
|
|
82
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffIdentifiableFactory, never>;
|
|
83
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffIdentifiableFactory>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
declare class DaffNumericallyPaginableFactory extends DaffModelFactory<DaffNumericallyPaginable> {
|
|
87
|
+
constructor();
|
|
88
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffNumericallyPaginableFactory, never>;
|
|
89
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffNumericallyPaginableFactory>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
declare class DaffSortOptionFactory extends DaffModelFactory<DaffSortOption> {
|
|
93
|
+
constructor();
|
|
94
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSortOptionFactory, never>;
|
|
95
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffSortOptionFactory>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
declare class DaffSortOptionsFactory extends DaffModelFactory<DaffSortOptions> {
|
|
99
|
+
constructor(optionFactory: DaffSortOptionFactory);
|
|
100
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSortOptionsFactory, never>;
|
|
101
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffSortOptionsFactory>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
declare class DaffSortableFactory extends DaffModelFactory<DaffSortable> {
|
|
105
|
+
constructor(optionFactory: DaffSortOptionsFactory);
|
|
106
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSortableFactory, never>;
|
|
107
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffSortableFactory>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare class MockFilterEqual implements DaffFilterEqual {
|
|
111
|
+
type: DaffFilterType.Equal;
|
|
112
|
+
label: string;
|
|
113
|
+
name: string;
|
|
114
|
+
options: {};
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* A factory for creating a {@link DaffFilterEqual}.
|
|
118
|
+
*/
|
|
119
|
+
declare class DaffFilterEqualFactory extends DaffModelFactory<DaffFilterEqual> {
|
|
120
|
+
constructor();
|
|
121
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterEqualFactory, never>;
|
|
122
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterEqualFactory>;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
declare class MockFilterRangeNumeric implements DaffFilterRangeNumeric {
|
|
126
|
+
type: DaffFilterType.RangeNumeric;
|
|
127
|
+
label: string;
|
|
128
|
+
name: string;
|
|
129
|
+
min: number;
|
|
130
|
+
max: number;
|
|
131
|
+
options: {};
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* A factory for creating a {@link DaffFilterRangeNumeric}.
|
|
135
|
+
*/
|
|
136
|
+
declare class DaffFilterRangeNumericFactory extends DaffModelFactory<DaffFilterRangeNumeric> {
|
|
137
|
+
constructor();
|
|
138
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterRangeNumericFactory, never>;
|
|
139
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterRangeNumericFactory>;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* A factory for creating a {@link DaffFilter}.
|
|
144
|
+
*/
|
|
145
|
+
declare class DaffFilterFactory extends DaffModelFactory<DaffFilter> {
|
|
146
|
+
private equalFactory;
|
|
147
|
+
private rangeFactory;
|
|
148
|
+
constructor(equalFactory: DaffFilterEqualFactory, rangeFactory: DaffFilterRangeNumericFactory);
|
|
149
|
+
create(partial?: Partial<DaffFilter>): DaffFilter;
|
|
150
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterFactory, never>;
|
|
151
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterFactory>;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
declare class MockDaffFilterEqualRequest implements DaffFilterEqualRequest {
|
|
155
|
+
type: DaffFilterType.Equal;
|
|
156
|
+
name: string;
|
|
157
|
+
value: string[];
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* A factory for creating a {@link DaffFilterEqualRequest}.
|
|
161
|
+
*/
|
|
162
|
+
declare class DaffFilterRequestEqualFactory extends DaffModelFactory<DaffFilterEqualRequest> {
|
|
163
|
+
constructor();
|
|
164
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterRequestEqualFactory, never>;
|
|
165
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterRequestEqualFactory>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
declare class MockDaffFilterRangeNumericRequestOption implements DaffFilterRangeRequestOption<number> {
|
|
169
|
+
min: number;
|
|
170
|
+
max: number;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* A factory for creating a {@link DaffFilterRangeRequestOption}.
|
|
174
|
+
*/
|
|
175
|
+
declare class DaffFilterRangeNumericRequestOptionFactory extends DaffModelFactory<DaffFilterRangeRequestOption<number>> {
|
|
176
|
+
constructor();
|
|
177
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterRangeNumericRequestOptionFactory, never>;
|
|
178
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterRangeNumericRequestOptionFactory>;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
declare class MockDaffFilterRangeNumericRequest implements DaffFilterRangeNumericRequest {
|
|
182
|
+
type: DaffFilterType.RangeNumeric;
|
|
183
|
+
name: string;
|
|
184
|
+
value: DaffFilterRangeRequestOption<number>;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* A factory for creating a {@link DaffFilterRangeNumericRequest}.
|
|
188
|
+
*/
|
|
189
|
+
declare class DaffFilterRequestRangeNumericFactory extends DaffModelFactory<DaffFilterRangeNumericRequest> {
|
|
190
|
+
private option;
|
|
191
|
+
constructor(option?: DaffFilterRangeNumericRequestOptionFactory);
|
|
192
|
+
create(partial?: Partial<DaffFilterRangeNumericRequest>): {
|
|
193
|
+
type: DaffFilterType.RangeNumeric;
|
|
194
|
+
name: string;
|
|
195
|
+
value: DaffFilterRangeRequestOption<number>;
|
|
196
|
+
};
|
|
197
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterRequestRangeNumericFactory, never>;
|
|
198
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterRequestRangeNumericFactory>;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* A factory for creating a {@link DaffFilterRequest}.
|
|
203
|
+
*/
|
|
204
|
+
declare class DaffFilterRequestFactory extends DaffModelFactory<DaffFilterRequest> {
|
|
205
|
+
constructor(equalFactory: DaffFilterRequestEqualFactory, rangeFactory: DaffFilterRequestRangeNumericFactory);
|
|
206
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterRequestFactory, never>;
|
|
207
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterRequestFactory>;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
declare class MockDaffFilterToggleEqualRequest implements DaffFilterEqualToggleRequest {
|
|
211
|
+
type: DaffFilterType.Equal;
|
|
212
|
+
name: string;
|
|
213
|
+
value: string;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* A factory for creating a {@link DaffFilterEqualToggleRequest}.
|
|
217
|
+
*/
|
|
218
|
+
declare class DaffFilterToggleRequestEqualFactory extends DaffModelFactory<DaffFilterEqualToggleRequest> {
|
|
219
|
+
constructor();
|
|
220
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterToggleRequestEqualFactory, never>;
|
|
221
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterToggleRequestEqualFactory>;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
declare class MockDaffFilterToggleRangeNumericRequest implements DaffFilterRangeNumericToggleRequest {
|
|
225
|
+
type: DaffFilterType.RangeNumeric;
|
|
226
|
+
name: string;
|
|
227
|
+
value: DaffFilterRangeRequestOption<number>;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* A factory for creating a {@link DaffFilterRangeNumericToggleRequest}.
|
|
231
|
+
*/
|
|
232
|
+
declare class DaffFilterToggleRequestRangeNumericFactory extends DaffModelFactory<DaffFilterRangeNumericToggleRequest> {
|
|
233
|
+
private option;
|
|
234
|
+
constructor(option: DaffFilterRangeNumericRequestOptionFactory);
|
|
235
|
+
create(partial?: Partial<DaffFilterRangeNumericToggleRequest>): DaffFilterRangeNumericToggleRequest;
|
|
236
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterToggleRequestRangeNumericFactory, never>;
|
|
237
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterToggleRequestRangeNumericFactory>;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* A factory for creating a {@link DaffFilterToggleRequest}.
|
|
242
|
+
*/
|
|
243
|
+
declare class DaffFilterToggleRequestFactory extends DaffModelFactory<DaffFilterToggleRequest> {
|
|
244
|
+
private equalFactory;
|
|
245
|
+
private rangeFactory;
|
|
246
|
+
constructor(equalFactory: DaffFilterToggleRequestEqualFactory, rangeFactory: DaffFilterToggleRequestRangeNumericFactory);
|
|
247
|
+
create(partial?: Partial<DaffFilterToggleRequest>): DaffFilterToggleRequest;
|
|
248
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterToggleRequestFactory, never>;
|
|
249
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterToggleRequestFactory>;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
declare class MockDaffFilterEqualOption implements DaffFilterEqualOption {
|
|
253
|
+
applied: boolean;
|
|
254
|
+
value: string;
|
|
255
|
+
label: string;
|
|
256
|
+
count: number;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* A factory for creating a {@link DaffFilterEqualOption}.
|
|
260
|
+
*/
|
|
261
|
+
declare class DaffFilterEqualOptionFactory extends DaffModelFactory<DaffFilterEqualOption> {
|
|
262
|
+
constructor();
|
|
263
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterEqualOptionFactory, never>;
|
|
264
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterEqualOptionFactory>;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
declare class MockFilterRangeNumericOption implements DaffFilterRangeOption<number> {
|
|
268
|
+
value: number;
|
|
269
|
+
label: string;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* A factory for creating a {@link DaffFilterRangeOption}.
|
|
273
|
+
*/
|
|
274
|
+
declare class DaffFilterRangeNumericOptionFactory extends DaffModelFactory<DaffFilterRangeOption<number>> {
|
|
275
|
+
constructor();
|
|
276
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterRangeNumericOptionFactory, never>;
|
|
277
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterRangeNumericOptionFactory>;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
declare class MockDaffFilterRangeNumericPair implements DaffFilterRangePair<number> {
|
|
281
|
+
applied: true;
|
|
282
|
+
max: DaffFilterRangeOption<number>;
|
|
283
|
+
min: DaffFilterRangeOption<number>;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* A factory for creating a {@link DaffFilterRangePair}.
|
|
287
|
+
*/
|
|
288
|
+
declare class DaffFilterRangeNumericPairFactory extends DaffModelFactory<DaffFilterRangePair<number>> {
|
|
289
|
+
private option;
|
|
290
|
+
constructor(option: DaffFilterRangeNumericOptionFactory);
|
|
291
|
+
create(partial?: Partial<DaffFilterRangePair<number>>): {
|
|
292
|
+
applied: true;
|
|
293
|
+
min: DaffFilterRangeOption<number>;
|
|
294
|
+
max: DaffFilterRangeOption<number>;
|
|
295
|
+
};
|
|
296
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffFilterRangeNumericPairFactory, never>;
|
|
297
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffFilterRangeNumericPairFactory>;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Mocked {@link DaffCollectionMetadata} object.
|
|
302
|
+
*/
|
|
303
|
+
declare class MockCollectionMetadata implements DaffCollectionMetadata {
|
|
304
|
+
currentPage: number;
|
|
305
|
+
totalPages: number;
|
|
306
|
+
pageSize: number;
|
|
307
|
+
sortOptions: DaffSortOptions;
|
|
308
|
+
appliedSortOption: DaffSortOption['value'];
|
|
309
|
+
appliedSortDirection: DaffSortDirectionEnum;
|
|
310
|
+
count: number;
|
|
311
|
+
ids: DaffIdentifiable['id'][];
|
|
312
|
+
filters: DaffFilters;
|
|
313
|
+
constructor(pageInfoFactory: DaffNumericallyPaginableFactory, sortFieldsFactory: DaffSortableFactory, filterFactory: DaffFilterFactory);
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Factory for creating {@link DaffCollectionMetadata}s.
|
|
317
|
+
*/
|
|
318
|
+
declare class DaffCollectionMetadataFactory extends DaffModelFactory<DaffCollectionMetadata> {
|
|
319
|
+
constructor(pageInfoFactory: DaffNumericallyPaginableFactory, sortFieldsFactory: DaffSortableFactory, filterFactory: DaffFilterFactory);
|
|
320
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCollectionMetadataFactory, never>;
|
|
321
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCollectionMetadataFactory>;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Mocked {@link DaffCollectionRequest} object.
|
|
326
|
+
*/
|
|
327
|
+
declare class MockCollectionRequest implements DaffCollectionRequest {
|
|
328
|
+
private filterRequestFactory;
|
|
329
|
+
currentPage: number;
|
|
330
|
+
appliedSortDirection: DaffSortDirectionEnum;
|
|
331
|
+
pageSize: number;
|
|
332
|
+
appliedSortOption: string;
|
|
333
|
+
filterRequests: DaffFilterRequest[];
|
|
334
|
+
constructor(filterRequestFactory: DaffFilterRequestFactory);
|
|
335
|
+
private createFilterRequests;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Factory for creating {@link DaffCollectionRequest}s.
|
|
339
|
+
*/
|
|
340
|
+
declare class DaffCollectionRequestFactory extends DaffModelFactory<DaffCollectionRequest> {
|
|
341
|
+
constructor(filterRequestFactory: DaffFilterRequestFactory);
|
|
342
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCollectionRequestFactory, never>;
|
|
343
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCollectionRequestFactory>;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Mocked {@link DaffCollection} object.
|
|
348
|
+
*
|
|
349
|
+
* It should be customized by passing the factory for the contained entity as the first constructor argument.
|
|
350
|
+
*/
|
|
351
|
+
declare class MockCollection<T extends DaffIdentifiable = DaffIdentifiable> implements DaffCollection<T> {
|
|
352
|
+
private itemFactory;
|
|
353
|
+
private metadataFactory;
|
|
354
|
+
private _items;
|
|
355
|
+
metadata: DaffCollectionMetadata;
|
|
356
|
+
data: Record<T["id"], T>;
|
|
357
|
+
constructor(itemFactory: DaffModelFactory<T>, metadataFactory: DaffCollectionMetadataFactory);
|
|
358
|
+
private createItems;
|
|
359
|
+
private createMetadata;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export { DaffCollectionMetadataFactory, DaffCollectionRequestFactory, DaffCoreTestingModule, DaffFilterEqualFactory, DaffFilterEqualOptionFactory, DaffFilterFactory, DaffFilterRangeNumericFactory, DaffFilterRangeNumericOptionFactory, DaffFilterRangeNumericPairFactory, DaffFilterRangeNumericRequestOptionFactory, DaffFilterRequestEqualFactory, DaffFilterRequestFactory, DaffFilterRequestRangeNumericFactory, DaffFilterToggleRequestEqualFactory, DaffFilterToggleRequestFactory, DaffFilterToggleRequestRangeNumericFactory, DaffIdentifiableFactory, DaffMockCurrencyPipe, DaffModelFactory, DaffNumericallyPaginableFactory, DaffSortOptionFactory, DaffSortOptionsFactory, DaffSortableFactory, MockCollection, MockCollectionMetadata, MockCollectionRequest, MockDaffFilterEqualOption, MockDaffFilterEqualRequest, MockDaffFilterRangeNumericPair, MockDaffFilterRangeNumericRequest, MockDaffFilterRangeNumericRequestOption, MockDaffFilterToggleEqualRequest, MockDaffFilterToggleRangeNumericRequest, MockDaffIdentifiable, MockFilterEqual, MockFilterRangeNumeric, MockFilterRangeNumericOption, enforceUnique };
|
|
363
|
+
export type { IDaffModelFactory };
|
package/async/maybe.type.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A service for encoding and decoding base64 strings.
|
|
3
|
-
*/
|
|
4
|
-
export interface DaffBase64Service {
|
|
5
|
-
/**
|
|
6
|
-
* Encodes an ASCII string to base64.
|
|
7
|
-
*/
|
|
8
|
-
encode(str: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* Decodes a base64 string to ASCII.
|
|
11
|
-
*/
|
|
12
|
-
decode(str: string): string;
|
|
13
|
-
}
|
|
14
|
-
export declare const DaffBase64ServiceToken: import("@angular/core").InjectionToken<DaffBase64Service>, provideDaffBase64Service: <R extends DaffBase64Service = DaffBase64Service>(value: R) => import("@angular/core").ValueProvider;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DaffBase64Service } from '../base64.interface';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/**
|
|
4
|
-
* @inheritdoc
|
|
5
|
-
*/
|
|
6
|
-
export declare class DaffBrowserBase64Service implements DaffBase64Service {
|
|
7
|
-
constructor(platformId: string);
|
|
8
|
-
encode(str: string): string;
|
|
9
|
-
decode(str: string): string;
|
|
10
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffBrowserBase64Service, never>;
|
|
11
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffBrowserBase64Service>;
|
|
12
|
-
}
|
package/base64/public_api.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DaffServerBase64Service } from './server.service';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DaffBase64Service } from '../base64.interface';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/**
|
|
4
|
-
* A base64 service meant to be loaded into SSR contexts.
|
|
5
|
-
*
|
|
6
|
-
* @inheritdoc
|
|
7
|
-
*/
|
|
8
|
-
export declare class DaffServerBase64Service implements DaffBase64Service {
|
|
9
|
-
constructor(platformId: string);
|
|
10
|
-
encode(str: string): string;
|
|
11
|
-
decode(str: string): string;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffServerBase64Service, never>;
|
|
13
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffServerBase64Service>;
|
|
14
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { DaffCollectionMetadata } from './metadata.interface';
|
|
2
|
-
import { DaffCollectionRequest } from './request.interface';
|
|
3
|
-
/**
|
|
4
|
-
* Extracts the part of the {@link DaffCollectionRequest} that can be directly set in {@link DaffCollectionMetadata}.
|
|
5
|
-
*/
|
|
6
|
-
export declare const daffCollectionBuildMetadataFromRequest: (request: DaffCollectionRequest) => Partial<DaffCollectionMetadata>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { DaffCollectionMetadata } from './metadata.interface';
|
|
2
|
-
import { DaffCollectionRequest } from './request.interface';
|
|
3
|
-
/**
|
|
4
|
-
* Builds a {@link DaffCollectionRequest} from {@link DaffCollectionMetadata}.
|
|
5
|
-
*/
|
|
6
|
-
export declare const daffCollectionBuildRequestFromMetadata: (metadata: DaffCollectionMetadata) => Partial<DaffCollectionRequest>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DaffCollectionMetadata } from './metadata.interface';
|
|
2
|
-
import { DaffIdentifiable } from '../identifiable/identifiable.interface';
|
|
3
|
-
/**
|
|
4
|
-
* A collection of items that is paginable, sortable, and filterable.
|
|
5
|
-
*/
|
|
6
|
-
export interface DaffCollection<T extends DaffIdentifiable = DaffIdentifiable> {
|
|
7
|
-
/**
|
|
8
|
-
* The collection metadata that contains info about the collection.
|
|
9
|
-
* Includes page, sorting, filtering, and total number of items.
|
|
10
|
-
*/
|
|
11
|
-
metadata: DaffCollectionMetadata;
|
|
12
|
-
/**
|
|
13
|
-
* The current page of items according to the sorting and filtering.
|
|
14
|
-
*/
|
|
15
|
-
data: Record<T['id'], T>;
|
|
16
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DaffCountable } from './countable.interface';
|
|
2
|
-
import { DaffNumericallyPaginable } from './paginable';
|
|
3
|
-
import { DaffSortable } from './sortable';
|
|
4
|
-
import { DaffFilterable } from '../filterable/public_api';
|
|
5
|
-
import { DaffIdentifiable } from '../identifiable/public_api';
|
|
6
|
-
/**
|
|
7
|
-
* The collection metadata contains info about the collection as a whole
|
|
8
|
-
* such as pagination, sorting, and size.
|
|
9
|
-
*/
|
|
10
|
-
export interface DaffCollectionMetadata extends DaffNumericallyPaginable, DaffSortable, DaffCountable, DaffFilterable {
|
|
11
|
-
ids: DaffIdentifiable['id'][];
|
|
12
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DaffError, DaffInheritableError } from '../errors/public_api';
|
|
2
|
-
export declare const DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE = "DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS";
|
|
3
|
-
/**
|
|
4
|
-
* An error thrown when the requested page is greater than the number of available pages.
|
|
5
|
-
*/
|
|
6
|
-
export declare class DaffCollectionPageOutOfBoundsError extends DaffInheritableError implements DaffError {
|
|
7
|
-
readonly code: string;
|
|
8
|
-
constructor(message?: string);
|
|
9
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './paginable';
|
|
2
|
-
export * from './sortable';
|
|
3
|
-
export * from './countable.interface';
|
|
4
|
-
export * from './collection.interface';
|
|
5
|
-
export * from './metadata.interface';
|
|
6
|
-
export * from './page-out-of-bounds.error';
|
|
7
|
-
export * from './error-map';
|
|
8
|
-
export * from './request.interface';
|
|
9
|
-
export * from './build-metadata';
|
|
10
|
-
export * from './build-request';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { DaffSortDirectionEnum } from './sortable';
|
|
2
|
-
import { DaffFilterRequest } from '../filterable/public_api';
|
|
3
|
-
/**
|
|
4
|
-
* A collection of items that is paginable, sortable, and filterable.
|
|
5
|
-
*/
|
|
6
|
-
export interface DaffCollectionRequest {
|
|
7
|
-
/**
|
|
8
|
-
* The option by which to sort the collection's items.
|
|
9
|
-
*/
|
|
10
|
-
appliedSortOption?: string;
|
|
11
|
-
/**
|
|
12
|
-
* The direction by which to sort the collection's items.
|
|
13
|
-
*/
|
|
14
|
-
appliedSortDirection?: DaffSortDirectionEnum;
|
|
15
|
-
/**
|
|
16
|
-
* What page of the collection's items to retrieve.
|
|
17
|
-
*/
|
|
18
|
-
currentPage?: number;
|
|
19
|
-
/**
|
|
20
|
-
* The number of items per-page to request.
|
|
21
|
-
*/
|
|
22
|
-
pageSize?: number;
|
|
23
|
-
/**
|
|
24
|
-
* The properties by which to filter the items of the collection being requested.
|
|
25
|
-
*/
|
|
26
|
-
filterRequests?: DaffFilterRequest[];
|
|
27
|
-
}
|
package/collection/sortable.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The metadata that describes the sorting behavior of a collection of elements.
|
|
3
|
-
*/
|
|
4
|
-
export interface DaffSortOptions {
|
|
5
|
-
default: DaffSortOption['value'];
|
|
6
|
-
options: DaffSortOption[];
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* One particular option used to sort a collection of elements;
|
|
10
|
-
*/
|
|
11
|
-
export interface DaffSortOption {
|
|
12
|
-
label: string;
|
|
13
|
-
value: any;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* The direction in which to sort a list of elements, e.g. if the list was
|
|
17
|
-
* sorted alphabetically, "Ascending" would be from "A-Z",
|
|
18
|
-
* and "Descending" would be from "Z-A".
|
|
19
|
-
*/
|
|
20
|
-
export declare enum DaffSortDirectionEnum {
|
|
21
|
-
Ascending = "ASC",
|
|
22
|
-
Descending = "DSC"
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Describes the properties of a collection that make the collection able to be
|
|
26
|
-
* sorted by Daffodil.
|
|
27
|
-
*/
|
|
28
|
-
export interface DaffSortable {
|
|
29
|
-
/**
|
|
30
|
-
* The available options by which to sort the collection.
|
|
31
|
-
*/
|
|
32
|
-
sortOptions: DaffSortOptions;
|
|
33
|
-
/**
|
|
34
|
-
* The currently applied sorting option.
|
|
35
|
-
*/
|
|
36
|
-
appliedSortOption: DaffSortOption['value'];
|
|
37
|
-
/**
|
|
38
|
-
* The currently applied sort direction.
|
|
39
|
-
*/
|
|
40
|
-
appliedSortDirection: DaffSortDirectionEnum;
|
|
41
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A type which describes a function which would return an instance of a class
|
|
3
|
-
* Typically, we call this the "new" method in a language.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```ts
|
|
7
|
-
* class MyClass {
|
|
8
|
-
* readonly myProp: string = 'prop';
|
|
9
|
-
* name: string;
|
|
10
|
-
* constructor(name: string){
|
|
11
|
-
* this.name = name;
|
|
12
|
-
* }
|
|
13
|
-
* }
|
|
14
|
-
*
|
|
15
|
-
* const map = {
|
|
16
|
-
* "key": Myclass
|
|
17
|
-
* }
|
|
18
|
-
*
|
|
19
|
-
* let instance = new map["key"];
|
|
20
|
-
* instance instanceof MyClass //true
|
|
21
|
-
*
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export type Constructable<T, Args extends Array<any> = Array<any>> = new (...args: Args) => T;
|