@fewangsit/wangsvue-gsts 2.0.0-alpha.3 → 2.0.0-alpha.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.
package/toast/index.d.ts CHANGED
@@ -34,6 +34,19 @@ export declare type ToastPassThroughTransitionType =
34
34
 
35
35
  export type ToastSeverity = 'success' | 'error' | 'info';
36
36
 
37
+ export interface ToastLocaleConfig {
38
+ /**
39
+ * The messages to display for different types of toast.
40
+ * @example
41
+ * successMessage: 'Success, {message}'
42
+ * errorMessage: 'Error, {message}'
43
+ * networkErrorMessage: ' Please check your connection and try again.'
44
+ */
45
+ successMessage?: string;
46
+ errorMessage?: string;
47
+ networkErrorMessage?: string;
48
+ }
49
+
37
50
  export interface ToastMessageOptions {
38
51
  /**
39
52
  * The main message to display in the toast. Will be formatted based on template message.
@@ -17,24 +17,6 @@ export interface ToastMethod {
17
17
  * Configuration options for the `useToast` hook.
18
18
  */
19
19
  export interface UseToastConfig {
20
- /**
21
- * Default message templates for each severity level.
22
- * Keys represent the severity, and values are the template strings.
23
- *
24
- * @example
25
- * {
26
- * severity: {
27
- * success: 'Success, {message}',
28
- * error: 'Error, {message} {additionalMessage}',
29
- * info: 'Info, {message} {additionalMessage}',
30
- * },
31
- * additionalMessage: ' Silahkan cek kembali koneksi Anda.'
32
- * }
33
- */
34
- template?: {
35
- severity?: Record<string, string>;
36
- additionalMessage?: string;
37
- };
38
20
  /**
39
21
  * Icons for each severity level.
40
22
  * Keys represent the severity, and values are the corresponding icon identifiers.
@@ -58,11 +40,6 @@ export interface UseToastConfig {
58
40
  *
59
41
  * @example
60
42
  * const toast = useToast({
61
- * template: {
62
- * success: 'Success, {message}',
63
- * error: 'Error, {message} {additionalMessage}',
64
- * info: 'Info, {message} {additionalMessage}',
65
- * },
66
43
  * icons: {
67
44
  * success: 'emotion-happy-fill',
68
45
  * error: 'emotion-unhappy-fill',
@@ -76,5 +53,5 @@ export interface UseToastConfig {
76
53
  * icon: 'custom-success-icon',
77
54
  * });
78
55
  */
79
- declare const useToast: ({ icons, template }?: UseToastConfig) => ToastMethod;
56
+ declare const useToast: ({ icons }?: UseToastConfig) => ToastMethod;
80
57
  export default useToast;
@@ -1,5 +1,3 @@
1
- import { ToastMethod, type UseToastConfig } from '../utils/baseToast.util';
1
+ import useToast from '../utils/baseToast.util';
2
2
  export type * from '../utils/baseToast.util';
3
- export declare const useToastConfig: UseToastConfig;
4
- declare const useToast: () => ToastMethod;
5
3
  export default useToast;