@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.
Files changed (293) hide show
  1. package/external-script/index.d.ts +95 -1
  2. package/external-script/testing/index.d.ts +44 -1
  3. package/fesm2022/daffodil-core-external-script-testing.mjs +3 -3
  4. package/fesm2022/daffodil-core-external-script-testing.mjs.map +1 -1
  5. package/fesm2022/daffodil-core-external-script.mjs +4 -5
  6. package/fesm2022/daffodil-core-external-script.mjs.map +1 -1
  7. package/fesm2022/daffodil-core-graphql.mjs +3 -3
  8. package/fesm2022/daffodil-core-graphql.mjs.map +1 -1
  9. package/fesm2022/daffodil-core-routing.mjs +3 -3
  10. package/fesm2022/daffodil-core-routing.mjs.map +1 -1
  11. package/fesm2022/daffodil-core-state-testing.mjs +6 -6
  12. package/fesm2022/daffodil-core-state-testing.mjs.map +1 -1
  13. package/fesm2022/daffodil-core-state.mjs +2 -0
  14. package/fesm2022/daffodil-core-state.mjs.map +1 -1
  15. package/fesm2022/daffodil-core-testing.mjs +67 -67
  16. package/fesm2022/daffodil-core-testing.mjs.map +1 -1
  17. package/fesm2022/daffodil-core.mjs +51 -21
  18. package/fesm2022/daffodil-core.mjs.map +1 -1
  19. package/graphql/index.d.ts +64 -1
  20. package/index.d.ts +1305 -1
  21. package/package.json +1 -1
  22. package/routing/index.d.ts +86 -1
  23. package/state/index.d.ts +649 -1
  24. package/state/testing/index.d.ts +46 -1
  25. package/testing/index.d.ts +363 -1
  26. package/async/maybe.type.d.ts +0 -2
  27. package/base64/base64.interface.d.ts +0 -14
  28. package/base64/browser/browser.service.d.ts +0 -12
  29. package/base64/public_api.d.ts +0 -3
  30. package/base64/server/public_api.d.ts +0 -1
  31. package/base64/server/server.service.d.ts +0 -14
  32. package/canonically-locateable/canonically-locateable.interface.d.ts +0 -9
  33. package/collection/build-metadata.d.ts +0 -6
  34. package/collection/build-request.d.ts +0 -6
  35. package/collection/collection.interface.d.ts +0 -16
  36. package/collection/countable.interface.d.ts +0 -9
  37. package/collection/error-map.d.ts +0 -4
  38. package/collection/metadata.interface.d.ts +0 -12
  39. package/collection/page-out-of-bounds.error.d.ts +0 -9
  40. package/collection/paginable.d.ts +0 -10
  41. package/collection/public_api.d.ts +0 -10
  42. package/collection/request.interface.d.ts +0 -27
  43. package/collection/sortable.d.ts +0 -41
  44. package/constructable/constructable.d.ts +0 -24
  45. package/decorators/debounce.decorator.d.ts +0 -47
  46. package/decorators/public_api.d.ts +0 -1
  47. package/errors/error-map.d.ts +0 -8
  48. package/errors/error.interface.d.ts +0 -17
  49. package/errors/inheritable-error.d.ts +0 -22
  50. package/errors/is-error.d.ts +0 -4
  51. package/errors/public_api.d.ts +0 -4
  52. package/external-script/external-script.service.d.ts +0 -50
  53. package/external-script/interface.d.ts +0 -11
  54. package/external-script/public_api.d.ts +0 -3
  55. package/external-script/script.d.ts +0 -32
  56. package/external-script/testing/constants.d.ts +0 -4
  57. package/external-script/testing/external-script.service.d.ts +0 -37
  58. package/external-script/testing/public_api.d.ts +0 -2
  59. package/filterable/filter-base.d.ts +0 -24
  60. package/filterable/filter-option-base.d.ts +0 -9
  61. package/filterable/filter-option.d.ts +0 -6
  62. package/filterable/filter-request.d.ts +0 -7
  63. package/filterable/filter-toggle-request.d.ts +0 -6
  64. package/filterable/filter.d.ts +0 -9
  65. package/filterable/filterable.d.ts +0 -10
  66. package/filterable/filters.type.d.ts +0 -5
  67. package/filterable/public_api.d.ts +0 -12
  68. package/filterable/type/equal/filter.d.ts +0 -24
  69. package/filterable/type/equal/option.d.ts +0 -19
  70. package/filterable/type/equal/public_api.d.ts +0 -4
  71. package/filterable/type/equal/request.d.ts +0 -18
  72. package/filterable/type/equal/toggle-request.d.ts +0 -18
  73. package/filterable/type/filter-type.d.ts +0 -7
  74. package/filterable/type/range/filter-base.d.ts +0 -23
  75. package/filterable/type/range/option.d.ts +0 -14
  76. package/filterable/type/range/pair.d.ts +0 -20
  77. package/filterable/type/range/public_api.d.ts +0 -6
  78. package/filterable/type/range/request-base.d.ts +0 -20
  79. package/filterable/type/range/request-option.d.ts +0 -14
  80. package/filterable/type/range/separator.d.ts +0 -5
  81. package/filterable/type/range-numeric/filter.d.ts +0 -11
  82. package/filterable/type/range-numeric/public_api.d.ts +0 -3
  83. package/filterable/type/range-numeric/request.d.ts +0 -11
  84. package/filterable/type/range-numeric/toggle-request.d.ts +0 -12
  85. package/filters/array-to-dict/array-to-dict.d.ts +0 -5
  86. package/filters/behaviors/apply/apply-filter.d.ts +0 -8
  87. package/filters/behaviors/apply/apply-request-to-filters.d.ts +0 -8
  88. package/filters/behaviors/apply/apply-requests-to-filters.d.ts +0 -8
  89. package/filters/behaviors/apply/public_api.d.ts +0 -3
  90. package/filters/behaviors/clear/clear-filter.d.ts +0 -8
  91. package/filters/behaviors/clear/clear-filters.d.ts +0 -8
  92. package/filters/behaviors/clear/public_api.d.ts +0 -2
  93. package/filters/behaviors/remove/public_api.d.ts +0 -3
  94. package/filters/behaviors/remove/remove-filter.d.ts +0 -9
  95. package/filters/behaviors/remove/remove-request-from-filters.d.ts +0 -8
  96. package/filters/behaviors/remove/remove-requests-from-filters.d.ts +0 -9
  97. package/filters/behaviors/toggle/public_api.d.ts +0 -2
  98. package/filters/behaviors/toggle/toggle-request-on-filters.d.ts +0 -6
  99. package/filters/behaviors/toggle/toggle.d.ts +0 -6
  100. package/filters/compute-applied-filters/compute-applied-filters.d.ts +0 -6
  101. package/filters/errors/codes.enum.d.ts +0 -9
  102. package/filters/errors/filter-not-found.error.d.ts +0 -8
  103. package/filters/errors/public_api.d.ts +0 -4
  104. package/filters/errors/request-name-mismatch.error.d.ts +0 -9
  105. package/filters/errors/request-type-mismatch.error.d.ts +0 -9
  106. package/filters/errors/unknown-filter-type.error.d.ts +0 -9
  107. package/filters/find-applied/find-applied-options.d.ts +0 -5
  108. package/filters/find-applied/public_api.d.ts +0 -1
  109. package/filters/is-applied/is-filter-applied.d.ts +0 -5
  110. package/filters/is-applied/is-toggle-request-applied-to-filter.d.ts +0 -5
  111. package/filters/is-applied/public_api.d.ts +0 -2
  112. package/filters/public_api.d.ts +0 -13
  113. package/filters/to-request/filter-to-request.d.ts +0 -6
  114. package/filters/to-request/filters-to-requests.d.ts +0 -6
  115. package/filters/to-request/public_api.d.ts +0 -2
  116. package/filters/type/equal/array-to-dict/option.d.ts +0 -5
  117. package/filters/type/equal/behaviors/apply/apply.d.ts +0 -8
  118. package/filters/type/equal/behaviors/clear/clear.d.ts +0 -8
  119. package/filters/type/equal/behaviors/remove/remove.d.ts +0 -11
  120. package/filters/type/equal/behaviors/toggle/toggle.d.ts +0 -11
  121. package/filters/type/equal/is-applied/is-applied.d.ts +0 -5
  122. package/filters/type/equal/is-applied/is-toggle-request-applied-to-filter.d.ts +0 -5
  123. package/filters/type/equal/public_api.d.ts +0 -1
  124. package/filters/type/equal/to-request/filter-to-request.d.ts +0 -5
  125. package/filters/type/range/array-to-dict/pair.d.ts +0 -5
  126. package/filters/type/range/behaviors/apply/apply.d.ts +0 -8
  127. package/filters/type/range/behaviors/clear/clear.d.ts +0 -8
  128. package/filters/type/range/behaviors/remove/remove.d.ts +0 -11
  129. package/filters/type/range/behaviors/toggle/toggle.d.ts +0 -10
  130. package/filters/type/range/compute-pair-label.d.ts +0 -1
  131. package/filters/type/range/is-applied/is-applied.d.ts +0 -5
  132. package/filters/type/range/is-applied/is-toggle-request-applied-to-filter.d.ts +0 -5
  133. package/filters/type/range/public_api.d.ts +0 -2
  134. package/filters/type/range/to-request/filter-to-request.d.ts +0 -5
  135. package/filters/type/range-numeric/to-request/filter-to-request.d.ts +0 -5
  136. package/filters/validators/public_api.d.ts +0 -2
  137. package/filters/validators/request-name-match.d.ts +0 -7
  138. package/filters/validators/request-type-match.d.ts +0 -7
  139. package/graphql/apollo/cacheable-operations/cacheable-operations-link.interface.d.ts +0 -4
  140. package/graphql/apollo/public_api.d.ts +0 -3
  141. package/graphql/apollo/queued-apollo/queued-apollo.service.d.ts +0 -29
  142. package/graphql/apollo/validator/type.d.ts +0 -8
  143. package/graphql/fragments/build-fragment-definition.d.ts +0 -8
  144. package/graphql/fragments/build-fragment-name-spread.d.ts +0 -11
  145. package/graphql/fragments/public_api.d.ts +0 -2
  146. package/graphql/public_api.d.ts +0 -2
  147. package/identifiable/array-to-dict.d.ts +0 -5
  148. package/identifiable/identifiable.interface.d.ts +0 -10
  149. package/identifiable/public_api.d.ts +0 -2
  150. package/injection-tokens/config.factory.d.ts +0 -9
  151. package/injection-tokens/config.type.d.ts +0 -18
  152. package/injection-tokens/multi.factory.d.ts +0 -8
  153. package/injection-tokens/multi.type.d.ts +0 -15
  154. package/injection-tokens/public_api.d.ts +0 -10
  155. package/injection-tokens/services.factory.d.ts +0 -8
  156. package/injection-tokens/services.type.d.ts +0 -15
  157. package/injection-tokens/single.factory.d.ts +0 -8
  158. package/injection-tokens/single.type.d.ts +0 -14
  159. package/injection-tokens/singleton.factory.d.ts +0 -8
  160. package/injection-tokens/singleton.type.d.ts +0 -15
  161. package/injection-tokens/token-constuctor-params.type.d.ts +0 -3
  162. package/kindable/kindable.interface.d.ts +0 -9
  163. package/kindable/public_api.d.ts +0 -1
  164. package/locateable/locateable.interface.d.ts +0 -10
  165. package/merge/merge.d.ts +0 -64
  166. package/merge/mergers/array-concat.d.ts +0 -1
  167. package/merge/mergers/dict-assign.d.ts +0 -1
  168. package/merge/mergers/public_api.d.ts +0 -3
  169. package/merge/mergers/type.d.ts +0 -4
  170. package/merge/public_api.d.ts +0 -3
  171. package/merge/strategy.type.d.ts +0 -8
  172. package/operators/all-of.pipe.d.ts +0 -6
  173. package/operators/any-of.pipe.d.ts +0 -6
  174. package/operators/backoff.pipe.d.ts +0 -7
  175. package/operators/catch-and-arrayify-errors.pipe.d.ts +0 -6
  176. package/operators/public_api.d.ts +0 -4
  177. package/orderable/orderable.d.ts +0 -9
  178. package/public_api.d.ts +0 -20
  179. package/routing/public_api.d.ts +0 -2
  180. package/routing/query-param-filter/public_api.d.ts +0 -2
  181. package/routing/query-param-filter/request-builder/equal.d.ts +0 -6
  182. package/routing/query-param-filter/request-builder/public_api.d.ts +0 -2
  183. package/routing/query-param-filter/request-builder/type.d.ts +0 -6
  184. package/routing/query-param-filter/type.d.ts +0 -16
  185. package/routing/uri/normalizer.service.d.ts +0 -22
  186. package/routing/uri/public_api.d.ts +0 -2
  187. package/routing/uri/truncation/file-extension.d.ts +0 -9
  188. package/routing/uri/truncation/leading-path-segments.d.ts +0 -5
  189. package/routing/uri/truncation/leading-slash.d.ts +0 -11
  190. package/routing/uri/truncation/public_api.d.ts +0 -4
  191. package/routing/uri/truncation/query-fragment.d.ts +0 -5
  192. package/state/actions/failure.type.d.ts +0 -13
  193. package/state/actions/public_api.d.ts +0 -1
  194. package/state/collection/actions.d.ts +0 -73
  195. package/state/collection/adapter.class.d.ts +0 -35
  196. package/state/collection/facade.d.ts +0 -34
  197. package/state/collection/facade.interface.d.ts +0 -54
  198. package/state/collection/initial-state.d.ts +0 -2
  199. package/state/collection/public_api.d.ts +0 -6
  200. package/state/collection/selector-factory.d.ts +0 -62
  201. package/state/errors/errorable.type.d.ts +0 -7
  202. package/state/errors/public_api.d.ts +0 -3
  203. package/state/errors/state-error.interface.d.ts +0 -18
  204. package/state/errors/transform-error-to-state-error.d.ts +0 -7
  205. package/state/operation/adapter.d.ts +0 -24
  206. package/state/operation/entity/adapter.d.ts +0 -84
  207. package/state/operation/entity/helpers/create-fake-id.d.ts +0 -7
  208. package/state/operation/entity/public_api.d.ts +0 -5
  209. package/state/operation/entity/selectors.d.ts +0 -24
  210. package/state/operation/entity/state.type.d.ts +0 -8
  211. package/state/operation/entity/type.d.ts +0 -15
  212. package/state/operation/facade.type.d.ts +0 -34
  213. package/state/operation/public_api.d.ts +0 -5
  214. package/state/operation/selectors.d.ts +0 -38
  215. package/state/operation/state.d.ts +0 -9
  216. package/state/operators/public_api.d.ts +0 -1
  217. package/state/operators/substream.pipe.d.ts +0 -26
  218. package/state/public_api.d.ts +0 -8
  219. package/state/reducers/create-meta.d.ts +0 -5
  220. package/state/reducers/identity.d.ts +0 -6
  221. package/state/reducers/public_api.d.ts +0 -2
  222. package/state/states/helpers.d.ts +0 -9
  223. package/state/states/loading.d.ts +0 -5
  224. package/state/states/mutable-loading.d.ts +0 -6
  225. package/state/states/public_api.d.ts +0 -5
  226. package/state/states/state.enum.d.ts +0 -48
  227. package/state/states/stateable.interface.d.ts +0 -8
  228. package/state/store/facade.d.ts +0 -3
  229. package/state/testing/mock-collection-facade.d.ts +0 -26
  230. package/state/testing/mock-operation-facade.d.ts +0 -20
  231. package/state/testing/public_api.d.ts +0 -2
  232. package/storage/error/error.d.ts +0 -7
  233. package/storage/error/error.service.d.ts +0 -15
  234. package/storage/error/public_api.d.ts +0 -2
  235. package/storage/localstorage/localstorage.service.d.ts +0 -23
  236. package/storage/noopstorage/noopstorage.service.d.ts +0 -13
  237. package/storage/persistence-server-safe.token.d.ts +0 -2
  238. package/storage/persistence.interface.d.ts +0 -7
  239. package/storage/public_api.d.ts +0 -6
  240. package/storage/server-error/public_api.d.ts +0 -2
  241. package/storage/server-error/server-error.d.ts +0 -11
  242. package/storage/server-error/server-error.service.d.ts +0 -18
  243. package/testing/angular/mocks/pipes/currency.d.ts +0 -13
  244. package/testing/factories/collection/metadata.factory.d.ts +0 -29
  245. package/testing/factories/collection/mock-collection.class.d.ts +0 -18
  246. package/testing/factories/collection/numerically-paginable.factory.d.ts +0 -8
  247. package/testing/factories/collection/public_api.d.ts +0 -7
  248. package/testing/factories/collection/request.factory.d.ts +0 -25
  249. package/testing/factories/collection/sort-option.factory.d.ts +0 -8
  250. package/testing/factories/collection/sort-options.factory.d.ts +0 -9
  251. package/testing/factories/collection/sortable.factory.d.ts +0 -9
  252. package/testing/factories/factory.d.ts +0 -42
  253. package/testing/factories/factory.interface.d.ts +0 -4
  254. package/testing/factories/filters/filter.factory.d.ts +0 -18
  255. package/testing/factories/filters/public_api.d.ts +0 -4
  256. package/testing/factories/filters/request.factory.d.ts +0 -13
  257. package/testing/factories/filters/toggle-request.d.ts +0 -18
  258. package/testing/factories/filters/type/equal/option.d.ts +0 -17
  259. package/testing/factories/filters/type/equal/public_api.d.ts +0 -3
  260. package/testing/factories/filters/type/equal/request.d.ts +0 -16
  261. package/testing/factories/filters/type/equal/toggle-request.d.ts +0 -16
  262. package/testing/factories/filters/type/equal.d.ts +0 -17
  263. package/testing/factories/filters/type/public_api.d.ts +0 -4
  264. package/testing/factories/filters/type/range-numeric/option.d.ts +0 -15
  265. package/testing/factories/filters/type/range-numeric/pair.d.ts +0 -23
  266. package/testing/factories/filters/type/range-numeric/public_api.d.ts +0 -5
  267. package/testing/factories/filters/type/range-numeric/request-option.d.ts +0 -15
  268. package/testing/factories/filters/type/range-numeric/request.d.ts +0 -23
  269. package/testing/factories/filters/type/range-numeric/toggle-request.d.ts +0 -20
  270. package/testing/factories/filters/type/range-numeric.d.ts +0 -19
  271. package/testing/factories/identifiable.factory.d.ts +0 -11
  272. package/testing/factories/public_api.d.ts +0 -5
  273. package/testing/public_api.d.ts +0 -4
  274. package/testing/testing.module.d.ts +0 -7
  275. package/testing/unique/enforce.d.ts +0 -7
  276. package/types/html.type.d.ts +0 -5
  277. package/types/id.type.d.ts +0 -1
  278. package/types/public_api.d.ts +0 -2
  279. package/utils/array-to-dict.d.ts +0 -7
  280. package/utils/collect.d.ts +0 -6
  281. package/utils/identity.d.ts +0 -5
  282. package/utils/long-arithmetic.d.ts +0 -43
  283. package/utils/observe.d.ts +0 -9
  284. package/utils/public_api.d.ts +0 -16
  285. package/utils/random-slice.d.ts +0 -7
  286. package/utils/random-subset.d.ts +0 -7
  287. package/utils/range.d.ts +0 -12
  288. package/utils/sample.d.ts +0 -4
  289. package/utils/shallow-compare.d.ts +0 -6
  290. package/utils/shuffle.d.ts +0 -5
  291. package/utils/unique.d.ts +0 -8
  292. package/validator/field-presence.d.ts +0 -6
  293. package/validator/public_api.d.ts +0 -1
