Skip to content

Commit

Permalink
Add JSDoc tag @preserve to component classes
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Aug 8, 2023
1 parent 389472b commit 7f668a5
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/contributing/coding-standards/js.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ component
```mjs
/**
* Component name
*
* @preserve
*/
export class Example {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { I18n } from '../../i18n.mjs'
*
* The state of each section is saved to the DOM via the `aria-expanded`
* attribute, which also provides accessibility.
*
* @preserve
*/
export class Accordion {
/** @private */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const DEBOUNCE_TIMEOUT_IN_SECONDS = 1

/**
* JavaScript enhancements for the Button component
*
* @preserve
*/
export class Button {
/** @private */
Expand All @@ -24,7 +26,6 @@ export class Button {
debounceFormSubmitTimer = null

/**
*
* @param {Element} $module - HTML element to use for button
* @param {ButtonConfig} [config] - Button config
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { I18n } from '../../i18n.mjs'
*
* You can configure the message to only appear after a certain percentage
* of the available characters/words has been entered.
*
* @preserve
*/
export class CharacterCount {
/** @private */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**
* Checkboxes component
*
* @preserve
*/
export class Checkboxes {
/** @private */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { normaliseDataset } from '../../common/normalise-dataset.mjs'
* Error summary component
*
* Takes focus on initialisation for accessible announcement, unless disabled in configuration.
*
* @preserve
*/
export class ErrorSummary {
/** @private */
Expand All @@ -17,7 +19,6 @@ export class ErrorSummary {
config

/**
*
* @param {Element} $module - HTML element to use for error summary
* @param {ErrorSummaryConfig} [config] - Error summary config
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { I18n } from '../../i18n.mjs'

/**
* Exit This Page component
*
* @preserve
*/
export class ExitThisPage {
/** @private */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**
* Header component
*
* @preserve
*/
export class Header {
/** @private */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { normaliseDataset } from '../../common/normalise-dataset.mjs'

/**
* Notification Banner component
*
* @preserve
*/
export class NotificationBanner {
/** @private */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**
* Radios component
*
* @preserve
*/
export class Radios {
/** @private */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**
* Skip link component
*
* @preserve
*/
export class SkipLink {
/** @private */
Expand All @@ -15,7 +17,6 @@ export class SkipLink {
linkedElementListener = false

/**
*
* @param {Element} $module - HTML element to use for skip link
*/
constructor($module) {
Expand Down
2 changes: 2 additions & 0 deletions packages/govuk-frontend/src/govuk/components/tabs/tabs.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**
* Tabs component
*
* @preserve
*/
export class Tabs {
/** @private */
Expand Down

0 comments on commit 7f668a5

Please sign in to comment.