DefinitelyTyped/types/native-toast/index.d.ts
Nathan Shively-Sanders 708214ef04 Change 'export default' to 'export =', part 2 (#33823)
* Change 'export default' to 'export ='

For packages that don't actually export a 'default' property.

* 7 more packages
2019-03-12 16:36:10 -07:00

37 lines
1.1 KiB
TypeScript

// Type definitions for native-toast 2.0
// Project: https://github.com/egoist/native-toast
// Definitions by: Michael Nahkies <https://github.com/mnahkies>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare const toast: {
(options: toast.ToastOptions): toast.Toast,
success: (options: toast.ToastOptions) => toast.Toast,
warning: (options: toast.ToastOptions) => toast.Toast,
info: (options: toast.ToastOptions) => toast.Toast,
error: (options: toast.ToastOptions) => toast.Toast,
};
export = toast;
declare namespace toast {
interface ToastOptions {
message?: string;
position?: "center" | "west" | "east" | "south" | "south-west" | "south-east" | "north" | "north-west" | "north-east";
timeout?: number;
el?: HTMLElement;
rounded?: boolean;
type?: "success" | "warning" | "info" | "error";
debug?: boolean;
edge?: boolean;
icon?: boolean;
closeOnClick?: boolean;
elements?: HTMLElement[];
}
interface Toast {
show(): void;
hide(): void;
destroy(): void;
}
}