import { type ComponentType } from "react"; import { type DateAttributeGranularity, type IAttribute, type IAutomationMetadataObject, type IDataSetMetadataObject, type IInsight, type IMeasure, type INotificationChannelIdentifier, type INotificationChannelMetadataObject, type IWidget, type IWorkspaceUser } from "@gooddata/sdk-model"; import { type GoodDataSdkError } from "@gooddata/sdk-ui"; /** * @alpha */ export interface IAlertingDialogProps { /** * In case, we are not creating new alert, but editing existing one, this is the active alert to be edited. */ alertToEdit?: IAutomationMetadataObject; /** * Users in workspace */ users: IWorkspaceUser[]; /** * Error occurred while loading users */ usersError?: GoodDataSdkError; /** * Notification channels in organization */ notificationChannels: INotificationChannelIdentifier[] | INotificationChannelMetadataObject[]; /** * Widget to be used for alert. * * Note: this is available only when alerting for widget, not dashboard. * Typed as IWidget (not ExtendedDashboardWidget) because the dialog only * supports insight widgets; custom widgets and nested layouts are not valid * alert targets and were silently discarded at the connector boundary anyway. */ widget?: IWidget; /** * Insight to be used for alert. * * Note: this is available only when alerting for widget, not dashboard. */ insight?: IInsight; /** * Is alert dialog loading initial data, before it can be rendered? */ isLoading?: boolean; /** * Callback to be called, when user closes the alert dialog. */ onCancel?: () => void; /** * Callback to be called, when error occurs. */ onError?: (error: GoodDataSdkError) => void; /** * Callback to be called, when alerting finishes successfully. */ onSuccess?: (alertDefinition: IAutomationMetadataObject) => void; /** * Callback to be called, when error occurs. */ onSaveError?: (error: GoodDataSdkError) => void; /** * Callback to be called, when alerting finishes successfully. */ onSaveSuccess?: (alert: IAutomationMetadataObject) => void; /** * Callback to be called, when alert is deleted. */ onDeleteSuccess?: (alert: IAutomationMetadataObject) => void; /** * Callback to be called, when alert fails to delete. */ onDeleteError?: (error: GoodDataSdkError) => void; } /** * @alpha */ export interface IAlertingManagementDialogProps { /** * Is loading alert data? */ isLoadingAlertingData: boolean; /** * Error occurred while loading alert data? */ alertDataError?: GoodDataSdkError; /** * Notification channels in organization */ notificationChannels: INotificationChannelIdentifier[] | INotificationChannelMetadataObject[]; /** * Automations in workspace */ automations: IAutomationMetadataObject[]; /** * Callback to be called, when user adds new alert item. */ onAdd?: () => void; /** * Callback to be called, when user clicks alert item for editing. */ onEdit?: (alert: IAutomationMetadataObject) => void; /** * Callback to be called, when user closes the alert management dialog. */ onClose?: () => void; /** * Callback to be called, when alert is deleted. * @param alert - alert that was deleted */ onDeleteSuccess?: (alert: IAutomationMetadataObject) => void; /** * Callback to be called, when alert fails to delete. */ onDeleteError?: (error: GoodDataSdkError) => void; /** * Callback to be called, when alert is paused. * @param alert - alert that was paused * @param pause - true if alert was paused, false if it was resumed */ onPauseSuccess: (alert: IAutomationMetadataObject, pause: boolean) => void; /** * Callback to be called, when alert fails to pause. * @param error - error that occurred * @param pause - true if alert was paused, false if it was resumed */ onPauseError: (error: GoodDataSdkError, pause: boolean) => void; } /** * @alpha */ export type CustomAlertingDialogComponent = ComponentType; /** * @alpha */ export type CustomAlertingManagementDialogComponent = ComponentType; /** * @alpha */ export interface IAlertDropdownProps { isReadOnly?: boolean; paused: boolean; alignTo: HTMLElement; onClose: () => void; onDelete: () => void; onPause: () => void; onEdit: () => void; onResume: () => void; } /** * @internal */ export declare enum AlertMetricComparatorType { PreviousPeriod = 0, SamePeriodPreviousYear = 1 } /** * @internal */ export type AlertMetricComparator = { measure: IMeasure; isPrimary: boolean; comparator: AlertMetricComparatorType; dataset?: IDataSetMetadataObject; granularity?: DateAttributeGranularity; }; /** * @internal */ export type AlertMetric = { measure: IMeasure; isPrimary: boolean; comparators: AlertMetricComparator[]; }; /** * @internal */ export type AlertAttribute = { attribute: IAttribute; type: "dateAttribute" | "attribute"; }; //# sourceMappingURL=types.d.ts.map