UNPKG

@funidata/ngx-fudis

Version:

Funidata Design System.

43 lines (42 loc) 1.51 kB
import { FudisIdService } from '../id/id.service'; import { FudisAlert, FudisAlertElement } from '../../types/miscellaneous'; import { BehaviorSubject } from 'rxjs'; import * as i0 from "@angular/core"; export declare class FudisAlertService { private _idService; constructor(_idService: FudisIdService); /** * Current alerts */ private _alerts; /** * To add new alert, which will be rendered by Alert Group component. Note that 'id' doesn't * necessarily need to be unique. All errors with the same 'id' can be dismissed with * dismissAlert() using that particular 'id'. */ addAlert(newAlert: FudisAlert): void; /** * To dismiss alert by 'id' provided in 'addAlert()'. It will dismiss all alerts matching the * 'id'. */ dismissAlert(id: string): void; /** * Dismisses only one alert from alert's close button click in the UI */ dismissAlertFromButton(id: string): void; /** * Dismiss all alerts */ dismissAll(): void; /** * Get alerts as an Observable */ get alerts(): BehaviorSubject<FudisAlertElement[]>; /** * Set 'initialFocus' attribute of alert to false, so that if same alert with link is rendered * again, the initial focus will not jump there anymore. */ updateAlertLinkFocusState(htmlId: string): void; static ɵfac: i0.ɵɵFactoryDeclaration<FudisAlertService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<FudisAlertService>; }