UNPKG

@essential-js/ui

Version:

EssentialJS UI

73 lines (66 loc) 2.24 kB
/************ Processor: ts ************/ import * as dependency_0 from 'react'; import * as dependency_1 from '@essential-js/ui/reactive-model'; // FILE: index.d.tsx declare namespace ns_index { import HTMLAttributes = dependency_0.HTMLAttributes; interface Props extends HTMLAttributes<HTMLDivElement> { className: string; position: Partial<IPosition>; } interface IPosition { top: string; left: string; right: string; bottom: string; } function Toasts({ position, className, ...props }: Partial<Props>): JSX.Element; } // FILE: model.d.ts /// <reference types="react" /> declare namespace ns_model { import ReactiveModel = dependency_1.ReactiveModel; interface IToast { id: string; message: string; type: string; duration?: number; icon: Element; } type IToastClass = any; class Toast extends ReactiveModel implements IToastClass { #private; get current(): Array<IToast | undefined>; set current(newValue: Array<IToast | undefined>); constructor(); info(message: string, duration?: number): string; warning(message: string, duration?: number): string; success(message: string, duration?: number): string; error(message: string, duration?: number): string; loading(message: string, duration?: number): string; remove(toastId: string): void; set(type: string): void; setIcon(iconName: string, icon: JSX.Element): void; } const toast: Toast; } // FILE: toast.d.tsx declare namespace ns_toast { /// <reference types="react" /> interface Props { key: string; type: string; message: string; duration?: number; id: string; icon: any; } function Toast({ type, message, duration, id, icon }: Props): JSX.Element; } export import Toasts = ns_index.Toasts; export import IToast = ns_model.IToast; export import toast = ns_model.toast; export import Toast = ns_toast.Toast; export declare const hmr: {on: (event: string, listener: any) => void, off: (event: string, listener: any) => void };