UNPKG

@solfacil/girassol

Version:
51 lines (50 loc) 1.43 kB
import type { VNode } from 'vue'; export type ToastType = 'informative' | 'error' | 'warning' | 'success'; export type Position = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center'; export interface ToastContent { type?: ToastType; title?: string; description: string; actionText?: string; onAction?: () => void; } export interface ToastOptions { type?: ToastType; timeout?: number; position?: Position; showIcon?: boolean; showCloseButton?: boolean; hideProgressBar?: boolean; onClose?: () => void; } export interface ToastContentLimited { type?: ToastType; title?: string; description: string; actionText?: string; onAction?: () => void; } export interface ToastOptionsLimited { type?: ToastType; timeout?: number; } export interface ToastObject { toastVNode: VNode; container: HTMLDivElement; } export declare const TOAST_GAP = 12; export declare const DEFAULT_OPTIONS: ToastOptions; export interface ToastComponent { id: string | number; type: ToastType; visible?: boolean; title?: ToastContent['title']; description: ToastContent['description']; actionText?: ToastContent['actionText']; timeout: number; offset: number; onAction?: ToastOptions['onClose']; hideProgress?: boolean; showIcon?: boolean; } export type ContentTostParams = ToastContent | string;