Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update component data JSDoc for ES modules
Browse files Browse the repository at this point in the history
We now store component params as key/value objects just as we do for Nunjucks options, this improves access to values by param name
colinrotherham committed Oct 31, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent e7737ab commit 921c67c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions shared/lib/components.js
Original file line number Diff line number Diff line change
@@ -276,7 +276,7 @@ module.exports = {
* Component data
*
* @typedef {object} ComponentData
* @property {ComponentOption[]} [params] - Nunjucks macro option (or param) configs
* @property {{ [param: string]: ComponentOption }} params - Nunjucks macro option (or param) configs
* @property {ComponentExample[]} [examples] - Component examples with Nunjucks macro options (or params)
* @property {string} [previewLayout] - Nunjucks layout for component preview
* @property {string} [accessibilityCriteria] - Accessibility criteria
@@ -286,12 +286,11 @@ module.exports = {
* Nunjucks macro option (or param) config
*
* @typedef {object} ComponentOption
* @property {string} name - Option name
* @property {'array' | 'boolean' | 'integer' | 'nunjucks-block' | 'object' | 'string'} type - Option type
* @property {boolean} required - Option required
* @property {string} description - Option description
* @property {boolean} [isComponent] - Option is another component
* @property {ComponentOption[]} [params] - Nunjucks macro option (or param) configs
* @property {{ [param: string]: ComponentOption }} [params] - Nunjucks macro option (or param) configs
*/

/**

0 comments on commit 921c67c

Please sign in to comment.