@dwp/govuk-casa 7.0.6 → 8.0.0-beta1

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 (228) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +22 -17
  3. package/dist/{casa → assets}/css/casa-ie8.css +1 -1
  4. package/dist/assets/css/casa.css +1 -0
  5. package/dist/casa.d.ts +11 -0
  6. package/dist/casa.js +46 -0
  7. package/dist/lib/CasaTemplateLoader.d.ts +29 -0
  8. package/dist/lib/CasaTemplateLoader.js +74 -0
  9. package/dist/lib/JourneyContext.d.ts +297 -0
  10. package/dist/lib/JourneyContext.js +581 -0
  11. package/dist/lib/MutableRouter.d.ts +155 -0
  12. package/dist/lib/MutableRouter.js +277 -0
  13. package/dist/lib/Plan.d.ts +154 -0
  14. package/dist/lib/Plan.js +442 -0
  15. package/dist/lib/ValidationError.d.ts +74 -0
  16. package/dist/lib/ValidationError.js +159 -0
  17. package/dist/lib/ValidatorFactory.d.ts +83 -0
  18. package/dist/lib/ValidatorFactory.js +106 -0
  19. package/dist/lib/configuration-ingestor.d.ts +262 -0
  20. package/dist/lib/configuration-ingestor.js +490 -0
  21. package/dist/lib/configure.d.ts +90 -0
  22. package/dist/lib/configure.js +192 -0
  23. package/dist/lib/dirname.cjs +1 -0
  24. package/dist/lib/dirname.d.cts +2 -0
  25. package/dist/lib/end-session.d.ts +13 -0
  26. package/dist/lib/end-session.js +43 -0
  27. package/dist/lib/field.d.ts +77 -0
  28. package/dist/lib/field.js +255 -0
  29. package/dist/lib/index.d.ts +14 -0
  30. package/dist/lib/index.js +54 -0
  31. package/dist/lib/logger.d.ts +9 -0
  32. package/dist/lib/logger.js +18 -0
  33. package/dist/lib/nunjucks-filters.d.ts +26 -0
  34. package/dist/lib/nunjucks-filters.js +90 -0
  35. package/dist/lib/nunjucks.d.ts +23 -0
  36. package/dist/lib/nunjucks.js +49 -0
  37. package/dist/lib/utils.d.ts +48 -0
  38. package/dist/lib/utils.js +111 -0
  39. package/dist/lib/validators/dateObject.d.ts +4 -0
  40. package/dist/lib/validators/dateObject.js +135 -0
  41. package/dist/lib/validators/email.d.ts +4 -0
  42. package/dist/lib/validators/email.js +46 -0
  43. package/dist/lib/validators/inArray.d.ts +4 -0
  44. package/dist/lib/validators/inArray.js +60 -0
  45. package/dist/lib/validators/index.d.ts +21 -0
  46. package/dist/lib/validators/index.js +47 -0
  47. package/dist/lib/validators/nino.d.ts +4 -0
  48. package/dist/lib/validators/nino.js +46 -0
  49. package/dist/lib/validators/postalAddressObject.d.ts +4 -0
  50. package/dist/lib/validators/postalAddressObject.js +123 -0
  51. package/dist/lib/validators/regex.d.ts +4 -0
  52. package/dist/lib/validators/regex.js +40 -0
  53. package/dist/lib/validators/required.d.ts +4 -0
  54. package/dist/lib/validators/required.js +56 -0
  55. package/dist/lib/validators/strlen.d.ts +4 -0
  56. package/dist/lib/validators/strlen.js +51 -0
  57. package/dist/lib/validators/wordCount.d.ts +5 -0
  58. package/dist/lib/validators/wordCount.js +54 -0
  59. package/dist/lib/waypoint-url.d.ts +23 -0
  60. package/dist/lib/waypoint-url.js +52 -0
  61. package/dist/middleware/body-parser.d.ts +1 -0
  62. package/dist/middleware/body-parser.js +24 -0
  63. package/dist/middleware/csrf.d.ts +1 -0
  64. package/dist/middleware/csrf.js +31 -0
  65. package/dist/middleware/data.d.ts +5 -0
  66. package/dist/middleware/data.js +53 -0
  67. package/dist/middleware/dirname.cjs +1 -0
  68. package/dist/middleware/dirname.d.cts +2 -0
  69. package/dist/middleware/gather-fields.d.ts +6 -0
  70. package/dist/middleware/gather-fields.js +48 -0
  71. package/dist/middleware/i18n.d.ts +4 -0
  72. package/dist/middleware/i18n.js +88 -0
  73. package/dist/middleware/post.d.ts +3 -0
  74. package/dist/middleware/post.js +57 -0
  75. package/dist/middleware/pre.d.ts +3 -0
  76. package/dist/middleware/pre.js +51 -0
  77. package/dist/middleware/progress-journey.d.ts +6 -0
  78. package/dist/middleware/progress-journey.js +80 -0
  79. package/dist/middleware/sanitise-fields.d.ts +5 -0
  80. package/dist/middleware/sanitise-fields.js +53 -0
  81. package/dist/middleware/session.d.ts +11 -0
  82. package/dist/middleware/session.js +121 -0
  83. package/dist/middleware/skip-waypoint.d.ts +5 -0
  84. package/dist/middleware/skip-waypoint.js +43 -0
  85. package/dist/middleware/steer-journey.d.ts +7 -0
  86. package/dist/middleware/steer-journey.js +62 -0
  87. package/dist/middleware/validate-fields.d.ts +7 -0
  88. package/dist/middleware/validate-fields.js +67 -0
  89. package/dist/mjs/esm-wrapper.js +11 -0
  90. package/dist/mjs/package.json +3 -0
  91. package/dist/package.json +3 -0
  92. package/dist/routes/ancillary.d.ts +11 -0
  93. package/dist/routes/ancillary.js +27 -0
  94. package/dist/routes/dirname.cjs +1 -0
  95. package/dist/routes/dirname.d.cts +2 -0
  96. package/dist/routes/journey.d.ts +8 -0
  97. package/dist/routes/journey.js +127 -0
  98. package/dist/routes/static.d.ts +26 -0
  99. package/dist/routes/static.js +68 -0
  100. package/package.json +64 -89
  101. package/views/casa/components/checkboxes/template.njk +4 -1
  102. package/views/casa/components/date-input/template.njk +3 -3
  103. package/views/casa/components/journey-form/README.md +3 -1
  104. package/views/casa/components/journey-form/template.njk +1 -1
  105. package/views/casa/components/postal-address-object/template.njk +5 -5
  106. package/views/casa/components/radios/template.njk +1 -1
  107. package/views/casa/errors/static.njk +11 -0
  108. package/views/casa/layouts/journey.njk +26 -9
  109. package/views/casa/layouts/main.njk +7 -20
  110. package/views/casa/partials/scripts.njk +8 -3
  111. package/views/casa/partials/styles.njk +2 -2
  112. package/casa.js +0 -208
  113. package/definitions/review-page.js +0 -60
  114. package/dist/casa/css/casa.css +0 -1
  115. package/dist/casa/js/casa.js +0 -1
  116. package/index.d.ts +0 -121
  117. package/lib/ConfigIngestor.js +0 -588
  118. package/lib/GatherModifier.js +0 -14
  119. package/lib/I18n.js +0 -160
  120. package/lib/JourneyContext.d.ts +0 -97
  121. package/lib/JourneyContext.js +0 -552
  122. package/lib/JourneyMap.js +0 -233
  123. package/lib/JourneyRoad.js +0 -330
  124. package/lib/Logger.js +0 -59
  125. package/lib/PageDictionary.d.ts +0 -11
  126. package/lib/PageDirectory.js +0 -77
  127. package/lib/Plan.js +0 -423
  128. package/lib/RoadConverter.js +0 -153
  129. package/lib/UserJourney.js +0 -8
  130. package/lib/Util.js +0 -227
  131. package/lib/Validation.js +0 -20
  132. package/lib/bootstrap/end-session.js +0 -44
  133. package/lib/bootstrap/load-definitions.js +0 -64
  134. package/lib/commonBodyParser.js +0 -15
  135. package/lib/enums.js +0 -6
  136. package/lib/gather-modifiers/index.js +0 -7
  137. package/lib/gather-modifiers/trimPostalAddressObject.js +0 -75
  138. package/lib/gather-modifiers/trimWhitespace.js +0 -16
  139. package/lib/utils/createGetRequest.d.ts +0 -5
  140. package/lib/utils/createGetRequest.js +0 -59
  141. package/lib/utils/index.js +0 -11
  142. package/lib/utils/parseRequest.d.ts +0 -5
  143. package/lib/utils/parseRequest.js +0 -72
  144. package/lib/utils/sanitise.js +0 -74
  145. package/lib/utils/validate.js +0 -32
  146. package/lib/validation/ArrayObjectField.js +0 -49
  147. package/lib/validation/ObjectField.js +0 -53
  148. package/lib/validation/SimpleField.d.ts +0 -11
  149. package/lib/validation/SimpleField.js +0 -46
  150. package/lib/validation/ValidationError.d.ts +0 -14
  151. package/lib/validation/ValidationError.js +0 -170
  152. package/lib/validation/ValidatorFactory.d.ts +0 -32
  153. package/lib/validation/ValidatorFactory.js +0 -91
  154. package/lib/validation/index.js +0 -22
  155. package/lib/validation/processor/flattenErrorArray.js +0 -24
  156. package/lib/validation/processor/queue.js +0 -214
  157. package/lib/validation/processor.js +0 -84
  158. package/lib/validation/rules/README.md +0 -3
  159. package/lib/validation/rules/ValidationRules.d.ts +0 -22
  160. package/lib/validation/rules/dateObject.js +0 -156
  161. package/lib/validation/rules/email.js +0 -44
  162. package/lib/validation/rules/inArray.js +0 -61
  163. package/lib/validation/rules/index.js +0 -23
  164. package/lib/validation/rules/nino.js +0 -48
  165. package/lib/validation/rules/optional.js +0 -14
  166. package/lib/validation/rules/postalAddressObject.js +0 -142
  167. package/lib/validation/rules/regex.js +0 -39
  168. package/lib/validation/rules/required.js +0 -57
  169. package/lib/validation/rules/strlen.js +0 -57
  170. package/lib/validation/rules/wordCount.js +0 -61
  171. package/lib/view-filters/formatDateObject.js +0 -35
  172. package/lib/view-filters/includes.js +0 -10
  173. package/lib/view-filters/index.js +0 -23
  174. package/lib/view-filters/mergeObjectsDeep.js +0 -21
  175. package/lib/view-filters/renderAsAttributes.js +0 -33
  176. package/middleware/errors/404.js +0 -12
  177. package/middleware/errors/catch-all.js +0 -27
  178. package/middleware/errors/index.js +0 -9
  179. package/middleware/headers/config-defaults.js +0 -57
  180. package/middleware/headers/headers.js +0 -40
  181. package/middleware/headers/index.js +0 -9
  182. package/middleware/i18n/i18n.js +0 -56
  183. package/middleware/i18n/index.js +0 -16
  184. package/middleware/index.js +0 -55
  185. package/middleware/mount/index.js +0 -9
  186. package/middleware/mount/mount.js +0 -10
  187. package/middleware/nunjucks/environment.js +0 -57
  188. package/middleware/nunjucks/index.js +0 -8
  189. package/middleware/page/csrf.js +0 -37
  190. package/middleware/page/edit-mode.js +0 -52
  191. package/middleware/page/gather.js +0 -75
  192. package/middleware/page/index.js +0 -103
  193. package/middleware/page/journey-continue.js +0 -157
  194. package/middleware/page/journey-rails.js +0 -102
  195. package/middleware/page/prepare-request.js +0 -77
  196. package/middleware/page/render.js +0 -75
  197. package/middleware/page/skip.js +0 -72
  198. package/middleware/page/utils.js +0 -206
  199. package/middleware/page/validate.js +0 -67
  200. package/middleware/session/expiry.js +0 -95
  201. package/middleware/session/genid.js +0 -18
  202. package/middleware/session/index.js +0 -18
  203. package/middleware/session/init.js +0 -25
  204. package/middleware/session/seed.js +0 -50
  205. package/middleware/session/timeout.js +0 -5
  206. package/middleware/static/asset-versions.js +0 -23
  207. package/middleware/static/index.js +0 -104
  208. package/middleware/static/prepare-assets.js +0 -51
  209. package/middleware/static/serve-assets.js +0 -58
  210. package/middleware/variables/index.js +0 -12
  211. package/middleware/variables/variables.js +0 -35
  212. package/src/browserconfig.xml +0 -5
  213. package/src/js/casa.js +0 -132
  214. package/src/scss/_casaElements.scss +0 -11
  215. package/src/scss/_casaGovukTemplateJinjaPolyfill.scss +0 -39
  216. package/src/scss/_casaMountUrl.scss +0 -8
  217. package/src/scss/casa-ie8.scss +0 -3
  218. package/src/scss/casa.scss +0 -14
  219. package/test/unit/templates/README.md +0 -5
  220. package/test/utils/BaseTestWaypoint.js +0 -106
  221. package/test/utils/concatWaypoints.js +0 -26
  222. package/test/utils/index.js +0 -6
  223. package/test/utils/testTraversal.js +0 -90
  224. package/views/casa/partials/cookie_message.njk +0 -3
  225. package/views/casa/partials/phase_banner_alpha.njk +0 -8
  226. package/views/casa/partials/phase_banner_beta.njk +0 -8
  227. package/views/casa/review/page-block.njk +0 -8
  228. package/views/casa/review/review.njk +0 -47
