UNPKG

1.41 kBTypeScriptView Raw
1/// <reference types="react" />
2import { AbstractPureComponent } from "../../common";
3import type { OverlayToasterProps } from "./overlayToasterProps";
4import { ToastProps } from "./toast";
5import type { Toaster, ToastOptions } from "./toaster";
6export interface OverlayToasterState {
7 toasts: ToastOptions[];
8}
9/**
10 * OverlayToaster component.
11 *
12 * @see https://blueprintjs.com/docs/#core/components/toast
13 */
14export declare class OverlayToaster extends AbstractPureComponent<OverlayToasterProps, OverlayToasterState> implements Toaster {
15 static displayName: string;
16 static defaultProps: OverlayToasterProps;
17 /**
18 * Create a new `Toaster` instance that can be shared around your application.
19 * The `Toaster` will be rendered into a new element appended to the given container.
20 */
21 static create(props?: OverlayToasterProps, container?: HTMLElement): Toaster;
22 state: OverlayToasterState;
23 private toastId;
24 show(props: ToastProps, key?: string): string;
25 dismiss(key: string, timeoutExpired?: boolean): void;
26 clear(): void;
27 getToasts(): ToastOptions[];
28 render(): JSX.Element;
29 protected validateProps({ maxToasts }: OverlayToasterProps): void;
30 private isNewToastKey;
31 private dismissIfAtLimit;
32 private renderToast;
33 private createToastOptions;
34 private getPositionClasses;
35 private getDismissHandler;
36 private handleClose;
37}