@planning-inspectorate/dynamic-forms 3.10.9 → 3.10.11

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 (151) hide show
  1. package/move-types.js +6 -8
  2. package/package.json +1 -1
  3. package/src/components/boolean/question.js +1 -1
  4. package/src/components/manage-list/utils.js +4 -4
  5. package/src/components/radio/question.js +1 -1
  6. package/src/index.js +1 -0
  7. package/src/journey/journey-response.js +2 -2
  8. package/src/journey/journey-types.js +1 -0
  9. package/src/journey/journey.js +17 -23
  10. package/src/questions/create-questions.js +1 -1
  11. package/src/questions/options-question.js +7 -3
  12. package/src/questions/question-types.d.ts +6 -0
  13. package/src/questions/question.js +18 -21
  14. package/src/validator/valid-option-validator.js +1 -5
  15. package/tsconfig.json +1 -1
  16. package/types/src/components/boolean/question.d.ts +4 -2
  17. package/types/src/components/boolean/question.d.ts.map +1 -1
  18. package/types/src/components/manage-list/utils.d.ts +6 -6
  19. package/types/src/components/manage-list/utils.d.ts.map +1 -1
  20. package/types/src/components/radio/question.d.ts +6 -2
  21. package/types/src/components/radio/question.d.ts.map +1 -1
  22. package/types/src/index.d.ts +1 -0
  23. package/types/src/journey/journey-response.d.ts +4 -4
  24. package/types/src/journey/journey-response.d.ts.map +1 -1
  25. package/types/src/journey/journey-types.d.ts +28 -0
  26. package/types/src/journey/journey-types.d.ts.map +1 -0
  27. package/types/src/journey/journey.d.ts +25 -33
  28. package/types/src/journey/journey.d.ts.map +1 -1
  29. package/types/src/questions/create-questions.d.ts +3 -3
  30. package/types/src/questions/create-questions.d.ts.map +1 -1
  31. package/types/src/questions/options-question.d.ts +10 -4
  32. package/types/src/questions/options-question.d.ts.map +1 -1
  33. package/types/src/questions/question-types.d.ts +6 -0
  34. package/types/src/questions/question.d.ts +31 -37
  35. package/types/src/questions/question.d.ts.map +1 -1
  36. package/types/src/validator/valid-option-validator.d.ts +2 -6
  37. package/types/src/validator/valid-option-validator.d.ts.map +1 -1
  38. package/types/src/components/address/question.test.d.ts +0 -2
  39. package/types/src/components/address/question.test.d.ts.map +0 -1
  40. package/types/src/components/boolean/question.test.d.ts +0 -2
  41. package/types/src/components/boolean/question.test.d.ts.map +0 -1
  42. package/types/src/components/checkbox/question.test.d.ts +0 -2
  43. package/types/src/components/checkbox/question.test.d.ts.map +0 -1
  44. package/types/src/components/date/question.test.d.ts +0 -2
  45. package/types/src/components/date/question.test.d.ts.map +0 -1
  46. package/types/src/components/date-period/question.test.d.ts +0 -2
  47. package/types/src/components/date-period/question.test.d.ts.map +0 -1
  48. package/types/src/components/date-time/question.test.d.ts +0 -2
  49. package/types/src/components/date-time/question.test.d.ts.map +0 -1
  50. package/types/src/components/email/question.test.d.ts +0 -2
  51. package/types/src/components/email/question.test.d.ts.map +0 -1
  52. package/types/src/components/identifier/question.test.d.ts +0 -2
  53. package/types/src/components/identifier/question.test.d.ts.map +0 -1
  54. package/types/src/components/manage-list/manage-list-section.test.d.ts +0 -2
  55. package/types/src/components/manage-list/manage-list-section.test.d.ts.map +0 -1
  56. package/types/src/components/manage-list/question.test.d.ts +0 -2
  57. package/types/src/components/manage-list/question.test.d.ts.map +0 -1
  58. package/types/src/components/manage-list/utils.test.d.ts +0 -2
  59. package/types/src/components/manage-list/utils.test.d.ts.map +0 -1
  60. package/types/src/components/multi-field-input/question.test.d.ts +0 -2
  61. package/types/src/components/multi-field-input/question.test.d.ts.map +0 -1
  62. package/types/src/components/radio/question.test.d.ts +0 -2
  63. package/types/src/components/radio/question.test.d.ts.map +0 -1
  64. package/types/src/components/select/question.test.d.ts +0 -2
  65. package/types/src/components/select/question.test.d.ts.map +0 -1
  66. package/types/src/components/single-line-input/question.test.d.ts +0 -2
  67. package/types/src/components/single-line-input/question.test.d.ts.map +0 -1
  68. package/types/src/components/text-entry/question.test.d.ts +0 -2
  69. package/types/src/components/text-entry/question.test.d.ts.map +0 -1
  70. package/types/src/components/text-entry-redact/question.test.d.ts +0 -2
  71. package/types/src/components/text-entry-redact/question.test.d.ts.map +0 -1
  72. package/types/src/components/unit-option-entry/question.test.d.ts +0 -2
  73. package/types/src/components/unit-option-entry/question.test.d.ts.map +0 -1
  74. package/types/src/components/utils/question-has-answer.test.d.ts +0 -2
  75. package/types/src/components/utils/question-has-answer.test.d.ts.map +0 -1
  76. package/types/src/components/utils/question-utils.test.d.ts +0 -2
  77. package/types/src/components/utils/question-utils.test.d.ts.map +0 -1
  78. package/types/src/controller.test.d.ts +0 -2
  79. package/types/src/controller.test.d.ts.map +0 -1
  80. package/types/src/index.test.d.ts +0 -2
  81. package/types/src/index.test.d.ts.map +0 -1
  82. package/types/src/journey/journey-response.test.d.ts +0 -2
  83. package/types/src/journey/journey-response.test.d.ts.map +0 -1
  84. package/types/src/journey/journey.test.d.ts +0 -2
  85. package/types/src/journey/journey.test.d.ts.map +0 -1
  86. package/types/src/lib/address-utils.test.d.ts +0 -2
  87. package/types/src/lib/address-utils.test.d.ts.map +0 -1
  88. package/types/src/lib/address.test.d.ts +0 -2
  89. package/types/src/lib/address.test.d.ts.map +0 -1
  90. package/types/src/lib/date-utils.test.d.ts +0 -2
  91. package/types/src/lib/date-utils.test.d.ts.map +0 -1
  92. package/types/src/lib/session-answer-store.test.d.ts +0 -2
  93. package/types/src/lib/session-answer-store.test.d.ts.map +0 -1
  94. package/types/src/lib/utils.test.d.ts +0 -2
  95. package/types/src/lib/utils.test.d.ts.map +0 -1
  96. package/types/src/lib/uuid.test.d.ts +0 -2
  97. package/types/src/lib/uuid.test.d.ts.map +0 -1
  98. package/types/src/middleware/redirect-to-unanswered-question.test.d.ts +0 -2
  99. package/types/src/middleware/redirect-to-unanswered-question.test.d.ts.map +0 -1
  100. package/types/src/questions/options-question.test.d.ts +0 -2
  101. package/types/src/questions/options-question.test.d.ts.map +0 -1
  102. package/types/src/questions/question.test.d.ts +0 -2
  103. package/types/src/questions/question.test.d.ts.map +0 -1
  104. package/types/src/section.test.d.ts +0 -2
  105. package/types/src/section.test.d.ts.map +0 -1
  106. package/types/src/validator/address-validator.test.d.ts +0 -2
  107. package/types/src/validator/address-validator.test.d.ts.map +0 -1
  108. package/types/src/validator/base-validator.test.d.ts +0 -2
  109. package/types/src/validator/base-validator.test.d.ts.map +0 -1
  110. package/types/src/validator/conditional-required-validator.test.d.ts +0 -2
  111. package/types/src/validator/conditional-required-validator.test.d.ts.map +0 -1
  112. package/types/src/validator/confirmation-checkbox-validator.test.d.ts +0 -2
  113. package/types/src/validator/confirmation-checkbox-validator.test.d.ts.map +0 -1
  114. package/types/src/validator/coordinates-validator.test.d.ts +0 -2
  115. package/types/src/validator/coordinates-validator.test.d.ts.map +0 -1
  116. package/types/src/validator/date-period-validator.test.d.ts +0 -2
  117. package/types/src/validator/date-period-validator.test.d.ts.map +0 -1
  118. package/types/src/validator/date-time-validator.test.d.ts +0 -2
  119. package/types/src/validator/date-time-validator.test.d.ts.map +0 -1
  120. package/types/src/validator/date-validator.test.d.ts +0 -2
  121. package/types/src/validator/date-validator.test.d.ts.map +0 -1
  122. package/types/src/validator/document-upload-validator.test.d.ts +0 -2
  123. package/types/src/validator/document-upload-validator.test.d.ts.map +0 -1
  124. package/types/src/validator/email-validator.test.d.ts +0 -2
  125. package/types/src/validator/email-validator.test.d.ts.map +0 -1
  126. package/types/src/validator/multi-field-input-validator.test.d.ts +0 -2
  127. package/types/src/validator/multi-field-input-validator.test.d.ts.map +0 -1
  128. package/types/src/validator/numeric-validator.test.d.ts +0 -2
  129. package/types/src/validator/numeric-validator.test.d.ts.map +0 -1
  130. package/types/src/validator/required-validator.test.d.ts +0 -2
  131. package/types/src/validator/required-validator.test.d.ts.map +0 -1
  132. package/types/src/validator/same-answer-validator.test.d.ts +0 -2
  133. package/types/src/validator/same-answer-validator.test.d.ts.map +0 -1
  134. package/types/src/validator/string-validator.test.d.ts +0 -2
  135. package/types/src/validator/string-validator.test.d.ts.map +0 -1
  136. package/types/src/validator/unit-option-entry-validator.test.d.ts +0 -2
  137. package/types/src/validator/unit-option-entry-validator.test.d.ts.map +0 -1
  138. package/types/src/validator/valid-option-validator.test.d.ts +0 -2
  139. package/types/src/validator/valid-option-validator.test.d.ts.map +0 -1
  140. package/types/src/validator/validation-error-handler.test.d.ts +0 -2
  141. package/types/src/validator/validation-error-handler.test.d.ts.map +0 -1
  142. package/types/src/validator/validator.test.d.ts +0 -2
  143. package/types/src/validator/validator.test.d.ts.map +0 -1
  144. package/types/test/mock/journey.d.ts +0 -3
  145. package/types/test/mock/journey.d.ts.map +0 -1
  146. package/types/test/mock/uuid.d.ts +0 -7
  147. package/types/test/mock/uuid.d.ts.map +0 -1
  148. package/types/test/utils/nunjucks.d.ts +0 -2
  149. package/types/test/utils/nunjucks.d.ts.map +0 -1
  150. package/types/test/utils/utils.d.ts +0 -32
  151. package/types/test/utils/utils.d.ts.map +0 -1
