UNPKG

@adaptabletools/adaptable

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

131 lines (130 loc) 5.3 kB
import { AlertDefinition, AlertState } from '../AdaptableState/AlertState'; import { AdaptableAlert } from '../AdaptableState/Common/AdaptableAlert'; import { AdaptableMessageType, AlertProperties } from '../types'; import { AdaptableObjectLookupCriteria } from '../AdaptableState/Common/AdaptableObject'; /** * Provides run-time access to Alert function and associated State */ export interface AlertApi { /** * Retrieves Alert section from Adaptable State * @returns alert state */ getAlertState(): AlertState; /** * Opens Settings Panel with Alert section selected and visible */ openAlertSettingsPanel(): void; /** * Retrieves all Alert Definitions in Alert State * @returns alert definitions */ getAlertDefinitions(config?: { includeLayoutNotAssociatedObjects?: boolean; }): AlertDefinition[]; /** * Retrieves all Alert Definitions which are currently suspended */ getSuspendedAlertDefinitions(config?: { includeLayoutNotAssociatedObjects?: boolean; }): AlertDefinition[]; /** * Retrieves all Alert Definitions which are currently active */ getActiveAlertDefinitions(config?: { includeLayoutNotAssociatedObjects?: boolean; }): AlertDefinition[]; /** * Retrieves alert definition by the technical ID (from `AlertState`) * @param id alert definition id * @returns alert definition */ getAlertDefinitionById(id: AlertDefinition['Uuid']): AlertDefinition; /** * Adds given Alert Definition to Adaptable State * @param alertDefinition AlertDefinition to add * @returns alert definition */ addAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition; /** * Updates given Alert Definition in Adaptable State * @param alertDefinition Alert to Edit * @returns alert definition */ editAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition; /** * Deletes given Alert Definition from Adaptable State * @param alertDefinition */ deleteAlertDefinition(alertDefinition: AlertDefinition): void; /** * Suspends Alert Definition * @param alertDefinition Alert to suspend * */ suspendAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition; /** * Activates a suspended Alert Definition * @param alertDefinition - Alert to Un-suspend (activate) * @returns alert definition */ unSuspendAlertDefinition(alertDefinition: AlertDefinition): AlertDefinition; /** * Suspends all Alert Definitions */ suspendAllAlertDefinition(): void; /** * Activates all suspended Alert Definition */ unSuspendAllAlertDefinition(): void; /** * Evaluates the given Alert Definitions - will fire Alert if rule is met * @param alertDefinitions Alert Definitions to evaluate */ evaluateAlertDefinitions(alertDefinitions: AlertDefinition[]): void; /** * Find all Alert Definitions which match the given criteria * @param alertLookupCriteria lookup criteria */ findAlertDefinitions(alertLookupCriteria: AdaptableObjectLookupCriteria): AlertDefinition[]; /** * Displays given Alert as a Toast * @param alert the Alert to show as a Toast */ displayAdaptableAlertNotification(alert: AdaptableAlert): void; /** * Displays the given Adaptable Alert * @param alert The Alert which should be displayed */ displayAdaptableAlert(alertToShow: AdaptableAlert): Promise<void>; /** * Creates Alert based on given parameters and displays it. * @param alertHeader Header of the Alert (if shown in a popup its the Title of the Window) * @param alertMessage Main message of the alert */ showAlert(alertHeader: string, alertMessage: string, messageType: AdaptableMessageType, alertProperties?: AlertProperties): Promise<void>; /** * Creates an Adaptable Alert based on given parameters and displays it as Info Alert. * @param alertHeader Header of the Alert (if shown in a popup its the Title of the Window) * @param alertMessage Main message of the alert */ showAlertInfo(alertHeader: string, alertMessage: string): Promise<void>; /** * Creates an Adaptable Alert based on given parameters and displays it as Succcess Alert. * @param alertHeader Header of the Alert (if shown in a popup its the Title of the Window) * @param alertMessage Main message of the alert */ showAlertSuccess(alertHeader: string, alertMessage: string): Promise<void>; /** * Creates an Adaptable Alert based on given parameters and displays it as Warning Alert. * @param alertHeader Header of the Alert (if shown in a popup its the Title of the Window) * @param alertMessage Main message of the alert */ showAlertWarning(alertHeader: string, alertMessage: string): Promise<void>; /** * Creates an Adaptable Alert based on given parameters and displays it as Error Alert. * @param alertHeader Header of the Alert (if shown in a popup its the Title of the Window) * @param alertMessage Main message of the alert */ showAlertError(alertHeader: string, alertMessage: string): Promise<void>; }