UNPKG

aws-northstar

Version:
34 lines (33 loc) 1.43 kB
/// <reference types="react" /> /** * Severity of a notification. */ export declare type NotificationSeverity = 'DEBUG' | 'INFO' | 'WARNING' | 'ERROR'; export interface NotificationMessage { /** The id of the notification */ id: string; /** Indicates the type of the message to be displayed. Available options 'ERROR' | 'INFO' | 'DEBUG' | 'WARNING' */ severity: NotificationSeverity; /** Title text. */ title: string; /** Content text */ content?: string; } export interface NotificationButtonProps { /** * An array of notification message objects. Each notification message can have:<br/> * * - <b>id (string)</b> the id of the notification. <br/> * - <b>severity (string)</b> indicates the type of the message to be displayed. Available options 'ERROR' | 'INFO' | 'DEBUG' | 'WARNING' <br/> * - <b>title: (string)</b> title text <br/> * - <b>content (string)</b> optional content of the notification <br/> * */ notifications?: NotificationMessage[]; /** Callback when the notification is dismissed */ onDismissNotification: (id: string) => void; } /** * A button which succinctly indicates the number of notifications as a badge, with each notification shown when the button is clicked * */ declare const NotificationButton: ({ notifications, onDismissNotification }: NotificationButtonProps) => JSX.Element; export default NotificationButton;