Skip to content

Commit

Permalink
118220: Add additional TypeDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
AAwouters committed Sep 27, 2024
1 parent c1fa52e commit 751d689
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/app/shared/live-region/live-region.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import { Component, OnInit } from '@angular/core';
import { LiveRegionService } from './live-region.service';
import { Observable } from 'rxjs';

/**
* The Live Region Component is an accessibility tool for screenreaders. When a change occurs on a page when the changed
* section is not in focus, a message should be displayed by this component so it can be announced by a screen reader.
*
* This component should not be used directly. Use the {@link LiveRegionService} to add messages.
*/
@Component({
selector: `ds-live-region`,
templateUrl: './live-region.component.html',
Expand Down
5 changes: 4 additions & 1 deletion src/app/shared/live-region/live-region.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { BehaviorSubject } from 'rxjs';
import { environment } from '../../../environments/environment';
import { UUIDService } from '../../core/shared/uuid.service';

/**
* The LiveRegionService is responsible for handling the messages that are shown by the {@link LiveRegionComponent}.
* Use this service to add or remove messages to the Live Region.
*/
@Injectable({
providedIn: 'root',
})
Expand Down Expand Up @@ -76,7 +80,6 @@ export class LiveRegionService {
/**
* Removes the message with the given UUID from the messages array
* @param uuid The uuid of the message to clear
* @protected
*/
clearMessageByUUID(uuid: string) {
const index = this.messages.findIndex(messageObj => messageObj.uuid === uuid);
Expand Down

0 comments on commit 751d689

Please sign in to comment.