@@ -1,8 +1,3 @@
1
- /**
2
- * @typedef {import('./journey-response').JourneyResponse} JourneyResponse
3
- * @typedef {import('../section').Section} Section
4
- * @typedef {import('../questions/question').Question} Question
5
- */
6
1
  /**
7
2
  * A journey (An entire set of questions required for a completion of a submission)
8
3
  * @class
@@ -12,40 +7,40 @@ export class Journey {
12
7
  * creates an instance of a journey
13
8
  * @param {object} options
14
9
  * @param {string} options.journeyId - a unique, human-readable id for this journey
15
- * @param {(response: JourneyResponse) => string} options.makeBaseUrl - base url of journey
10
+ * @param {(response: import('./journey-response.js').JourneyResponse) => string} options.makeBaseUrl - base url of journey
16
11
  * @param {string} [options.taskListUrl] - task list url - added to base url, can be left undefined
17
- * @param {JourneyResponse} options.response - user's response
12
+ * @param {import('./journey-response.js').JourneyResponse} options.response - user's response
18
13
  * @param {string} options.journeyTemplate - template used for all views
19
14
  * @param {string} options.taskListTemplate - path to njk view for listing page
20
15
  * @param {string} [options.informationPageViewPath] - path to njk view for pdf summary page
21
16
  * @param {string} options.journeyTitle - part of the title in the njk view
22
17
  * @param {boolean} [options.returnToListing] - defines how the next/previous question handles end of sections
23
- * @param {Section[]} options.sections
18
+ * @param {import('../section.js').Section[]} options.sections
24
19
  * @param {string} [options.initialBackLink] - back link when on the first question
25
20
  */
