@daffodil/core 0.87.2 → 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 (295) 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 +4 -38
  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 +125 -33
  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/errors/error-map.d.ts +0 -8
  46. package/errors/error.interface.d.ts +0 -17
  47. package/errors/inheritable-error.d.ts +0 -22
  48. package/errors/is-error.d.ts +0 -4
  49. package/errors/public_api.d.ts +0 -4
  50. package/external-script/external-script.service.d.ts +0 -50
  51. package/external-script/interface.d.ts +0 -11
  52. package/external-script/public_api.d.ts +0 -3
  53. package/external-script/script.d.ts +0 -32
  54. package/external-script/testing/constants.d.ts +0 -4
  55. package/external-script/testing/external-script.service.d.ts +0 -37
  56. package/external-script/testing/public_api.d.ts +0 -2
  57. package/filterable/filter-base.d.ts +0 -24
  58. package/filterable/filter-option-base.d.ts +0 -9
  59. package/filterable/filter-option.d.ts +0 -6
  60. package/filterable/filter-request.d.ts +0 -7
  61. package/filterable/filter-toggle-request.d.ts +0 -6
  62. package/filterable/filter.d.ts +0 -9
  63. package/filterable/filterable.d.ts +0 -10
  64. package/filterable/filters.type.d.ts +0 -5
  65. package/filterable/public_api.d.ts +0 -12
  66. package/filterable/type/equal/filter.d.ts +0 -24
  67. package/filterable/type/equal/option.d.ts +0 -19
  68. package/filterable/type/equal/public_api.d.ts +0 -4
  69. package/filterable/type/equal/request.d.ts +0 -18
  70. package/filterable/type/equal/toggle-request.d.ts +0 -18
  71. package/filterable/type/filter-type.d.ts +0 -7
  72. package/filterable/type/range/filter-base.d.ts +0 -23
  73. package/filterable/type/range/option.d.ts +0 -14
  74. package/filterable/type/range/pair.d.ts +0 -20
  75. package/filterable/type/range/public_api.d.ts +0 -6
  76. package/filterable/type/range/request-base.d.ts +0 -20
  77. package/filterable/type/range/request-option.d.ts +0 -14
  78. package/filterable/type/range/separator.d.ts +0 -5
  79. package/filterable/type/range-numeric/filter.d.ts +0 -11
  80. package/filterable/type/range-numeric/public_api.d.ts +0 -3
  81. package/filterable/type/range-numeric/request.d.ts +0 -11
  82. package/filterable/type/range-numeric/toggle-request.d.ts +0 -12
  83. package/filters/array-to-dict/array-to-dict.d.ts +0 -5
  84. package/filters/behaviors/apply/apply-filter.d.ts +0 -8
  85. package/filters/behaviors/apply/apply-request-to-filters.d.ts +0 -8
  86. package/filters/behaviors/apply/apply-requests-to-filters.d.ts +0 -8
  87. package/filters/behaviors/apply/public_api.d.ts +0 -3
  88. package/filters/behaviors/clear/clear-filter.d.ts +0 -8
  89. package/filters/behaviors/clear/clear-filters.d.ts +0 -8
  90. package/filters/behaviors/clear/public_api.d.ts +0 -2
  91. package/filters/behaviors/remove/public_api.d.ts +0 -3
  92. package/filters/behaviors/remove/remove-filter.d.ts +0 -9
  93. package/filters/behaviors/remove/remove-request-from-filters.d.ts +0 -8
  94. package/filters/behaviors/remove/remove-requests-from-filters.d.ts +0 -9
  95. package/filters/behaviors/toggle/public_api.d.ts +0 -2
  96. package/filters/behaviors/toggle/toggle-request-on-filters.d.ts +0 -6
  97. package/filters/behaviors/toggle/toggle.d.ts +0 -6
  98. package/filters/compute-applied-filters/compute-applied-filters.d.ts +0 -6
  99. package/filters/errors/codes.enum.d.ts +0 -9
  100. package/filters/errors/filter-not-found.error.d.ts +0 -8
  101. package/filters/errors/public_api.d.ts +0 -4
  102. package/filters/errors/request-name-mismatch.error.d.ts +0 -9
  103. package/filters/errors/request-type-mismatch.error.d.ts +0 -9
  104. package/filters/errors/unknown-filter-type.error.d.ts +0 -9
  105. package/filters/find-applied/find-applied-options.d.ts +0 -5
  106. package/filters/find-applied/public_api.d.ts +0 -1
  107. package/filters/is-applied/is-filter-applied.d.ts +0 -5
  108. package/filters/is-applied/is-toggle-request-applied-to-filter.d.ts +0 -5
  109. package/filters/is-applied/public_api.d.ts +0 -2
  110. package/filters/public_api.d.ts +0 -13
  111. package/filters/to-request/filter-to-request.d.ts +0 -6
  112. package/filters/to-request/filters-to-requests.d.ts +0 -6
  113. package/filters/to-request/public_api.d.ts +0 -2
  114. package/filters/type/equal/array-to-dict/option.d.ts +0 -5
  115. package/filters/type/equal/behaviors/apply/apply.d.ts +0 -8
  116. package/filters/type/equal/behaviors/clear/clear.d.ts +0 -8
  117. package/filters/type/equal/behaviors/remove/remove.d.ts +0 -11
  118. package/filters/type/equal/behaviors/toggle/toggle.d.ts +0 -11
  119. package/filters/type/equal/is-applied/is-applied.d.ts +0 -5
  120. package/filters/type/equal/is-applied/is-toggle-request-applied-to-filter.d.ts +0 -5
  121. package/filters/type/equal/public_api.d.ts +0 -1
  122. package/filters/type/equal/to-request/filter-to-request.d.ts +0 -5
  123. package/filters/type/range/array-to-dict/pair.d.ts +0 -5
  124. package/filters/type/range/behaviors/apply/apply.d.ts +0 -8
  125. package/filters/type/range/behaviors/clear/clear.d.ts +0 -8
  126. package/filters/type/range/behaviors/remove/remove.d.ts +0 -11
  127. package/filters/type/range/behaviors/toggle/toggle.d.ts +0 -10
  128. package/filters/type/range/compute-pair-label.d.ts +0 -1
  129. package/filters/type/range/is-applied/is-applied.d.ts +0 -5
  130. package/filters/type/range/is-applied/is-toggle-request-applied-to-filter.d.ts +0 -5
  131. package/filters/type/range/public_api.d.ts +0 -2
  132. package/filters/type/range/to-request/filter-to-request.d.ts +0 -5
  133. package/filters/type/range-numeric/to-request/filter-to-request.d.ts +0 -5
  134. package/filters/validators/public_api.d.ts +0 -2
  135. package/filters/validators/request-name-match.d.ts +0 -7
  136. package/filters/validators/request-type-match.d.ts +0 -7
  137. package/graphql/apollo/cacheable-operations/cacheable-operations-link.interface.d.ts +0 -4
  138. package/graphql/apollo/public_api.d.ts +0 -3
  139. package/graphql/apollo/queued-apollo/queued-apollo.service.d.ts +0 -29
  140. package/graphql/apollo/validator/type.d.ts +0 -8
  141. package/graphql/fragments/build-fragment-definition.d.ts +0 -8
  142. package/graphql/fragments/build-fragment-name-spread.d.ts +0 -11
  143. package/graphql/fragments/public_api.d.ts +0 -2
  144. package/graphql/public_api.d.ts +0 -2
  145. package/identifiable/array-to-dict.d.ts +0 -5
  146. package/identifiable/identifiable.interface.d.ts +0 -10
  147. package/identifiable/public_api.d.ts +0 -2
  148. package/injection-tokens/config.factory.d.ts +0 -9
  149. package/injection-tokens/config.type.d.ts +0 -18
  150. package/injection-tokens/multi.factory.d.ts +0 -8
  151. package/injection-tokens/multi.type.d.ts +0 -15
  152. package/injection-tokens/public_api.d.ts +0 -10
  153. package/injection-tokens/services.factory.d.ts +0 -8
  154. package/injection-tokens/services.type.d.ts +0 -15
  155. package/injection-tokens/single.factory.d.ts +0 -8
  156. package/injection-tokens/single.type.d.ts +0 -14
  157. package/injection-tokens/singleton.factory.d.ts +0 -8
  158. package/injection-tokens/singleton.type.d.ts +0 -15
  159. package/injection-tokens/token-constuctor-params.type.d.ts +0 -3
  160. package/kindable/kindable.interface.d.ts +0 -9
  161. package/kindable/public_api.d.ts +0 -1
  162. package/locateable/locateable.interface.d.ts +0 -10
  163. package/merge/merge.d.ts +0 -64
  164. package/merge/mergers/array-concat.d.ts +0 -1
  165. package/merge/mergers/dict-assign.d.ts +0 -1
  166. package/merge/mergers/public_api.d.ts +0 -3
  167. package/merge/mergers/type.d.ts +0 -4
  168. package/merge/public_api.d.ts +0 -3
  169. package/merge/strategy.type.d.ts +0 -8
  170. package/operators/all-of.pipe.d.ts +0 -6
  171. package/operators/any-of.pipe.d.ts +0 -6
  172. package/operators/backoff.pipe.d.ts +0 -7
  173. package/operators/catch-and-arrayify-errors.pipe.d.ts +0 -6
  174. package/operators/public_api.d.ts +0 -4
  175. package/orderable/orderable.d.ts +0 -9
  176. package/public_api.d.ts +0 -19
  177. package/routing/public_api.d.ts +0 -3
  178. package/routing/query-param-filter/public_api.d.ts +0 -2
  179. package/routing/query-param-filter/request-builder/equal.d.ts +0 -6
  180. package/routing/query-param-filter/request-builder/public_api.d.ts +0 -2
  181. package/routing/query-param-filter/request-builder/type.d.ts +0 -6
  182. package/routing/query-param-filter/type.d.ts +0 -16
  183. package/routing/reducers/clear-errors/navigated-entity-reducer-factory.d.ts +0 -7
  184. package/routing/reducers/clear-errors/navigated.reducer.d.ts +0 -6
  185. package/routing/reducers/clear-errors/public_api.d.ts +0 -2
  186. package/routing/reducers/public_api.d.ts +0 -1
  187. package/routing/uri/normalizer.service.d.ts +0 -22
  188. package/routing/uri/public_api.d.ts +0 -2
  189. package/routing/uri/truncation/file-extension.d.ts +0 -9
  190. package/routing/uri/truncation/leading-path-segments.d.ts +0 -5
  191. package/routing/uri/truncation/leading-slash.d.ts +0 -11
  192. package/routing/uri/truncation/public_api.d.ts +0 -4
  193. package/routing/uri/truncation/query-fragment.d.ts +0 -5
  194. package/state/actions/failure.type.d.ts +0 -13
  195. package/state/actions/public_api.d.ts +0 -1
  196. package/state/collection/actions.d.ts +0 -73
  197. package/state/collection/adapter.class.d.ts +0 -35
  198. package/state/collection/facade.d.ts +0 -34
  199. package/state/collection/facade.interface.d.ts +0 -54
  200. package/state/collection/initial-state.d.ts +0 -2
  201. package/state/collection/public_api.d.ts +0 -6
  202. package/state/collection/selector-factory.d.ts +0 -62
  203. package/state/errors/errorable.type.d.ts +0 -7
  204. package/state/errors/public_api.d.ts +0 -3
  205. package/state/errors/state-error.interface.d.ts +0 -18
  206. package/state/errors/transform-error-to-state-error.d.ts +0 -7
  207. package/state/operation/adapter.d.ts +0 -24
  208. package/state/operation/entity/adapter.d.ts +0 -84
  209. package/state/operation/entity/helpers/create-fake-id.d.ts +0 -7
  210. package/state/operation/entity/public_api.d.ts +0 -5
  211. package/state/operation/entity/selectors.d.ts +0 -24
  212. package/state/operation/entity/state.type.d.ts +0 -8
  213. package/state/operation/entity/type.d.ts +0 -15
  214. package/state/operation/facade.type.d.ts +0 -34
  215. package/state/operation/public_api.d.ts +0 -5
  216. package/state/operation/selectors.d.ts +0 -38
  217. package/state/operation/state.d.ts +0 -9
  218. package/state/operators/public_api.d.ts +0 -1
  219. package/state/operators/substream.pipe.d.ts +0 -26
  220. package/state/public_api.d.ts +0 -8
  221. package/state/reducers/create-meta.d.ts +0 -5
  222. package/state/reducers/identity.d.ts +0 -6
  223. package/state/reducers/public_api.d.ts +0 -2
  224. package/state/states/helpers.d.ts +0 -9
  225. package/state/states/loading.d.ts +0 -5
  226. package/state/states/mutable-loading.d.ts +0 -6
  227. package/state/states/public_api.d.ts +0 -5
  228. package/state/states/state.enum.d.ts +0 -48
  229. package/state/states/stateable.interface.d.ts +0 -8
  230. package/state/store/facade.d.ts +0 -3
  231. package/state/testing/mock-collection-facade.d.ts +0 -26
  232. package/state/testing/mock-operation-facade.d.ts +0 -20
  233. package/state/testing/public_api.d.ts +0 -2
  234. package/storage/error/error.d.ts +0 -7
  235. package/storage/error/error.service.d.ts +0 -15
  236. package/storage/error/public_api.d.ts +0 -2
  237. package/storage/localstorage/localstorage.service.d.ts +0 -23
  238. package/storage/noopstorage/noopstorage.service.d.ts +0 -13
  239. package/storage/persistence-server-safe.token.d.ts +0 -2
  240. package/storage/persistence.interface.d.ts +0 -7
  241. package/storage/public_api.d.ts +0 -6
  242. package/storage/server-error/public_api.d.ts +0 -2
  243. package/storage/server-error/server-error.d.ts +0 -11
  244. package/storage/server-error/server-error.service.d.ts +0 -18
  245. package/testing/angular/mocks/pipes/currency.d.ts +0 -13
  246. package/testing/factories/collection/metadata.factory.d.ts +0 -29
  247. package/testing/factories/collection/mock-collection.class.d.ts +0 -18
  248. package/testing/factories/collection/numerically-paginable.factory.d.ts +0 -8
  249. package/testing/factories/collection/public_api.d.ts +0 -7
  250. package/testing/factories/collection/request.factory.d.ts +0 -25
  251. package/testing/factories/collection/sort-option.factory.d.ts +0 -8
  252. package/testing/factories/collection/sort-options.factory.d.ts +0 -9
  253. package/testing/factories/collection/sortable.factory.d.ts +0 -9
  254. package/testing/factories/factory.d.ts +0 -42
  255. package/testing/factories/factory.interface.d.ts +0 -4
  256. package/testing/factories/filters/filter.factory.d.ts +0 -18
  257. package/testing/factories/filters/public_api.d.ts +0 -4
  258. package/testing/factories/filters/request.factory.d.ts +0 -13
  259. package/testing/factories/filters/toggle-request.d.ts +0 -18
  260. package/testing/factories/filters/type/equal/option.d.ts +0 -17
  261. package/testing/factories/filters/type/equal/public_api.d.ts +0 -3
  262. package/testing/factories/filters/type/equal/request.d.ts +0 -16
  263. package/testing/factories/filters/type/equal/toggle-request.d.ts +0 -16
  264. package/testing/factories/filters/type/equal.d.ts +0 -17
  265. package/testing/factories/filters/type/public_api.d.ts +0 -4
  266. package/testing/factories/filters/type/range-numeric/option.d.ts +0 -15
  267. package/testing/factories/filters/type/range-numeric/pair.d.ts +0 -23
  268. package/testing/factories/filters/type/range-numeric/public_api.d.ts +0 -5
  269. package/testing/factories/filters/type/range-numeric/request-option.d.ts +0 -15
  270. package/testing/factories/filters/type/range-numeric/request.d.ts +0 -23
  271. package/testing/factories/filters/type/range-numeric/toggle-request.d.ts +0 -20
  272. package/testing/factories/filters/type/range-numeric.d.ts +0 -19
  273. package/testing/factories/identifiable.factory.d.ts +0 -11
  274. package/testing/factories/public_api.d.ts +0 -5
  275. package/testing/public_api.d.ts +0 -4
  276. package/testing/testing.module.d.ts +0 -7
  277. package/testing/unique/enforce.d.ts +0 -7
  278. package/types/html.type.d.ts +0 -5
  279. package/types/id.type.d.ts +0 -1
  280. package/types/public_api.d.ts +0 -2
  281. package/utils/array-to-dict.d.ts +0 -7
  282. package/utils/collect.d.ts +0 -6
  283. package/utils/identity.d.ts +0 -5
  284. package/utils/long-arithmetic.d.ts +0 -43
  285. package/utils/observe.d.ts +0 -9
  286. package/utils/public_api.d.ts +0 -16
  287. package/utils/random-slice.d.ts +0 -7
  288. package/utils/random-subset.d.ts +0 -7
  289. package/utils/range.d.ts +0 -12
  290. package/utils/sample.d.ts +0 -4
  291. package/utils/shallow-compare.d.ts +0 -6
  292. package/utils/shuffle.d.ts +0 -5
  293. package/utils/unique.d.ts +0 -8
  294. package/validator/field-presence.d.ts +0 -6
  295. package/validator/public_api.d.ts +0 -1
