design-react-kit
Version:
Componenti React per Bootstrap 5
30 lines (29 loc) • 1.21 kB
TypeScript
import React, { ReactNode } from 'react';
import { NotificationCommonProps } from './types';
export interface NotificationToastProps {
/** Indica quale icona affiancare al titolo. */
icon?: string;
/** Lo stato corrente della notifica (modifica il colore delle icone e bordo) */
state?: 'success' | 'error' | 'info' | 'warning';
/** Il titolo della notifica */
title?: string;
}
type NotificationElementProps = {
closeToast?: () => void;
toastProps?: any;
title: string;
body?: ReactNode;
options: NotificationOptions;
};
export declare const getBorderStyleFix: (fix: NotificationCommonProps["fix"]) => React.CSSProperties;
export type NotificationOptions = NotificationCommonProps & Pick<NotificationToastProps, 'icon' | 'state'> & {
dismissable?: boolean;
onOpen?: <T = NotificationElementProps>(props: T) => void;
onClose?: <T = NotificationElementProps>(props: T) => void;
};
/**
* Internal use only. Exported for documentation purposes.
* @internal
*/
export declare const createNotification: (title: string, body: ReactNode | undefined, options: NotificationOptions, closeToast?: () => void, toastProps?: any) => React.JSX.Element;
export {};