26
21
  constructor({ journeyId, makeBaseUrl, taskListUrl, response, journeyTemplate, taskListTemplate, informationPageViewPath, journeyTitle, returnToListing, sections, initialBackLink }: {
27
22
  journeyId: string;
28
- makeBaseUrl: (response: JourneyResponse) => string;
23
+ makeBaseUrl: (response: import("./journey-response.js").JourneyResponse) => string;
29
24
  taskListUrl?: string | undefined;
30
- response: JourneyResponse;
25
+ response: import("./journey-response.js").JourneyResponse;
31
26
  journeyTemplate: string;
32
27
  taskListTemplate: string;
33
28
  informationPageViewPath?: string | undefined;
34
29
  journeyTitle: string;
35
30
  returnToListing?: boolean | undefined;
36
- sections: Section[];
31
+ sections: import("../section.js").Section[];
37
32
  initialBackLink?: string | undefined;
38
33
  });
39
34
  /** @type {string} journeyId - a unique, human-readable id for this journey */
40
35
  journeyId: string;
41
- /** @type {Array.<Section>} sections - sections within the journey */
42
- sections: Array<Section>;
43
- /** @type {JourneyResponse} response - the user's response to the journey so far */
44
- response: JourneyResponse;
36
+ /** @type {Array.<import('../section.js').Section>} sections - sections within the journey */
37
+ sections: Array<import("../section.js").Section>;
38
+ /** @type {import('./journey-response.js').JourneyResponse} response - the user's response to the journey so far */
39
+ response: import("./journey-response.js").JourneyResponse;
45
40
  /** @type {string} baseUrl - base url of the journey, gets prepended to question urls */
46
41
  baseUrl: string;
47
- /** @type {(journeyResponse: JourneyResponse) => string} baseUrl - base url of the journey, gets prepended to question urls */
48
- makeBaseUrl: (journeyResponse: JourneyResponse) => string;
42
+ /** @type {(journeyResponse: import('./journey-response.js').JourneyResponse) => string} makeBaseUrl - function to generate base url of the journey */
43
+ makeBaseUrl: (journeyResponse: import("./journey-response.js").JourneyResponse) => string;
49
44
  /** @type {string} taskListUrl - url that renders the task list */
50
45
  taskListUrl: string;
51
46
  /** @type {string} journeyTemplate - nunjucks template file used for */
