UNPKG

@enclavemoney/enclave-wallet-sdk

Version:

A simple enclave wallet SDK for React applications

35 lines (34 loc) 1.11 kB
import React from "react"; export interface ToastType { id: string; type: "success" | "error" | "loading" | "info"; message: React.ReactNode; duration?: number; dismissible?: boolean; } interface ToastContextType { toasts: ToastType[]; addToast: (toast: Omit<ToastType, "id">) => string; removeToast: (id: string) => void; updateToast: (id: string, updates: Partial<ToastType>) => void; } export declare const useToast: () => ToastContextType; export declare const toast: { success: (message: React.ReactNode, options?: { duration?: number; }) => string; error: (message: React.ReactNode, options?: { duration?: number; }) => string; loading: (message: React.ReactNode) => string; info: (message: React.ReactNode, options?: { duration?: number; }) => string; dismiss: (id: string) => void; update: (id: string, updates: Partial<ToastType>) => void; }; interface ToastProviderProps { children: React.ReactNode; } export declare const ToastProvider: React.FC<ToastProviderProps>; export default ToastProvider;