import { AsyncModuleRegistry } from '@cpro-js/react-core'; import { FC } from 'react'; import { ReactElement } from 'react'; import { ReactFragment } from 'react'; export declare const createNotificationRegistry: () => AsyncModuleRegistry; declare type ErrorDetail = string | ReactElement | ReactFragment | null | undefined; export declare const NotificationRenderer: FC; declare interface NotificationRendererProps { /** * Specifies how long success messages will stay on the screen before automatically disappearing. * Duration in milliseconds (default: 3000ms = 3sec). */ successNotiDuration?: number; /** * Render your own success message. * Call the finishAction when you're done showing the message. * * @param message * @param duration * @param finishAction */ renderSuccess?: (message: string, duration: number, finishAction: () => void) => ReactElement; /** * Add your own renderer for error messages. * Call the finishAction when you're done showing the message. * * @param error containing the error message and maybe some more details * @param finishAction */ renderError?: (error: UserErrorModel, finishAction: () => void) => ReactElement; } export declare class NotificationService { private store; constructor(store: NotificationStore); showError: (message: string, details?: Error | ErrorDetail, callback?: (() => void) | undefined) => void; showSuccess: (successMessage: string, callback?: (() => void) | undefined) => void; } declare class NotificationStore { private errors; private successMessages; constructor(); appendError(error: UserErrorModel, callback?: () => void): void; removeFromErrors: (error: UserErrorModel) => void; getNextError: () => [UserErrorModel, (() => void) | undefined] | undefined[]; appendSuccessMessage(successMessage: string, callback?: () => void): void; getNextSuccessMessage: () => [string, (() => void) | undefined] | undefined[]; removeFromSuccessMessages: (successMessage: string) => void; } declare interface UserErrorModel { message: string; details?: ErrorDetail; } export { }