@@ -0,0 +1,297 @@
1
+ /**
2
+ * @typedef {import('./configuration-ingestor').Page} Page
3
+ */
4
+ /**
5
+ * @callback ContextEventHandler
6
+ * @param {JourneyContext} journeyContext Context including changes
7
+ * @param {JourneyContext} previousContext Context prior to changes
8
+ * @returns {void}
9
+ */
10
+ /**
11
+ * @typedef {object} ContextEvent
12
+ * @property {string} waypoint Waypoint to watch for changes
13
+ * @property {string} [field] Field to watch for changes
14
+ * @property {ContextEventHandler} handler Handler to invoke when change happens
15
+ */
16
+ export default class JourneyContext {
17
+ static DEFAULT_CONTEXT_ID: string;
18
+ /**
19
+ * Create a new JourneyContext using the plain object.
20
+ *
21
+ * @param {object} obj Object.
22
+ * @param {object} obj.data Data
23
+ * @param {object} obj.validation Validation state
24
+ * @param {object} obj.nav Navigation meta
25
+ * @param {object} obj.identity Identity meta
26
+ * @returns {JourneyContext} Instance.
27
+ */
28
+ static fromObject({ data, validation, nav, identity, }?: {
29
+ data: object;
30
+ validation: object;
31
+ nav: object;
32
+ identity: object;
33
+ }): JourneyContext;
34
+ /**
35
+ * Construct a new JourneyContext instance frmo another instance.
36
+ *
37
+ * @param {JourneyContext} context Context to copy from
38
+ * @returns {JourneyContext} Constructed JourneyContext instance
39
+ * @throws {TypeError} When context is not a valid type
40
+ */
41
+ static fromContext(context: JourneyContext): JourneyContext;
42
+ /**
43
+ * Initialise session with an empty entry for the "default" context.
44
+ *
45
+ * @param {object} session Request session
46
+ * @returns {void}
47
+ */
48
+ static initContextStore(session: object): void;
49
+ /**
50
+ * Validate the format of a context ID, i.e. "default" or a uuid
51
+ * eg 00000000-0000-0000-0000-000000000000
52
+ * eg 123e4567-e89b-12d3-a456-426614174000
53
+ *
54
+ * @param {string} id Context ID
55
+ * @returns {string} Original ID if it's valid
56
+ * @throws {TypeError} When id is not a valid type
57
+ * @throws {SyntaxError} When id is not a valid uuid format
58
+ */
59
+ static validateContextId(id: string): string;
60
+ /**
61
+ * Lookup context from session using the ID.
62
+ *
63
+ * @param {object} session Request session
64
+ * @param {string} id Context ID
65
+ * @returns {JourneyContext} The discovered JourneyContext instance
66
+ */
67
+ static getContextById(session: object, id: string): JourneyContext;
68
+ /**
69
+ * Lookup context from session using the name.
70
+ *
71
+ * @param {object} session Request session
72
+ * @param {string} name Context name
73
+ * @returns {JourneyContext} The discovered JourneyContext instance
74
+ */
75
+ static getContextByName(session: object, name: string): JourneyContext;
76
+ /**
77
+ * Lookup contexts from session using the tag.
78
+ *
79
+ * @param {object} session Request session
80
+ * @param {string} tag Context tag
81
+ * @returns {Array<JourneyContext>} The discovered JourneyContext instance
82
+ */
83
+ static getContextsByTag(session: object, tag: string): Array<JourneyContext>;
84
+ /**
85
+ * Return all contexts currently stored in the session.
86
+ *
87
+ * @param {object} session Request session
88
+ * @returns {Array} Array of contexts
89
+ */
90
+ static getContexts(session: object): any[];
91
+ /**
92
+ * Put context back into the session store.
93
+ *
94
+ * @param {object} session Request session
95
+ * @param {JourneyContext} context Context
96
+ * @returns {void}
97
+ * @throws {TypeError} When isession is not a valid type, or context has no ID
98
+ */
99
+ static putContext(session: object, context: JourneyContext): void;
100
+ /**
101
+ * Remove a context from the session store.
102
+ *
103
+ * @param {object} session Request session
104
+ * @param {JourneyContext} context Context
105
+ * @returns {void}
106
+ */
107
+ static removeContext(session: object, context: JourneyContext): void;
108
+ static removeContextById(session: any, id: any): void;
109
+ static removeContextByName(session: any, name: any): void;
110
+ static removeContextsByTag(session: any, tag: any): void;
111
+ static removeContexts(session: any): void;
112
+ static extractContextFromRequest(req: any): JourneyContext;
113
+ /**
114
+ * Constructor.
115
+ *
116
+ * `data` is the "single source of truth" for all data gathered during the
117
+ * user's journey. This is referred to as the "canonical data model".
118
+ * Page-specific "views" of this data are generated at runtime in order to
119
+ * populate/validate specific form fields.
120
+ *
121
+ * `validation` holds the results of form field validation carried out when
122
+ * page forms are POSTed. These results are mapped directly to per-page,
123
+ * per-field.
124
+ *
125
+ * `nav` holds information about the current navigation state. Currently this
126
+ * comprises of the language in which the user is navigating the service.
127
+ *
128
+ * `identity` holds information that helps uniquely identify this context
129
+ * among a group of contexts stored in the session.
130
+ *
131
+ * @param {object} data Entire journey data.
132
+ * @param {object} validation Page errors (indexed by waypoint id).
133
+ * @param {object} nav Navigation context.
134
+ * @param {object} identity Some metadata for identifying this context among others.
135
+ */
136
+ constructor(data?: object, validation?: object, nav?: object, identity?: object);
137
+ /**
138
+ * Clone into an object that can be stringified.
139
+ *
140
+ * @returns {object} Plain object.
141
+ */
142
+ toObject(): object;
143
+ set data(arg: object);
144
+ get data(): object;
145
+ get validation(): object;
146
+ get nav(): object;
147
+ get identity(): object;
148
+ /**
149
+ * Get data context for a specific a specific page.
150
+ *
151
+ * @param {string | Page} page Page waypoint ID, or Page object.
152
+ * @returns {object} Page data.
153
+ * @throws {TypeError} When page is invalid.
154
+ */
155
+ getDataForPage(page: string | Page): object;
156
+ getData(): object;
157
+ /**
158
+ * Overwrite the data context with a new object.
159
+ *
160
+ * @param {object} data Data that will overwrite all existing data.
161
+ * @returns {JourneyContext} Chain.
162
+ */
163
+ setData(data: object): JourneyContext;
164
+ /**
165
+ * Write field form data from a page HTML form, into the `data` model.
166
+ *
167
+ * By default this will store the data as-is, keyed against the page's
168
+ * waypoint ID. However, when passing a `Page` instance, its
169
+ * `fieldWriter()` method will be called to transform the provided formData
170
+ * before storing in `data`
171
+ *
172
+ * @param {string | Page} page Page waypoint ID, or Page object
173
+ * @param {object} webFormData Data to overwrite with
174
+ * @returns {JourneyContext} Chain
175
+ * @throws {TypeError} When page is invalid.
176
+ */
177
+ setDataForPage(page: string | Page, webFormData: object): JourneyContext;
178
+ /**
179
+ * Return validation errors for all pages.
180
+ *
181
+ * @returns {object} All page validation errors.
182
+ */
183
+ getValidationErrors(): object;
184
+ /**
185
+ * Removes any validation state for the given page. Clearing validation state
186
+ * completely will, by default, prevent onward traversal from this page. See
187
+ * the traversal logic in Plan class.
188
+ *
189
+ * @param {string} pageId Page ID.
190
+ * @returns {JourneyContext} Chain.
191
+ */
192
+ removeValidationStateForPage(pageId: string): JourneyContext;
193
+ /**
194
+ * Clear any validation errors for the given page. This effectively declares
195
+ * that this page has been successfully validated, and so can be traversed. If
196
+ * you want to remove any knowledge of validation success/failure, use
197
+ * `removeValidationStateForPage()` instead.
198
+ *
199
+ * @param {string} pageId Page ID.
200
+ * @returns {JourneyContext} Chain.
201
+ */
202
+ clearValidationErrorsForPage(pageId: string): JourneyContext;
203
+ /**
204
+ * Set validation errors for a page.
205
+ *
206
+ * @param {string} pageId Page ID.
207
+ * @param {ValidationError[]} errors Errors
208
+ * @returns {JourneyContext} Chain.
209
+ * @throws {SyntaxError} When errors are invalid.
210
+ */
211
+ setValidationErrorsForPage(pageId: string, errors?: ValidationError[]): JourneyContext;
212
+ /**
213
+ * Return the validation errors associated with the page's currently held data
214
+ * context (if any).
215
+ *
216
+ * @param {string} pageId Page ID.
217
+ * @returns {ValidationError[]} An array of errors
218
+ */
219
+ getValidationErrorsForPage(pageId: string): ValidationError[];
220
+ getValidationErrorsForPageByField(pageId: any): any;
221
+ /**
222
+ * Determine whether the specified page has any errors in its validation
223
+ * context.
224
+ *
225
+ * @param {string} pageId Page ID.
226
+ * @returns {boolean} Result.
227
+ */
228
+ hasValidationErrorsForPage(pageId: string): boolean;
229
+ /**
230
+ * Set language of the context.
231
+ *
232
+ * @param {string} language Language to set (ISO 639-1 2-letter code).
233
+ * @returns {JourneyContext} Chain.
234
+ */
235
+ setNavigationLanguage(language?: string): JourneyContext;
236
+ /**
237
+ * Convenience function to test if page is valid.
238
+ *
239
+ * @param {string} pageId Page ID.
240
+ * @returns {boolean} True if the page is valid.
241
+ */
242
+ isPageValid(pageId: string): boolean;
243
+ /**
244
+ * Remove information about these waypoints.
245
+ *
246
+ * @param {string[]} waypoints Waypoints to be removed
247
+ */
248
+ purge(waypoints?: string[]): void;
249
+ /**
250
+ * Remove validation state from these waypoints. This is useful to quickly
251
+ * force the user to revisit some waypoints.
252
+ *
253
+ * @param {string[]} waypoints Waypoints to be invalidated
254
+ * @returns {void}
255
+ */
256
+ invalidate(waypoints?: string[]): void;
257
+ /**
258
+ * Event listeners are transient. They are not stored in session, and generally
259
+ * only apply for the current request.
260
+ *
261
+ * They also only act on a fixed snapshot of this context's state, which is
262
+ * taken at the point of attaching the listeners (in the "data" middleware).
263
+ * This is important because JourneyContext.putContext()` could be called many
264
+ * times during a request, so the context will be constantly changing.
265
+ *
266
+ * @param {ContextEvent[]} events Event listeners
267
+ * @returns {JourneyContext} Chain
268
+ */
269
+ addEventListeners(events: ContextEvent[]): JourneyContext;
270
+ applyEventListeners({ event }: {
271
+ event: any;
272
+ }): JourneyContext;
273
+ /**
274
+ * Convenience method to determine if this is the default context.
275
+ *
276
+ * @returns {boolean} True if this is the "default" journey context
277
+ */
278
+ isDefault(): boolean;
279
+ #private;
280
+ }
281
+ export type Page = import('./configuration-ingestor').Page;
282
+ export type ContextEventHandler = (journeyContext: JourneyContext, previousContext: JourneyContext) => void;
283
+ export type ContextEvent = {
284
+ /**
285
+ * Waypoint to watch for changes
286
+ */
287
+ waypoint: string;
288
+ /**
289
+ * Field to watch for changes
290
+ */
291
+ field?: string | undefined;
292
+ /**
293
+ * Handler to invoke when change happens
294
+ */
295
+ handler: ContextEventHandler;
296
+ };
297
+ import ValidationError from "./ValidationError.js";