toastify-all 1.0.0
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.
- package/LICENSE +1 -0
- package/README.md +311 -0
- package/dist/angular/angular/index.d.ts +29 -0
- package/dist/angular/angular/public-api.d.ts +1 -0
- package/dist/angular/core/AlertService.d.ts +39 -0
- package/dist/angular/core/NotificationCore.d.ts +51 -0
- package/dist/angular/index.d.ts +30 -0
- package/dist/angular/index.esm.js +949 -0
- package/dist/angular/index.esm.js.map +1 -0
- package/dist/angular/index.js +957 -0
- package/dist/angular/index.js.map +1 -0
- package/dist/index.esm.js +824 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +831 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +837 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/react/index.d.ts +15 -0
- package/dist/react/index.esm.js +916 -0
- package/dist/react/index.esm.js.map +1 -0
- package/dist/react/index.js +925 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react-native/index.d.ts +17 -0
- package/dist/react-native/index.esm.js +146 -0
- package/dist/react-native/index.esm.js.map +1 -0
- package/dist/react-native/index.js +153 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/types/index.d.ts +95 -0
- package/dist/vue/index.d.ts +19 -0
- package/dist/vue/index.esm.js +845 -0
- package/dist/vue/index.esm.js.map +1 -0
- package/dist/vue/index.js +857 -0
- package/dist/vue/index.js.map +1 -0
- package/package.json +160 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export type ToastPosition =
|
|
2
|
+
| 'top-left'
|
|
3
|
+
| 'top-center'
|
|
4
|
+
| 'top-right'
|
|
5
|
+
| 'bottom-left'
|
|
6
|
+
| 'bottom-center'
|
|
7
|
+
| 'bottom-right';
|
|
8
|
+
|
|
9
|
+
export type ToastType = 'default' | 'success' | 'error' | 'info' | 'warning' | 'loading' | 'custom';
|
|
10
|
+
|
|
11
|
+
export type ToastTheme = 'light' | 'dark' | 'colored' | 'system';
|
|
12
|
+
|
|
13
|
+
export type ToastTransition = 'bounce' | 'slide' | 'zoom' | 'flip';
|
|
14
|
+
|
|
15
|
+
export interface ToastAction {
|
|
16
|
+
label: string;
|
|
17
|
+
onClick?: (id: number) => void;
|
|
18
|
+
autoDismiss?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface NotificationOptions {
|
|
22
|
+
toastId?: number;
|
|
23
|
+
position?: ToastPosition;
|
|
24
|
+
autoClose?: number | false;
|
|
25
|
+
hideProgressBar?: boolean;
|
|
26
|
+
closeOnClick?: boolean;
|
|
27
|
+
pauseOnHover?: boolean;
|
|
28
|
+
pauseOnFocusLoss?: boolean;
|
|
29
|
+
draggable?: boolean;
|
|
30
|
+
draggablePercent?: number;
|
|
31
|
+
theme?: ToastTheme;
|
|
32
|
+
transition?: ToastTransition;
|
|
33
|
+
title?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
sound?: boolean;
|
|
36
|
+
className?: string;
|
|
37
|
+
bodyClassName?: string;
|
|
38
|
+
progressClassName?: string;
|
|
39
|
+
style?: Record<string, string | number>;
|
|
40
|
+
bodyStyle?: Record<string, string | number>;
|
|
41
|
+
progressStyle?: Record<string, string | number>;
|
|
42
|
+
icon?: string | Node | boolean;
|
|
43
|
+
action?: ToastAction;
|
|
44
|
+
closeButton?: boolean;
|
|
45
|
+
limit?: number | null;
|
|
46
|
+
newestOnTop?: boolean;
|
|
47
|
+
onOpen?: (id: number) => void;
|
|
48
|
+
onClose?: (id: number) => void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface NotificationUpdateState {
|
|
52
|
+
type?: ToastType;
|
|
53
|
+
message?: string | Node;
|
|
54
|
+
render?: string | Node;
|
|
55
|
+
autoClose?: number | false;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface PromiseToastOptions<T> {
|
|
59
|
+
pending?: string;
|
|
60
|
+
loading?: string;
|
|
61
|
+
success?: string | ((data: T) => string);
|
|
62
|
+
error?: string | ((error: any) => string);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface AlertService {
|
|
66
|
+
configure(options: NotificationOptions): void;
|
|
67
|
+
show(type: ToastType, message: string | Node, options?: NotificationOptions): number;
|
|
68
|
+
success(message: string | Node, options?: NotificationOptions): number;
|
|
69
|
+
error(message: string | Node, options?: NotificationOptions): number;
|
|
70
|
+
info(message: string | Node, options?: NotificationOptions): number;
|
|
71
|
+
warn(message: string | Node, options?: NotificationOptions): number;
|
|
72
|
+
warning(message: string | Node, options?: NotificationOptions): number;
|
|
73
|
+
loading(message: string | Node, options?: NotificationOptions): number;
|
|
74
|
+
custom(content: string | Node, options?: NotificationOptions): number;
|
|
75
|
+
promise<T>(
|
|
76
|
+
promiseOrFn: Promise<T> | (() => Promise<T>),
|
|
77
|
+
states?: PromiseToastOptions<T>,
|
|
78
|
+
options?: NotificationOptions
|
|
79
|
+
): Promise<T>;
|
|
80
|
+
update(id: number, newState: NotificationUpdateState): void;
|
|
81
|
+
dismiss(id?: number): void;
|
|
82
|
+
isActive(id: number): boolean;
|
|
83
|
+
clearWaitingQueue(): void;
|
|
84
|
+
clearAll(): void;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface ToastCallable extends AlertService {
|
|
88
|
+
(content: string | Node, options?: NotificationOptions): number;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
declare const alertService: AlertService;
|
|
92
|
+
declare const toast: ToastCallable;
|
|
93
|
+
|
|
94
|
+
export { AlertService, alertService, toast };
|
|
95
|
+
export default toast;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { NotificationOptions, ToastCallable } from '../types/index';
|
|
3
|
+
|
|
4
|
+
declare module '@vue/runtime-core' {
|
|
5
|
+
interface ComponentCustomProperties {
|
|
6
|
+
$toast: ToastCallable;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface NotificationPluginOptions extends NotificationOptions { }
|
|
11
|
+
|
|
12
|
+
export declare const NotificationPlugin: {
|
|
13
|
+
install(app: App, options?: NotificationPluginOptions): void;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export declare const useNotifications: () => ToastCallable;
|
|
17
|
+
export declare const useToast: () => ToastCallable;
|
|
18
|
+
export declare const toast: ToastCallable;
|
|
19
|
+
export default NotificationPlugin;
|