@@ -1 +1,46 @@
1
- export * from './public_api';
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 };
@@ -1 +1,363 @@
1
- export * from './public_api';
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 };
@@ -1,2 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- export type MaybeAsync<T> = Promise<T> | Observable<T> | T;
@@ -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
- }
@@ -1,3 +0,0 @@
1
- export * from './server/public_api';
2
- export { DaffBrowserBase64Service } from './browser/browser.service';
3
- export { DaffBase64Service, DaffBase64ServiceToken, } from './base64.interface';
@@ -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,9 +0,0 @@
1
- /**
2
- * An object that has a canonical location referenced by a URL.
3
- */
4
- export interface DaffCanonicallyLocatable {
5
- /**
6
- * The URL describing the canonical location of the entity.
7
- */
8
- canonicalUrl: string;
9
- }
@@ -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,9 +0,0 @@
1
- /**
2
- * Represents an entity that contains a countable number of items.
3
- */
4
- export interface DaffCountable {
5
- /**
6
- * The number of items contained or tracked by this entity.
7
- */
8
- count: number;
9
- }
@@ -1,4 +0,0 @@
1
- import { DaffCollectionPageOutOfBoundsError } from './page-out-of-bounds.error';
2
- export declare const daffCollectionErrorMap: {
3
- DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS: typeof DaffCollectionPageOutOfBoundsError;
4
- };
@@ -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
- /**
2
- * The interface that describes a collection of elements that can be navigated in
3
- * a paged way. E.g. "Pages 1,2,3,4,5".
4
- *
5
- */
6
- export interface DaffNumericallyPaginable {
7
- currentPage: number;
8
- totalPages: number;
9
- pageSize: number;
10
- }
@@ -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
- }
@@ -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;