@nteract/mythic-notifications
Version:
A notification system based on blueprintjs toasters and the myths redux framework
27 lines (26 loc) • 675 B
TypeScript
/// <reference types="react" />
import { IconName } from "@blueprintjs/core";
import { MythicAction } from "@nteract/myths";
export declare type NotificationAction = {
callback: () => void;
} | {
dispatch: MythicAction;
} | {
url: string;
} | {
file: string;
};
export interface NotificationMessage {
key?: string;
icon?: IconName;
title?: string;
message: string | JSX.Element;
level: "error" | "warning" | "info" | "success" | "in-progress";
action?: NotificationAction & {
icon?: IconName;
label: string;
};
}
export interface NotificationSystem {
addNotification(notification: NotificationMessage): void;
}