Skip to content

Commit

Permalink
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
  • Loading branch information
colinrotherham committed Feb 27, 2024
1 parent 56eb09f commit d11114f
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
Expand Up @@ -295,7 +295,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
Expand All @@ -305,12 +305,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
*/

/**
Expand Down

0 comments on commit d11114f

Please sign in to comment.