@@ -62,25 +57,25 @@ export class Journey {
62
57
  /**
63
58
  * Gets section based on segment
64
59
  * @param {string} sectionSegment
65
- * @returns {Section | undefined}
60
+ * @returns {import('../section.js').Section | undefined}
66
61
  */
67
- getSection(sectionSegment: string): Section | undefined;
62
+ getSection(sectionSegment: string): import("../section.js").Section | undefined;
68
63
  /**
69
64
  * gets a question from the object's sections based on a section + question names
70
- * @param {import('./journey-types.d.ts').RouteParams} params
71
- * @returns {Question | undefined} question found by lookup
65
+ * @param {import('./journey-types.js').RouteParams} params
66
+ * @returns {import('../questions/question.js').Question | undefined} question found by lookup
72
67
  */
73
- getQuestionByParams(params: import("./journey-types.d.ts").RouteParams): Question | undefined;
68
+ getQuestionByParams(params: import("./journey-types.js").RouteParams): import("../questions/question.js").Question | undefined;
74
69
  /**
75
70
  * Get the back link for the journey - e.g. the previous question
76
71
  *
77
72
  * @param {Object} options
78
- * @param {import('./journey-types.d.ts').RouteParams} options.params
73
+ * @param {import('./journey-types.js').RouteParams} options.params
79
74
  * @param {import('#src/components/manage-list/question.js')} [options.manageListQuestion]
80
75
  * @returns {string|null} url for the next question, or null if unmatched
81
76
  */
82
77
  getBackLink({ params, manageListQuestion }: {
83
- params: import("./journey-types.d.ts").RouteParams;
78
+ params: import("./journey-types.js").RouteParams;
84
79
  manageListQuestion?: typeof import("#src/components/manage-list/question.js") | undefined;
85
80
  }): string | null;
86
81
  /**
@@ -88,21 +83,21 @@ export class Journey {
88
83
  * Used after question post/saving
89
84
  *
90
85
  * @param {import('express').Response} res
91
- * @param {import('./journey-types.d.ts').RouteParams} params
86
+ * @param {import('./journey-types.js').RouteParams} params
92
87
  * @param {import('#src/components/manage-list/question.js')} [manageListQuestion]
93
88
  * @returns {void}
94
89
  */
95
- redirectToNextQuestion(res: import("express").Response, params: import("./journey-types.d.ts").RouteParams, manageListQuestion?: typeof import("#src/components/manage-list/question.js")): void;
90
+ redirectToNextQuestion(res: import("express").Response, params: import("./journey-types.js").RouteParams, manageListQuestion?: typeof import("#src/components/manage-list/question.js")): void;
96
91
  /**
97
92
  * Get url for the next question in the journey
98
93
  *
99
- * @param {import('./journey-types.d.ts').RouteParams} params
94
+ * @param {import('./journey-types.js').RouteParams} params
100
95
  * @param {Object} options
101
96
  * @param {boolean} [options.reverse] - if passed in this will get the previous question
102
97
  * @param {import('#src/components/manage-list/question.js')} [options.manageListQuestion]
103
98
  * @returns {string|null} url for the next question, or null if unmatched
104
99
  */
105
- getNextQuestionUrl(params: import("./journey-types.d.ts").RouteParams, { reverse, manageListQuestion }?: {
100
+ getNextQuestionUrl(params: import("./journey-types.js").RouteParams, { reverse, manageListQuestion }?: {
106
101
  reverse?: boolean | undefined;
107
102
  manageListQuestion?: typeof import("#src/components/manage-list/question.js") | undefined;
108
103
  }): string | null;
@@ -133,12 +128,9 @@ export class Journey {
133
128
  */
134
129
  isComplete(): boolean;
135
130
  /**
136
- * @param {JourneyResponse} journeyResponse
131
+ * @param {import('./journey-response.js').JourneyResponse} journeyResponse
137
132
  */
138
- setResponse(journeyResponse: JourneyResponse): void;
133
+ setResponse(journeyResponse: import("./journey-response.js").JourneyResponse): void;
139
134
  #private;
140
135
  }
141
- export type JourneyResponse = any;
142
- export type Section = any;
143
- export type Question = any;
144
136
  //# sourceMappingURL=journey.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"journey.d.ts","sourceRoot":"","sources":["../../../src/journey/journey.js"],"names":[],"mappings":"AAQA;;;;GAIG;AAEH;;;GAGG;AACH;IAwBC;;;;;;;;;;;;;;OAcG;IACH,qLAZG;QAAwB,SAAS,EAAzB,MAAM;QACyC,WAAW,EAA1D,CAAC,QAAQ,EAAE,eAAe,KAAK,MAAM;QACpB,WAAW;QACH,QAAQ,EAAjC,eAAe;QACC,eAAe,EAA/B,MAAM;QACU,gBAAgB,EAAhC,MAAM;QACW,uBAAuB;QACxB,YAAY,EAA5B,MAAM;QACY,eAAe;QACd,QAAQ,EAA3B,OAAO,EAAE;QACQ,eAAe;KAC1C,EAoDA;IAzFD,8EAA8E;IAC9E,WADW,MAAM,CACP;IACV,qEAAqE;IACrE,UAD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AInB;IAED;;OAEG;IACH,6BAFW,eAAe,QAKzB;;CACD"}
1
+ {"version":3,"file":"journey.d.ts","sourceRoot":"","sources":["../../../src/journey/journey.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH;IAwBC;;;;;;;;;;;;;;OAcG;IACH,qLAZG;QAAwB,SAAS,EAAzB,MAAM;QACyE,WAAW,EAA1F,CAAC,QAAQ,EAAE,OAAO,uBAAuB,EAAE,eAAe,KAAK,MAAM;QACpD,WAAW;QAC6B,QAAQ,EAAjE,OAAO,uBAAuB,EAAE,eAAe;QAC/B,eAAe,EAA/B,MAAM;QACU,gBAAgB,EAAhC,MAAM;QACW,uBAAuB;QACxB,YAAY,EAA5B,MAAM;QACY,eAAe;QACU,QAAQ,EAAnD,OAAO,eAAe,EAAE,OAAO,EAAE;QAChB,eAAe;KAC1C,EAoDA;IAzFD,8EAA8E;IAC9E,WADW,MAAM,CACP;IACV,6FAA6F;IAC7F,UADW,KAAK,CAAE,OAAO,eAAe,EAAE,OAAO,CAAC,CACpC;IACd,mHAAmH;IACnH,UADW,OAAO,uBAAuB,EAAE,eAAe,CACjD;IACT,wFAAwF;IACxF,SADW,MAAM,CACJ;IACb,sJAAsJ;IACtJ,aADW,CAAC,eAAe,EAAE,OAAO,uBAAuB,EAAE,eAAe,KAAK,MAAM,CAChE;IACvB,kEAAkE;IAClE,aADW,MAAM,CACA;IACjB,uEAAuE;IACvE,iBADW,MAAM,CACI;IACrB,qFAAqF;IACrF,kBADW,MAAM,CACK;IACtB,4GAA4G;IAC5G,yBADW,MAAM,CACY;IAC7B,qFAAqF;IACrF,iBADW,OAAO,CACM;IACxB,2DAA2D;IAC3D,cADU,MAAM,CACH;IAmEZ,+BAA8C;IA2C/C;;;;OAIG;IACH,2BAHW,MAAM,GACJ,OAAO,eAAe,EAAE,OAAO,GAAG,SAAS,CAMvD;IA8BD;;;;OAIG;IACH,4BAHW,OAAO,oBAAoB,EAAE,WAAW,GACtC,OAAO,0BAA0B,EAAE,QAAQ,GAAG,SAAS,CAiBnE;IAED;;;;;;;OAOG;IACH,4CAJG;QAA0D,MAAM,EAAxD,OAAO,oBAAoB,EAAE,WAAW;QACoB,kBAAkB;KACtF,GAAU,MAAM,GAAC,IAAI,CAWvB;IAED;;;;;;;;OAQG;IACH,4BALW,OAAO,SAAS,EAAE,QAAQ,UAC1B,OAAO,oBAAoB,EAAE,WAAW,kFAEtC,IAAI,CAKhB;IAED;;;;;;;;OAQG;IACH,2BANW,OAAO,oBAAoB,EAAE,WAAW,oCAEhD;QAA0B,OAAO;QACmC,kBAAkB;KACtF,GAAU,MAAM,GAAC,IAAI,CAyEvB;IAED;;;;;OAKG;IACH,wBAAyB,gBAJd,MAI4B,EAAE,iBAH9B,MAG6C,KAF3C,MAAM,CAqBjB;IAEF;;;;OAIG;IACH,sCAAuC,iBAH5B,MAG2C,KAFzC,MAAM,CAIjB;IAEF;;;;;;OAMG;IACH,0BAA2B,gBALhB,MAK8B,EAAE,iBAJhC,MAI+C,EAAE,UAHjD,MAGyD,KAFvD,MAAM,CAuBjB;IAEF;;;OAGG;IACH,cAFa,OAAO,CAInB;IAED;;OAEG;IACH,6BAFW,OAAO,uBAAuB,EAAE,eAAe,QAKzD;;CACD"}
@@ -1,13 +1,13 @@
1
1
  /** @typedef {import('./question-props').QuestionProps} QuestionProps */
2
2
  /**
3
3
  * @param {{[questionName: string]: QuestionProps}} questionPropsRecord
4
- * @param {Record<string, typeof import('./question').Question>} questionClasses
4
+ * @param {Record<string, import('./question-types.js').QuestionClass>} questionClasses
5
5
  * @param {{[questionType: string]: Record<string, Function>}} questionMethodOverrides
6
6
  * @param {{notStartedText?: string, continueButtonText?: string, changeActionText?: string, answerActionText?: string}} [textOverrides] - customise question text
7
7
  */
8
8
  export function createQuestions(questionPropsRecord: {
9
9
  [questionName: string]: QuestionProps;
10
- }, questionClasses: Record<string, typeof import("./question").Question>, questionMethodOverrides: {
10
+ }, questionClasses: Record<string, import("./question-types.js").QuestionClass>, questionMethodOverrides: {
11
11
  [questionType: string]: Record<string, Function>;
12
12
  }, textOverrides?: {
13
13
  notStartedText?: string;
@@ -15,7 +15,7 @@ export function createQuestions(questionPropsRecord: {
15
15
  changeActionText?: string;
16
16
  answerActionText?: string;
17
17
  }): {
18
- [k: string]: any;
18
+ [k: string]: Question;
19
19
  };
20
20
  export type QuestionProps = any;
21
21
  //# sourceMappingURL=create-questions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-questions.d.ts","sourceRoot":"","sources":["../../../src/questions/create-questions.js"],"names":[],"mappings":"AAAA,wEAAwE;AAExE;;;;;GAKG;AACH,qDALW;IAAC,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAAA;CAAC,mBACvC,MAAM,CAAC,MAAM,EAAE,cAAc,YAAY,EAAE,QAAQ,CAAC,2BACpD;IAAC,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,WAAW,CAAA;CAAC,kBAClD;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAC;;EAwBtH"}
1
+ {"version":3,"file":"create-questions.d.ts","sourceRoot":"","sources":["../../../src/questions/create-questions.js"],"names":[],"mappings":"AAAA,wEAAwE;AAExE;;;;;GAKG;AACH,qDALW;IAAC,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAAA;CAAC,mBACvC,MAAM,CAAC,MAAM,EAAE,OAAO,qBAAqB,EAAE,aAAa,CAAC,2BAC3D;IAAC,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,WAAW,CAAA;CAAC,kBAClD;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAC;;EAwBtH"}
@@ -24,12 +24,14 @@
24
24
  /**
25
25
  * @typedef {import('./question').QuestionViewModel & { question: { options: Option[] } }} OptionsViewModel
26
26
  */
27
- export default class OptionsQuestion extends Question {
27
+ /**
28
+ * @typedef {import('#question-types').QuestionParameters & { options: Array<Option> }} OptionsQuestionParameters
29
+ */
30
+ export class OptionsQuestion extends Question {
28
31
  /**
29
- * @param {import('#question-types').QuestionParameters} params
30
- * @param {Array<Option>} params.options
32
+ * @param {OptionsQuestionParameters} params
31
33
  */
32
- constructor(params: import("#question-types").QuestionParameters);
34
+ constructor(params: OptionsQuestionParameters);
33
35
  /** @type {Array<Option>} */
34
36
  options: Array<Option>;
35
37
  optionJoinString: string;
@@ -44,6 +46,7 @@ export default class OptionsQuestion extends Question {
44
46
  */
45
47
  prepQuestionForRendering(section: import("#section").Section, journey: import("#journey").Journey, customViewData?: Record<string, unknown>, payload?: Record<string, unknown>, options: import("#question-types").PrepQuestionForRenderingOptions): any;
46
48
  }
49
+ export default OptionsQuestion;
47
50
  export type Option = {
48
51
  text: string;
49
52
  value: string;
@@ -70,5 +73,8 @@ export type OptionsViewModel = any & {
70
73
  options: Option[];
71
74
  };
72
75
  };
76
+ export type OptionsQuestionParameters = import("#question-types").QuestionParameters & {
77
+ options: Array<Option>;
78
+ };
73
79
  import { Question } from './question.js';
74
80
  //# sourceMappingURL=options-question.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"options-question.d.ts","sourceRoot":"","sources":["../../../src/questions/options-question.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;GAEG;AAEH;IAIC;;;OAGG;IACH,oBAHW,OAAO,iBAAiB,EAAE,kBAAkB,EAgBtD;IApBD,4BAA4B;IAC5B,SADW,KAAK,CAAC,MAAM,CAAC,CAChB;IAkBP,yBAA+C;IAGhD;;;;;;;;OAQG;IACH,kCAPW,OAAO,UAAU,EAAE,OAAO,WAC1B,OAAO,UAAU,EAAE,OAAO,mBAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,WACvB,OAAO,iBAAiB,EAAE,+BAA+B,OAmDnE;CAmCD;qBA9IY;IACR,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,WAAW,CAAC,EAAE;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,OAAO,CAAC;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;KAClB,CAAC;IACA,eAAe,CAAC,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;KAChB,CAAA;CACH;+BAIU,GAAsC,GAAG;IAAE,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;CAAE;yBAhChE,eAAe"}
1
+ {"version":3,"file":"options-question.d.ts","sourceRoot":"","sources":["../../../src/questions/options-question.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;GAEG;AACH;;GAEG;AAEH;IAIC;;OAEG;IACH,oBAFW,yBAAyB,EAenC;IAnBD,4BAA4B;IAC5B,SADW,KAAK,CAAC,MAAM,CAAC,CAChB;IAiBP,yBAA+C;IAGhD;;;;;;;;OAQG;IACH,kCAPW,OAAO,UAAU,EAAE,OAAO,WAC1B,OAAO,UAAU,EAAE,OAAO,mBAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,WACvB,OAAO,iBAAiB,EAAE,+BAA+B,OAmDnE;CAmCD;;qBAhJY;IACR,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,WAAW,CAAC,EAAE;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,OAAO,CAAC;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;KAClB,CAAC;IACA,eAAe,CAAC,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;KAChB,CAAA;CACH;+BAIU,GAAsC,GAAG;IAAE,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;CAAE;wCAG5E,OAAO,iBAAiB,EAAE,kBAAkB,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE;yBAnC7D,eAAe"}
@@ -78,3 +78,9 @@ export interface PrepQuestionForRenderingOptions {
78
78
  params: RouteParams;
79
79
  manageListQuestion?: ManageListQuestion;
80
80
  }
81
+
82
+ /**
83
+ * Define a question class type so that projects downstream can extend the
84
+ * Question class and still pass them to the createQuestions function.
85
+ */
86
+ export type QuestionClass<TQuestion extends Question = Question> = new (...args: never[]) => TQuestion;
@@ -1,8 +1,5 @@
1
1
  /**
2
2
  * @import {BaseValidator} from "#base-validator"
3
- * @import {Journey} from "#journey"
4
- * @import {JourneyResponse} from "#journey-response"
5
- * @import {Section} from "#section"
6
3
  * @import {ActionView} from "../controller.js"
7
4
  * @import {ActionLink} from "./question-types.js"
8
5
  */
@@ -76,7 +73,7 @@ export class Question {
76
73
  /** @type {string} text to display for 'add' link */
77
74
  addActionText: string;
78
75
  /**
79
- * @param {JourneyResponse} [response]
76
+ * @param {import('../journey/journey-response.js').JourneyResponse} [response]
80
77
  * @returns {boolean}
81
78
  */
82
79
  shouldDisplay: () => boolean;
@@ -121,33 +118,33 @@ export class Question {
121
118
  * that prepQuestionForRendering doesn't need
122
119
  *
123
120
  * @param {Object} options
124
- * @param {import('#src/journey/journey-types.d.ts').RouteParams} options.params
125
- * @param {import('#src/components/manage-list/question.js')} [options.manageListQuestion]
126
- * @param {Section} options.section - the current section
127
- * @param {Journey} options.journey - the journey we are in
121
+ * @param {import('../journey/journey-types.js').RouteParams} options.params
122
+ * @param {import('../components/manage-list/question.js')} [options.manageListQuestion]
123
+ * @param {import('../section.js').Section} options.section - the current section
124
+ * @param {import('../journey/journey.js').Journey} options.journey - the journey we are in
128
125
  * @param {Record<string, unknown>} [options.customViewData] additional data to send to view
129
126
  * @param {unknown} [options.payload]
130
127
  * @returns {QuestionViewModel}
131
128
  */
132
129
  toViewModel({ params, manageListQuestion, section, journey, customViewData, payload }: {
133
- params: import("#src/journey/journey-types.d.ts").RouteParams;
134
- manageListQuestion?: typeof import("#src/components/manage-list/question.js") | undefined;
135
- section: Section;
136
- journey: Journey;
130
+ params: import("../journey/journey-types.js").RouteParams;
131
+ manageListQuestion?: typeof import("../components/manage-list/question.js") | undefined;
132
+ section: import("../section.js").Section;
133
+ journey: import("../journey/journey.js").Journey;
137
134
  customViewData?: Record<string, unknown> | undefined;
138
135
  payload?: unknown;
139
136
  }): QuestionViewModel;
140
137
  /**
141
138
  * gets the base view model for this question
142
139
  *
143
- * @param {Section} section - the current section
144
- * @param {Journey} journey - the journey we are in
140
+ * @param {import('../section.js').Section} section - the current section
141
+ * @param {import('../journey/journey.js').Journey} journey - the journey we are in
145
142
  * @param {Record<string, unknown>} [customViewData] additional data to send to view
146
143
  * @param {unknown} [payload]
147
144
  * @param {import('#question-types').PrepQuestionForRenderingOptions} [options] - required to support manage list question
148
145
  * @returns {QuestionViewModel}
149
146
  */
150
- prepQuestionForRendering(section: Section, journey: Journey, customViewData?: Record<string, unknown>, payload?: unknown, options?: import("#question-types").PrepQuestionForRenderingOptions): QuestionViewModel;
147
+ prepQuestionForRendering(section: import("../section.js").Section, journey: import("../journey/journey.js").Journey, customViewData?: Record<string, unknown>, payload?: unknown, options?: import("#question-types").PrepQuestionForRenderingOptions): QuestionViewModel;
151
148
  /**
152
149
  * The answer to this question for use in the viewModel
153
150
  *
@@ -167,11 +164,11 @@ export class Question {
167
164
  /**
168
165
  * Get the answers object from the journey response, which may be nested in an array for manage list questions
169
166
  *
170
- * @param {JourneyResponse} response
167
+ * @param {import('../journey/journey-response.js').JourneyResponse} response
171
168
  * @param {import('#question-types').PrepQuestionForRenderingOptions} [options]
172
169
  * @returns {Record<string, any>}
173
170
  */
174
- answerObjectFromJourneyResponse(response: JourneyResponse, { params, manageListQuestion }?: import("#question-types").PrepQuestionForRenderingOptions): Record<string, any>;
171
+ answerObjectFromJourneyResponse(response: import("../journey/journey-response.js").JourneyResponse, { params, manageListQuestion }?: import("#question-types").PrepQuestionForRenderingOptions): Record<string, any>;
175
172
  /**
176
173
  * renders the question
177
174
  * @param {import('express').Response} res - the express response
@@ -182,43 +179,43 @@ export class Question {
182
179
  /**
183
180
  * check for validation errors
184
181
  * @param {import('express').Request} req
185
- * @param {Journey} journey
186
- * @param {Section} section
187
- * @param {import('#src/components/manage-list/question.js')} [manageListQuestion]
182
+ * @param {import('../journey/journey.js').Journey} journey
183
+ * @param {import('../section.js').Section} section
184
+ * @param {import('../components/manage-list/question.js')} [manageListQuestion]
188
185
  * @returns {QuestionViewModel|undefined} returns the view model for displaying the error or undefined if there are no errors
189
186
  */
190
- checkForValidationErrors(req: import("express").Request, section: Section, journey: Journey, manageListQuestion?: typeof import("#src/components/manage-list/question.js")): QuestionViewModel | undefined;
187
+ checkForValidationErrors(req: import("express").Request, section: import("../section.js").Section, journey: import("../journey/journey.js").Journey, manageListQuestion?: typeof import("../components/manage-list/question.js")): QuestionViewModel | undefined;
191
188
  /**
192
189
  * Get the data to save from the request, returns an object of answers
193
190
  *
194
191
  * @param {import('express').Request} req
195
- * @param {JourneyResponse} journeyResponse - current journey response
192
+ * @param {import('../journey/journey-response.js').JourneyResponse} journeyResponse - current journey response
196
193
  * @returns {Promise<{ answers: Record<string, unknown> }>}
197
- */ getDataToSave(req: import("express").Request, journeyResponse: JourneyResponse): Promise<{
194
+ */ getDataToSave(req: import("express").Request, journeyResponse: import("../journey/journey-response.js").JourneyResponse): Promise<{
198
195
  answers: Record<string, unknown>;
199
196
  }>;
200
197
  /**
201
198
  * check for errors after saving, by default this does nothing
202
199
  * @param {import('express').Request} req
203
- * @param {Journey} journey
204
- * @param {Section} sectionObj
200
+ * @param {import('../journey/journey.js').Journey} journey
201
+ * @param {import('../section.js').Section} sectionObj
205
202
  * @returns {QuestionViewModel | undefined} returns the view model for displaying the error or undefined if there are no errors
206
- */ checkForSavingErrors(req: import("express").Request, sectionObj: Section, journey: Journey): QuestionViewModel | undefined;
203
+ */ checkForSavingErrors(req: import("express").Request, sectionObj: import("../section.js").Section, journey: import("../journey/journey.js").Journey): QuestionViewModel | undefined;
207
204
  /**
208
205
  * Handles redirect after saving. Kept around for backwards compatibility.
209
206
  *
210
207
  * @param {import('express').Response} res
211
- * @param {Journey} journey
208
+ * @param {import('../journey/journey.js').Journey} journey
212
209
  * @param {string} sectionSegment
213
210
  * @param {string} questionSegment
214
211
  * @returns {void}
215
212
  * @deprecated - use `journey.redirectToNextQuestion`
216
213
  */
217
- handleNextQuestion(res: import("express").Response, journey: Journey, sectionSegment: string, questionSegment: string): void;
214
+ handleNextQuestion(res: import("express").Response, journey: import("../journey/journey.js").Journey, sectionSegment: string, questionSegment: string): void;
218
215
  /**
219
216
  * returns the formatted answers values to be used to build task list elements
220
217
  * @param {String} sectionSegment
221
- * @param {Journey} journey
218
+ * @param {import('../journey/journey.js').Journey} journey
222
219
  * @param {Object} answer
223
220
  * @returns {Array<{
224
221
  * key: string;
@@ -226,7 +223,7 @@ export class Question {
226
223
  * action?: ActionView | ActionView[];
227
224
  * }>}
228
225
  */
229
- formatAnswerForSummary(sectionSegment: string, journey: Journey, answer: Object, capitals?: boolean): Array<{
226
+ formatAnswerForSummary(sectionSegment: string, journey: import("../journey/journey.js").Journey, answer: Object, capitals?: boolean): Array<{
230
227
  key: string;
231
228
  value: string | Object;
232
229
  action?: ActionView | ActionView[];
@@ -234,11 +231,11 @@ export class Question {
234
231
  /**
235
232
  * Returns the action link for the question
236
233
  * @param {Object} answer
237
- * @param {Journey} journey
234
+ * @param {import('../journey/journey.js').Journey} journey
238
235
  * @param {String} sectionSegment
239
236
  * @returns {ActionView|ActionView[]|undefined}
240
237
  */
241
- getAction(sectionSegment: string, journey: Journey, answer: Object): ActionView | ActionView[] | undefined;
238
+ getAction(sectionSegment: string, journey: import("../journey/journey.js").Journey, answer: Object): ActionView | ActionView[] | undefined;
242
239
  /**
243
240
  * @param {unknown} answer
244
241
  * @returns {unknown}
@@ -254,11 +251,11 @@ export class Question {
254
251
  */
255
252
  fieldIsRequired(inputField: string): boolean;
256
253
  /**
257
- * @param {JourneyResponse} journeyResponse
254
+ * @param {import('../journey/journey-response.js').JourneyResponse} journeyResponse
258
255
  * @param {string} [fieldName] optional fieldname for multi field input questions
259
256
  * @returns {boolean}
260
257
  */
261
- isAnswered(journeyResponse: JourneyResponse, fieldName?: string): boolean;
258
+ isAnswered(journeyResponse: import("../journey/journey-response.js").JourneyResponse, fieldName?: string): boolean;
262
259
  }
263
260
  export type PreppedQuestion = {
264
261
  value: Object;
@@ -271,8 +268,5 @@ export type PreppedQuestion = {
271
268
  export type QuestionViewModel = Record<string, any>;
272
269
  import type { BaseValidator } from "#base-validator";
273
270
  import type { ActionLink } from "./question-types.js";
274
- import type { Section } from "#section";
275
- import type { Journey } from "#journey";
276
- import type { JourneyResponse } from "#journey-response";
277
271
  import type { ActionView } from "../controller.js";
278
272
  //# sourceMappingURL=question.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../src/questions/question.js"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AAEH;;;;;;;;GAQG;AAEH;;;;;;;;;;;GAWG;AAEH;;;GAGG;AACH;IA4DC;;;OAGG;IACH,yLAHW,OAAO,iBAAiB,EAAE,kBAAkB,oBAC5C,MAAM,CAAC,MAAM,WAAW,EAsDlC;IAnHD,6EAA6E;IAC7E,WADW,MAAM,CACP;IACV,sDAAsD;IACtD,OADW,MAAM,CACX;IACN,+DAA+D;IAC/D,UADW,MAAM,CACR;IACT,mFAAmF;IACnF,aADW,MAAM,GAAC,SAAS,CACf;IACZ,iDAAiD;IACjD,YADW,MAAM,CACN;IACX,qHAAqH;IACrH,WADW,MAAM,CACP;IACV,6FAA6F;IAC7F,UADW,OAAO,CACF;IAChB,iGAAiG;IACjG,YADW,KAAK,CAAE,aAAa,CAAC,CAChB;IAChB,2DAA2D;IAC3D,MADW,MAAM,GAAC,SAAS,CACtB;IACL,sEAAsE;IACtE,oBADW,OAAO,CACQ;IAC1B,oDAAoD;IACpD,KADW,MAAM,GAAC,SAAS,CACvB;IACJ,qDAAqD;IACrD,MADW,MAAM,GAAC,SAAS,CACtB;IACL,sDAAsD;IACtD,eADW,MAAM,GAAC,SAAS,CACb;IACd,wDAAwD;IACxD,YADW,UAAU,GAAC,SAAS,CACpB;IAEX,iFAAiF;IACjF,gBADW,MAAM,CACc;IAC/B,4CAA4C;IAC5C,oBADW,MAAM,CACe;IAChC,uDAAuD;IACvD,kBADW,MAAM,CACW;IAC5B,uDAAuD;IACvD,kBADW,MAAM,CACW;IAC5B,oDAAoD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EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAczD;IAED;;;;;;OAMG,CACH,0BALW,OAAO,SAAS,EAAE,OAAO,cAEzB,OAAO,WADP,OAAO,GAEL,iBAAiB,GAAG,SAAS,CAIzC;IAED;;;;;;;;;OASG;IACH,wBAPW,OAAO,SAAS,EAAE,QAAQ,WAC1B,OAAO,kBACP,MAAM,mBACN,MAAM,GACJ,IAAI,CAQhB;IAED;;;;;;;;;;OAUG;IACH,wDARW,OAAO,UACP,MAAM,uBACJ,KAAK,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,CAAC;KACpC,CAAC,CAaJ;IAED;;;;;;OAMG;IACH,2CAJW,OAAO,UADP,MAAM,GAGJ,UAAU,GAAC,UAAU,EAAE,GAAC,SAAS,CAqB7C;IAED;;;OAGG;IACH,eAHW,OAAO,GACL,OAAO,CAInB;IAED;;OAEG;IACH,cAFa,OAAO,CASnB;IACD;;;OAGG;IACH,4BAHW,MAAM,GACJ,OAAO,CAMnB;IAED;;;;OAIG;IACH,4BAJW,eAAe,cACf,MAAM,GACJ,OAAO,CAInB;CACD;;WAlda,MAAM;cACN,MAAM;eACN,MAAM;eACN,MAAM;;;;gCAMP,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;mCAnBA,iBAAiB;gCAKpB,qBAAqB;6BAFxB,UAAU;6BAFV,UAAU;qCACF,mBAAmB;gCAExB,kBAAkB"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../src/questions/question.js"],"names":[],"mappings":"AAOA;;;;GAIG;AAEH;;;;;;;;GAQG;AAEH;;;;;;;;;;;GAWG;AAEH;;;GAGG;AACH;IA4DC;;;OAGG;IACH,yLAHW,OAAO,iBAAiB,EAAE,kBAAkB,oBAC5C,MAAM,CAAC,MAAM,WAAW,EAsDlC;IAnHD,6EAA6E;IAC7E,WAD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hB;IAED;;;;;;;;;;OAUG;IACH,wDARW,OAAO,uBAAuB,EAAE,OAAO,UACvC,MAAM,uBACJ,KAAK,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,CAAC;KACpC,CAAC,CAaJ;IAED;;;;;;OAMG;IACH,2CAJW,OAAO,uBAAuB,EAAE,OAAO,UADvC,MAAM,GAGJ,UAAU,GAAC,UAAU,EAAE,GAAC,SAAS,CAqB7C;IAED;;;OAGG;IACH,eAHW,OAAO,GACL,OAAO,CAInB;IAED;;OAEG;IACH,cAFa,OAAO,CASnB;IACD;;;OAGG;IACH,4BAHW,MAAM,GACJ,OAAO,CAMnB;IAED;;;;OAIG;IACH,4BAJW,OAAO,gCAAgC,EAAE,eAAe,cACxD,MAAM,GACJ,OAAO,CAInB;CACD;;WAlda,MAAM;cACN,MAAM;eACN,MAAM;eACN,MAAM;;;;gCAMP,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;mCAhBA,iBAAiB;gCAEpB,qBAAqB;gCADrB,kBAAkB"}
@@ -1,6 +1,3 @@
1
- /**
2
- * @typedef {import('../questions/options-question.js')} OptionsQuestion
3
- */
4
1
  /**
5
2
  * enforces a field is within the question's predefined list of options
6
3
  * @class
@@ -13,11 +10,10 @@ export class ValidOptionValidator extends BaseValidator {
13
10
  constructor(errorMessage?: string);
14
11
  /**
15
12
  * validates the response body, checking the value sent for the questionObj's fieldname is within the predefined list of options
16
- * @param {OptionsQuestion} questionObj
13
+ * @param {import('../questions/options-question.js').default} questionObj
17
14
  */
18
- validate(questionObj: OptionsQuestion): import("express-validator").ValidationChain;
15
+ validate(questionObj: import("../questions/options-question.js").default): import("express-validator").ValidationChain;
19
16
  }
20
17
  export default ValidOptionValidator;
21
- export type OptionsQuestion = typeof import("../questions/options-question.js");
22
18
  import BaseValidator from './base-validator.js';
23
19
  //# sourceMappingURL=valid-option-validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"valid-option-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/valid-option-validator.js"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;GAGG;AACH;IACC;;;OAGG;IACH,2BAFW,MAAM,EAUhB;IAED;;;OAGG;IACH,sBAFW,eAAe,+CAUzB;CACD;;;0BAvCyB,qBAAqB"}
1
+ {"version":3,"file":"valid-option-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/valid-option-validator.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH;IACC;;;OAGG;IACH,2BAFW,MAAM,EAUhB;IAED;;;OAGG;IACH,sBAFW,OAAO,kCAAkC,EAAE,OAAO,+CAU5D;CACD;;0BAnCyB,qBAAqB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/address/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/boolean/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/checkbox/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/date/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/date-period/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/date-time/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/email/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/identifier/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=manage-list-section.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manage-list-section.test.d.ts","sourceRoot":"","sources":["../../../../src/components/manage-list/manage-list-section.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/manage-list/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=utils.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../../../src/components/manage-list/utils.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/multi-field-input/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/radio/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/select/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/single-line-input/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/text-entry/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/text-entry-redact/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question.test.d.ts","sourceRoot":"","sources":["../../../../src/components/unit-option-entry/question.test.js"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=question-has-answer.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question-has-answer.test.d.ts","sourceRoot":"","sources":["../../../../src/components/utils/question-has-answer.test.js"],"names":[],"mappings":""}