@@ -1,8 +0,0 @@
1
- import { DaffError } from './error.interface';
2
- import { Constructable } from '../constructable/constructable';
3
- /**
4
- * A type for a dictionary of error codes to Daffodil errors.
5
- */
6
- export interface DaffErrorCodeMap {
7
- [x: string]: Constructable<DaffError>;
8
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * An error object containing info about the exception that generated it.
3
- */
4
- export interface DaffError extends Error {
5
- /**
6
- * A string that uniquely identifies the error.
7
- */
8
- code: string;
9
- /**
10
- * Contains additional relevant information to the cause and/or solution of the error.
11
- */
12
- message: string;
13
- /**
14
- * Whether the error is non-critical and recoverable or catastrophic and unrecoverable.
15
- */
16
- recoverable: boolean;
17
- }
@@ -1,22 +0,0 @@
1
- /**
2
- * A class which allows you to appropriately check the inheritance of an error.
3
- *
4
- * In typescript, when you try to extend an error with a specialized error class,
5
- * if you try to call something like:
6
- *
7
- * ```ts
8
- * class MyError extends Error {}
9
- *
10
- * let myError = new MyError();
11
- *
12
- * myError instanceof MyError; // returns false
13
- * ```
14
- *
15
- * You will see unexpected things. This class fixes that issue as described here
16
- * https://github.com/microsoft/TypeScript/issues/13965
17
- */
18
- export declare class DaffInheritableError extends Error {
19
- __proto__: Error;
20
- recoverable: boolean;
21
- constructor(message?: string);
22
- }
@@ -1,4 +0,0 @@
1
- /**
2
- * Checks if the passed object is a {@link DaffError}
3
- */
4
- export declare const daffIsError: (error: any) => boolean;
@@ -1,4 +0,0 @@
1
- export { DaffErrorCodeMap } from './error-map';
2
- export { DaffError } from './error.interface';
3
- export { DaffInheritableError } from './inheritable-error';
4
- export { daffIsError } from './is-error';
@@ -1,50 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { DaffExternalScriptServiceInterface } from './interface';
3
- import { DaffExternalScript } from './script';
4
- import * as i0 from "@angular/core";
5
- export interface LoadedExternalScript extends DaffExternalScript {
6
- ready: boolean | undefined;
7
- subject: Observable<boolean>;
8
- el: HTMLElement | undefined;
9
- }
10
- /**
11
- * A service for loading external scripts into the document.
12
- *
13
- * ### Usage example
14
- *
15
- * @example Loading an external script into the document
16
- *
17
- * ```ts
18
- * import { DOCUMENT } from '@angular/common';
19
- * import { inject } from '@angular/core';
20
- *
21
- * import { DaffExternalScriptService } from '@daffodil/core/external-script';
22
- *
23
- * const externalScriptService = new DaffExternalScriptService(inject(DOCUMENT));
24
- *
25
- * externalScriptService.load('exampleScript', {
26
- * src: 'https://example.com/script.js',
27
- * async: true,
28
- * defer: false,
29
- * 'data-custom-attribute': 'value',
30
- * }).subscribe({
31
- * next: (result) => {
32
- * console.log('Script loaded successfully:', result);
33
- * },
34
- * error: (error) => {
35
- * console.error('Error loading script:', error);
36
- * },
37
- * });
38
- * ```
39
- */
40
- export declare class DaffExternalScriptService implements DaffExternalScriptServiceInterface {
41
- readonly scriptMap: Map<string, LoadedExternalScript>;
42
- private doc;
43
- constructor(doc: any);
44
- /**
45
- * @inheritdoc
46
- */
47
- load(name: string, script: DaffExternalScript): Observable<boolean>;
48
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalScriptService, never>;
49
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffExternalScriptService>;
50
- }
@@ -1,11 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { DaffExternalScript } from './script';
3
- export interface DaffExternalScriptServiceInterface {
4
- /**
5
- * Load a script into the document.
6
- * @param name The name of the script.
7
- * @param script The script object containing details like src, async, defer, and custom attributes.
8
- * @returns An Observable that emits true when the script is loaded successfully, or emits an error if loading fails.
9
- */
10
- load(name: string, script: DaffExternalScript): Observable<boolean>;
11
- }
@@ -1,3 +0,0 @@
1
- export { DaffExternalScriptService } from './external-script.service';
2
- export { DaffExternalScript } from './script';
3
- export { DaffExternalScriptServiceInterface } from './interface';
@@ -1,32 +0,0 @@
1
- /**
2
- * Represents the structure of an external script that can be loaded into a document.
3
- *
4
- * @example Using DaffExternalScript interface to define an external script object
5
- * ```ts
6
- * const externalScript: DaffExternalScript = {
7
- * src: 'https://example.com/script.js',
8
- * async: true,
9
- * defer: false,
10
- * 'data-custom-attribute': 'value',
11
- * };
12
- * ```
13
- */
14
- export interface DaffExternalScript {
15
- /** The source URL of the script. */
16
- src: string;
17
- /**
18
- * Optional. Indicates whether the script should be loaded asynchronously.
19
- * @default false
20
- */
21
- async?: boolean;
22
- /**
23
- * Optional. Indicates whether the script should be deferred in loading.
24
- * @default false
25
- */
26
- defer?: boolean;
27
- /**
28
- * Optional. Custom attributes for the script.
29
- * The keys must start with 'data-' followed by any string.
30
- */
31
- [key: `data-${string}`]: string;
32
- }
@@ -1,4 +0,0 @@
1
- export declare const enum TestScripts {
2
- SUCCESS = "0",
3
- FAILURE = "1"
4
- }
@@ -1,37 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { DaffExternalScriptServiceInterface } from '@daffodil/core/external-script';
3
- import { DaffExternalScript } from '@daffodil/core/external-script';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * A service for loading external scripts into the document.
7
- *
8
- * @example Loading an external script into the document
9
- *
10
- * ```ts
11
- * import { DaffExternalScriptTestingService } from '@daffodil/core/external-script/testing';
12
- *
13
- * const externalScriptService = new DaffExternalScriptTestingService();
14
- *
15
- * externalScriptService.load(TestScripts.SUCCESS, {
16
- * src: 'https://example.com/script.js',
17
- * async: true,
18
- * defer: false,
19
- * 'data-custom-attribute': 'value',
20
- * }).subscribe({
21
- * next: (result) => {
22
- * console.log('Script loaded successfully:', result);
23
- * },
24
- * error: (error) => {
25
- * console.error('Error loading script:', error);
26
- * },
27
- * });
28
- * ```
29
- */
30
- export declare class DaffExternalScriptTestingService implements DaffExternalScriptServiceInterface {
31
- /**
32
- * @inheritdoc
33
- */
34
- load(name: string, script: DaffExternalScript): Observable<boolean>;
35
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalScriptTestingService, never>;
36
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffExternalScriptTestingService>;
37
- }
@@ -1,2 +0,0 @@
1
- export { DaffExternalScriptTestingService } from './external-script.service';
2
- export { TestScripts } from './constants';
@@ -1,24 +0,0 @@
1
- import { DaffFilterOptionBase } from './filter-option-base';
2
- import { DaffFilterType } from './type/filter-type';
3
- /**
4
- * The base type of a filter.
5
- */
6
- export interface DaffFilterBase {
7
- /**
8
- * The end-user facing string that explains the filter e.g. "Color".
9
- */
10
- label: string;
11
- /**
12
- * The name of the filter e.g. "color".
13
- */
14
- name: string;
15
- /**
16
- * The type of the filter. This is used to determine the specific behavior of the filter.
17
- */
18
- type: DaffFilterType;
19
- /**
20
- * The available options by which to filter a collection entity, e.g. "red", "blue", or "green".
21
- * The type of options changes per type of filter.
22
- */
23
- options: Record<string, DaffFilterOptionBase>;
24
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * The base type of a filter option.
3
- */
4
- export interface DaffFilterOptionBase {
5
- /**
6
- * Whether or not the filter option is applied.
7
- */
8
- applied: boolean;
9
- }
@@ -1,6 +0,0 @@
1
- import { DaffFilter } from './filter';
2
- /**
3
- * A given option of a particular filter, e.g. "Blue" is a DaffFilterOption
4
- * of the {@link DaffFilter} "Color".
5
- */
6
- export type DaffFilterOption = DaffFilter['options'][string];
@@ -1,7 +0,0 @@
1
- import { DaffFilterEqualRequest } from './type/equal/request';
2
- import { DaffFilterRangeNumericRequest } from './type/range-numeric/request';
3
- /**
4
- * A DaffFilterRequest is used to modify the applied or unapplied state of
5
- * the options of a {@link DaffFilter}.
6
- */
7
- export type DaffFilterRequest = DaffFilterEqualRequest | DaffFilterRangeNumericRequest;
@@ -1,6 +0,0 @@
1
- import { DaffFilterEqualToggleRequest } from './type/equal/toggle-request';
2
- import { DaffFilterRangeNumericToggleRequest } from './type/range-numeric/public_api';
3
- /**
4
- * A DaffFilterToggleRequest is used to toggle a filter option between an applied and unapplied state.
5
- */
6
- export type DaffFilterToggleRequest = DaffFilterEqualToggleRequest | DaffFilterRangeNumericToggleRequest;
@@ -1,9 +0,0 @@
1
- import { DaffFilterEqual } from './type/equal/filter';
2
- import { DaffFilterRangeNumeric } from './type/range-numeric/filter';
3
- /**
4
- * A single filter along with its options. For example, a filter may be
5
- * something like "Color" with options of "Red", "Blue", and "Green".
6
- *
7
- * Importantly, filters have "types" which determine their behavior. See {@link DaffFilterType} for a complete list.
8
- */
9
- export type DaffFilter = DaffFilterRangeNumeric | DaffFilterEqual;
@@ -1,10 +0,0 @@
1
- import { DaffFilters } from './filters.type';
2
- /**
3
- * Describes an object that allows a specific entity to be filterable.
4
- */
5
- export interface DaffFilterable {
6
- /**
7
- * The available filters.
8
- */
9
- filters: DaffFilters;
10
- }
@@ -1,5 +0,0 @@
1
- import { DaffFilter } from './filter';
2
- /**
3
- * A dictionary of {@link DaffFilter}s keyed by name.
4
- */
5
- export type DaffFilters<T extends DaffFilter = DaffFilter> = Record<T['name'], T>;
@@ -1,12 +0,0 @@
1
- export { DaffFilterBase } from './filter-base';
2
- export { DaffFilterOptionBase } from './filter-option-base';
3
- export { DaffFilter } from './filter';
4
- export { DaffFilters } from './filters.type';
5
- export { DaffFilterOption } from './filter-option';
6
- export { DaffFilterRequest } from './filter-request';
7
- export { DaffFilterToggleRequest } from './filter-toggle-request';
8
- export { DaffFilterable } from './filterable';
9
- export { DaffFilterType } from './type/filter-type';
10
- export * from './type/equal/public_api';
11
- export * from './type/range/public_api';
12
- export * from './type/range-numeric/public_api';
@@ -1,24 +0,0 @@
1
- import { DaffFilterEqualOption } from './option';
2
- import { DaffFilterBase } from '../../filter-base';
3
- import { DaffFilterType } from '../filter-type';
4
- /**
5
- * A DaffFilterEqual is used to represent filters where
6
- * there is a set of well-defined dictionary-like values that are exactly
7
- * matchable. For example, one such filter may be a "Color" filter with options
8
- * of "Red", "Green", or "Blue" where a user can which filters options from the set
9
- * to apply.
10
- *
11
- * It is important to note that this kind of filter does not imply how combinations of
12
- * options are applied to collections of items, items that are "Red" AND "Green" vs.
13
- * items that are "Red" OR "Green".
14
- */
15
- export interface DaffFilterEqual extends DaffFilterBase {
16
- /**
17
- * The filter type for this model is always of type "DaffFilterType.Equal".
18
- */
19
- type: DaffFilterType.Equal;
20
- /**
21
- * A dictionary of filter options.
22
- */
23
- options: Record<DaffFilterEqualOption['value'], DaffFilterEqualOption>;
24
- }
@@ -1,19 +0,0 @@
1
- import { DaffFilterOptionBase } from '../../filter-option-base';
2
- /**
3
- * The individual options applicable to a filter. Such an option may be something like
4
- * "Red" or "Green", "Tall" or "Short", etc.
5
- */
6
- export interface DaffFilterEqualOption extends DaffFilterOptionBase {
7
- /**
8
- * The id of the filter option.
9
- */
10
- value: string;
11
- /**
12
- * A label to represent the filter option in the UI.
13
- */
14
- label: string;
15
- /**
16
- * The number of entities that would be returned after application of this filter.
17
- */
18
- count: number;
19
- }
@@ -1,4 +0,0 @@
1
- export { DaffFilterEqual } from './filter';
2
- export { DaffFilterEqualOption } from './option';
3
- export { DaffFilterEqualRequest } from './request';
4
- export { DaffFilterEqualToggleRequest } from './toggle-request';
@@ -1,18 +0,0 @@
1
- import { DaffFilterType } from '../filter-type';
2
- /**
3
- * A request used to modify the applied status of a {@link DaffFilterEqual}.
4
- */
5
- export interface DaffFilterEqualRequest {
6
- /**
7
- * The type of filter request.
8
- */
9
- type: DaffFilterType.Equal;
10
- /**
11
- * The name of the filter; e.g. color.
12
- */
13
- name: string;
14
- /**
15
- * An array of filter options; e.g. green and red.
16
- */
17
- value: string[];
18
- }
@@ -1,18 +0,0 @@
1
- import { DaffFilterType } from '../filter-type';
2
- /**
3
- * A request used to toggle the applied status of a {@link DaffFilterEqual}.
4
- */
5
- export interface DaffFilterEqualToggleRequest {
6
- /**
7
- * The type of filter request.
8
- */
9
- type: DaffFilterType.Equal;
10
- /**
11
- * The name of the filter; e.g. color.
12
- */
13
- name: string;
14
- /**
15
- * The value of the filter option; e.g. red.
16
- */
17
- value: string;
18
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * The known types of filters.
3
- */
4
- export declare enum DaffFilterType {
5
- Equal = "equal",
6
- RangeNumeric = "rangeNumeric"
7
- }
@@ -1,23 +0,0 @@
1
- import { DaffFilterRangePair } from './pair';
2
- import { DaffFilterBase } from '../../filter-base';
3
- /**
4
- * A base type for a range-style filter where there is a continuous distribution
5
- * that can be selected from. E.g. numbers from 0 through 100, letters from "a"
6
- * through "z", or dates from "1970-01-01" through "1971-01-01".
7
- *
8
- * Note that this is the generic base allowing for stricter type implementations.
9
- */
10
- export interface DaffFilterRangeBase<T> extends DaffFilterBase {
11
- /**
12
- * The minimum value for the filter range.
13
- */
14
- min: T;
15
- /**
16
- * The maximum value for the filter range.
17
- */
18
- max: T;
19
- /**
20
- * A dictionary of filter range options.
21
- */
22
- options: Record<string, DaffFilterRangePair<T>>;
23
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * A particular option of a range pair.
3
- * Holds a value and a label.
4
- */
5
- export interface DaffFilterRangeOption<T> {
6
- /**
7
- * The value for the range option; e.g. "10" for a price range option.
8
- */
9
- value: T;
10
- /**
11
- * A label to represent the range option in the UI.
12
- */
13
- label: string;
14
- }
@@ -1,20 +0,0 @@
1
- import { DaffFilterRangeOption } from './option';
2
- import { DaffFilterOptionBase } from '../../filter-option-base';
3
- /**
4
- * An pair of options of the range filter.
5
- * Specifies a pair of min and max values.
6
- */
7
- export interface DaffFilterRangePair<T> extends DaffFilterOptionBase {
8
- /**
9
- * The range pair is always set to applied, because a filter range pair exists if it is applied and does not exist if it is not applied.
10
- */
11
- applied: true;
12
- /**
13
- * The minimum range option of the filter range pair.
14
- */
15
- min: DaffFilterRangeOption<T>;
16
- /**
17
- * The maximum range option of the filter range pair.
18
- */
19
- max: DaffFilterRangeOption<T>;
20
- }
@@ -1,6 +0,0 @@
1
- export { DaffFilterRangeBase } from './filter-base';
2
- export { DaffFilterRangeOption } from './option';
3
- export { DaffFilterRangePair } from './pair';
4
- export { DaffFilterFromToFilterSeparator } from './separator';
5
- export { DaffFilterRangeRequestBase } from './request-base';
6
- export { DaffFilterRangeRequestOption } from './request-option';
@@ -1,20 +0,0 @@
1
- import { DaffFilterType } from '../filter-type';
2
- import { DaffFilterRangeRequestOption } from '../range/public_api';
3
- /**
4
- * The base interface for range requests. Range requests have a name and a
5
- * single defining the min and max values between which to filter.
6
- */
7
- export interface DaffFilterRangeRequestBase<T> {
8
- /**
9
- * The type of filter.
10
- */
11
- type: DaffFilterType;
12
- /**
13
- * The name/code of the filter; e.g. price.
14
- */
15
- name: string;
16
- /**
17
- * The value of the filter range.
18
- */
19
- value: DaffFilterRangeRequestOption<T>;
20
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * The request option represents the minimum and maximum values that
3
- * are going to be filtered as defined by a {@link DaffFilterRangeRequestBase}.
4
- */
5
- export interface DaffFilterRangeRequestOption<T> {
6
- /**
7
- * The minimum value of the filter range.
8
- */
9
- min: T;
10
- /**
11
- * The maximum value of the filter range.
12
- */
13
- max: T;
14
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * The separator between a range type filter's values
3
- * e.g. "price": "30-40".
4
- */
5
- export declare const DaffFilterFromToFilterSeparator = "-";
@@ -1,11 +0,0 @@
1
- import { DaffFilterType } from '../filter-type';
2
- import { DaffFilterRangeBase } from '../range/public_api';
3
- /**
4
- * An interface that describes filters that are a range of numbers; i.e. prices.
5
- */
6
- export interface DaffFilterRangeNumeric extends DaffFilterRangeBase<number> {
7
- /**
8
- * The type of filter.
9
- */
10
- type: DaffFilterType.RangeNumeric;
11
- }
@@ -1,3 +0,0 @@
1
- export { DaffFilterRangeNumeric } from './filter';
2
- export { DaffFilterRangeNumericRequest } from './request';
3
- export { DaffFilterRangeNumericToggleRequest } from './toggle-request';
@@ -1,11 +0,0 @@
1
- import { DaffFilterType } from '../filter-type';
2
- import { DaffFilterRangeRequestBase } from '../range/public_api';
3
- /**
4
- * Describes filter range requests for numbers; i.e. prices.
5
- */
6
- export interface DaffFilterRangeNumericRequest extends DaffFilterRangeRequestBase<number> {
7
- /**
8
- * The filter type.
9
- */
10
- type: DaffFilterType.RangeNumeric;
11
- }
@@ -1,12 +0,0 @@
1
- import { DaffFilterType } from '../filter-type';
2
- import { DaffFilterRangeRequestBase } from '../range/request-base';
3
- /**
4
- * An interface to describe toggle requests for ranged numeric filters. For example, the request could be to
5
- * toggle a price filter for the "10-20" range.
6
- */
7
- export interface DaffFilterRangeNumericToggleRequest extends DaffFilterRangeRequestBase<number> {
8
- /**
9
- * The filter type.
10
- */
11
- type: DaffFilterType.RangeNumeric;
12
- }
@@ -1,5 +0,0 @@
1
- import { DaffFilter, DaffFilters } from '../../filterable/public_api';
2
- /**
3
- * Converts a list of filters into a dictionary of filters keyed by filter name.
4
- */
5
- export declare const daffFilterArrayToDict: <T extends DaffFilter = DaffFilter>(filters: Array<T>) => DaffFilters<T>;
@@ -1,8 +0,0 @@
1
- import { DaffFilterRequest, DaffFilter } from '../../../filterable/public_api';
2
- /**
3
- * Applies a filter request to the matching filter.
4
- *
5
- * @idempotent {filter}
6
- * @throws {@link DaffFilterUnknownType}
7
- */
8
- export declare const daffApplyFilter: (request: DaffFilterRequest, filter: DaffFilter) => DaffFilter;
@@ -1,8 +0,0 @@
1
- import { DaffFilterRequest, DaffFilters } from '../../../filterable/public_api';
2
- /**
3
- * Applies a {@link DaffFilterRequest} to a dictionary of {@link DaffFilter}
4
- * returning the updated dictionary.
5
- *
6
- * @idempotent {filters}
7
- */
8
- export declare const daffApplyRequestToFilters: (request: DaffFilterRequest, filters: DaffFilters) => DaffFilters;
@@ -1,8 +0,0 @@
1
- import { DaffFilterRequest, DaffFilters } from '../../../filterable/public_api';
2
- /**
3
- * Applies filters from a {@link DaffFilterRequest} to a dictionary
4
- * of {@link DaffFilter}.
5
- *
6
- * @idempotent {filters}
7
- */
8
- export declare const daffApplyRequestsToFilters: (filtersRequests: DaffFilterRequest[], filters: DaffFilters) => DaffFilters;
@@ -1,3 +0,0 @@
1
- export { daffApplyFilter } from './apply-filter';
2
- export { daffApplyRequestToFilters } from './apply-request-to-filters';
3
- export { daffApplyRequestsToFilters } from './apply-requests-to-filters';
@@ -1,8 +0,0 @@
1
- import { DaffFilter } from '../../../filterable/public_api';
2
- /**
3
- * Undoes the applied state of all applied filter options of a {@link DaffFilter}
4
- * returning the filter.
5
- *
6
- * @idempotent {filter}
7
- */
8
- export declare const daffClearFilter: (filter: DaffFilter) => DaffFilter;
@@ -1,8 +0,0 @@
1
- import { DaffFilters } from '../../../filterable/public_api';
2
- /**
3
- * Undoes the applied state of all applied filter options of a dictionary of {@link DaffFilter}
4
- * returning updated dictionary.
5
- *
6
- * @idempotent {filters}
7
- */
8
- export declare const daffClearFilters: (filters: DaffFilters) => DaffFilters;
@@ -1,2 +0,0 @@
1
- export { daffClearFilter } from './clear-filter';
2
- export { daffClearFilters } from './clear-filters';
@@ -1,3 +0,0 @@
1
- export { daffRemoveFilter } from './remove-filter';
2
- export { daffRemoveRequestFromFilters } from './remove-request-from-filters';
3
- export { daffRemoveRequestsFromFilters } from './remove-requests-from-filters';