Skip to content

Commit

Permalink
Use ConstructorParameters to get the type of the components config
Browse files Browse the repository at this point in the history
  • Loading branch information
romaricpascal committed Nov 12, 2024
1 parent fef3a86 commit 3c4cb8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/govuk-frontend/src/govuk/init.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export { initAll, createAll }
**/

/**
* @typedef {{new (...args: any[]): any, defaults?: object, moduleName: string}} CompatibleClass
* @typedef {{new (...args: any[]): any, moduleName: string}} CompatibleClass
*/

/* eslint-enable jsdoc/valid-types */
Expand Down Expand Up @@ -203,7 +203,7 @@ export { initAll, createAll }

/**
* @template {CompatibleClass} ComponentClass
* @typedef {ComponentClass["defaults"]} ComponentConfig
* @typedef {ConstructorParameters<ComponentClass>[1]} ComponentConfig
*/

/**
Expand Down

0 comments on commit 3c4cb8c

Please sign in to comment.