@impossiblefinance/uikit
Version:
Set of UI components for impossible projects
40 lines (39 loc) • 897 B
TypeScript
export declare const types: {
SUCCESS: string;
DANGER: string;
WARNING: string;
INFO: string;
ANNOUNCEMENT: string;
CUSTOM: string;
};
export declare type Types = typeof types[keyof typeof types];
export interface ToastAction {
text: string;
url: string;
}
export interface Toast {
id: string;
type: Types;
title: string;
description?: string;
action?: ToastAction;
alertBackground?: string;
toastBackground?: string;
toastIcon?: string;
toastBorder?: string;
alwaysShow?: boolean;
icon?: string;
onClick?: Function;
}
export interface ToastContainerProps {
toasts: Toast[];
stackSpacing?: number;
ttl?: number;
onRemove: (id: string) => void;
}
export interface ToastProps {
toast: Toast;
onRemove: ToastContainerProps['onRemove'];
ttl: number;
style: Partial<CSSStyleDeclaration>;
}