feather-toast-vue 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +88 -0
  2. package/package.json +1 -1
@@ -0,0 +1,88 @@
1
+ import type { App } from 'vue'
2
+
3
+ declare const CreateFeatherToast: {
4
+ install(app: App): void
5
+ }
6
+
7
+ export { CreateFeatherToast }
8
+
9
+ declare const useFeatherToast: () => {
10
+ toast: {
11
+ (options: ToastOptions): string
12
+ success(options: ToastOptions): string
13
+ error(options: ToastOptions): string
14
+ warning(options: ToastOptions): string
15
+ info(options: ToastOptions): string
16
+ loading(options: ToastOptions): string
17
+ dismiss(id: string): void
18
+ dismissAll(): void
19
+ promise<T>(
20
+ promise: Promise<T>,
21
+ options: ToastPromiseOptions<T>
22
+ ): Promise<T>
23
+ }
24
+ toasts: import('vue').Ref<Toast[]>
25
+ dismiss(id: string): void
26
+ dismissAll(): void
27
+ }
28
+
29
+ declare const useToast: typeof useFeatherToast
30
+
31
+ export { useFeatherToast, useToast }
32
+
33
+ export { default as ToastContainer } from './feather-toast.es.js'
34
+
35
+ export type {
36
+ Toast,
37
+ ToastOptions,
38
+ ToastAction,
39
+ ToastVariant,
40
+ ToastPosition,
41
+ ToastPromiseOptions,
42
+ } from './feather-toast.es.js'
43
+
44
+ declare module 'feather-toast-vue' {
45
+ export type { Toast, ToastOptions, ToastAction, ToastVariant, ToastPosition, ToastPromiseOptions }
46
+ export { CreateFeatherToast, useFeatherToast, useToast, ToastContainer }
47
+ }
48
+
49
+ interface Toast {
50
+ id: string
51
+ title?: string
52
+ description?: string
53
+ variant: 'default' | 'success' | 'error' | 'warning' | 'info' | 'loading'
54
+ position: 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center'
55
+ duration: number
56
+ dismissible: boolean
57
+ action?: {
58
+ label: string
59
+ onClick: () => void
60
+ }
61
+ }
62
+
63
+ interface ToastOptions {
64
+ title?: string
65
+ description?: string
66
+ variant?: 'default' | 'success' | 'error' | 'warning' | 'info' | 'loading'
67
+ position?: 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center'
68
+ duration?: number
69
+ dismissible?: boolean
70
+ action?: {
71
+ label: string
72
+ onClick: () => void
73
+ }
74
+ }
75
+
76
+ interface ToastAction {
77
+ label: string
78
+ onClick: () => void
79
+ }
80
+
81
+ type ToastVariant = 'default' | 'success' | 'error' | 'warning' | 'info' | 'loading'
82
+ type ToastPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center'
83
+
84
+ interface ToastPromiseOptions<T = any> {
85
+ loading: ToastOptions
86
+ success: ToastOptions | ((data: T) => ToastOptions)
87
+ error: ToastOptions | ((err: Error) => ToastOptions)
88
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feather-toast-vue",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "A lightweight, smooth Vue 3 toast notification plugin",
5
5
  "homepage": "https://zin-ix.github.io/feather-toast-vue/",
6
6
  "type": "module",