import { Alert } from './alert.model';
import { BehaviorSubject } from 'rxjs';
import { StateService } from '../common/state-service.abstract';
import * as i0 from "@angular/core";
export type AlertType = 'success' | 'warning' | 'danger' | 'info' | 'system';
/**
 * A service which allows to display alerts.
 */
export declare class AlertService extends StateService {
    /**
     * Returns all alerts.
     * @readonly
     */
    get state(): Alert[];
    /**
     * @ignore
     */
    state$: BehaviorSubject<Alert[]>;
    private MAX_ALERTS;
    private ALERT_TIMEOUT;
    /**
     * Adds a new alert to the current state.
     */
    add(alert: Alert): void;
    /**
     * Adds a alert by text.
     */
    addByText(type: AlertType, txt: string, detailedData?: string): void;
    /**
     * Returns all alerts.
     * @deprecated Use alertService.alerts instead.
     */
    list(): Alert[];
    /**
     * Remove an alert from the current state.
     */
    remove(alert: Alert): void;
    /**
     * Updates matching alert with provided values.
     */
    update(alert: Alert, fieldsToUpdate: Partial<Alert>): void;
    /**
     * Removes last danger alert.
     * It can be used e.g. in the case of a failed request which triggered an alert, to hide it from user.
     *
     * ```js
     *  try {
     *    // something that might throw a danger server msg
     *  } catch (ex) {
     *   this.alertService.removeLastDanger();
     *  }
     * ```
     */
    removeLastDanger(): void;
    /**
     * Shorthand for a save successful alert.
     * @param savedObject The object which was saved.
     * @return A function that can be executed to show the msg.
     */
    saveSuccess(savedObject: string): () => void;
    /**
     * Shorthand for a create successful alert.
     * @param createdObject The object which was created.
     * @return A function that can be executed to show the msg.
     */
    createSuccess(createdObject: any): () => void;
    /**
     * Clears all alerts.
     */
    clearAll(): void;
    /**
     * A shorthand to display a simple success message.
     * @param text The success text.
     * @param detailedData The text with additional information.
     */
    success(text: string, detailedData?: string): void;
    /**
     * A shorthand to display a simple danger message.
     * @param text The danger text.
     * @param detailedData The text with additional information.
     */
    danger(text: string, detailedData?: string): void;
    /**
     * A shorthand to display a simple info message.
     * @param text The info text.
     * @param detailedData The text with additional information.
     */
    info(text: string, detailedData?: string): void;
    /**
     * A shorthand to display a simple warning message.
     * @param text The warning text.
     * @param detailedData The text with additional information.
     */
    warning(text: string, detailedData?: string): void;
    /**
     * A shorthand to display a simple system message.
     * @param text The system message text.
     * @param detailedData The text with additional information.
     */
    system(text: string, detailedData?: string): void;
    /**
     * Creates alert from standard api errors.
     * Should be used for errors generated by @c8y/client services.
     * @param {IResult}  error The error from server.
     * @param {alertType} type The type of alert.
     */
    addServerFailure(error: any, type?: AlertType): void;
    /**
     * Compares two alert objects. Alerts are same if text, type, detailed data and callbacks are same.
     * Callbacks are same if they refer to the same function.
     */
    areSame(alert1: Alert, alert2: Alert): boolean;
    private changeAlerts;
    private addAlert;
    private hideAutomaticallyIfNeeded;
    private removeOldestIfMax;
    static ɵfac: i0.ɵɵFactoryDeclaration<AlertService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AlertService>;
}
//# sourceMappingURL=alert.service.d.ts.map