toastory 0.1.0 → 0.1.2
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/README.md +10 -10
- package/dist/angular.cjs +2 -2
- package/dist/angular.cjs.map +1 -1
- package/dist/angular.d.cts +11 -4
- package/dist/angular.d.ts +11 -4
- package/dist/angular.js +2 -2
- package/dist/angular.js.map +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +6 -6
- package/dist/core.d.ts +6 -6
- package/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/dist/{dialog-B08CfkHj.d.ts → dialog-Buemfm7I.d.ts} +1 -1
- package/dist/{dialog-B9Z_67Ry.d.ts → dialog-fziFV6J0.d.cts} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/native.cjs +1 -1
- package/dist/native.cjs.map +1 -1
- package/dist/native.js +1 -1
- package/dist/native.js.map +1 -1
- package/dist/react.cjs +2 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +10 -7
- package/dist/react.d.ts +10 -7
- package/dist/react.js +2 -2
- package/dist/react.js.map +1 -1
- package/dist/svelte.cjs +2 -2
- package/dist/svelte.cjs.map +1 -1
- package/dist/svelte.d.cts +2 -2
- package/dist/svelte.d.ts +2 -2
- package/dist/svelte.js +2 -2
- package/dist/svelte.js.map +1 -1
- package/dist/themes/_base.css +1 -1
- package/dist/themes/_base.dialog.css +1 -1
- package/dist/themes/_base.toast.css +1 -1
- package/dist/themes/all.css +1 -0
- package/dist/themes/aurora.css +1 -1
- package/dist/themes/aurora.dialog.css +1 -1
- package/dist/themes/aurora.toast.css +1 -1
- package/dist/themes/basic.css +1 -1
- package/dist/themes/basic.dialog.css +1 -1
- package/dist/themes/basic.toast.css +1 -1
- package/dist/themes/brutal.css +1 -1
- package/dist/themes/brutal.dialog.css +1 -1
- package/dist/themes/brutal.toast.css +1 -1
- package/dist/themes/classic-bar.css +1 -1
- package/dist/themes/classic-bar.dialog.css +1 -1
- package/dist/themes/classic-bar.toast.css +1 -1
- package/dist/themes/classic-stack.css +1 -1
- package/dist/themes/classic-stack.dialog.css +1 -1
- package/dist/themes/classic-stack.toast.css +1 -1
- package/dist/themes/dialogs.css +1 -1
- package/dist/themes/dialogs.dialog.css +1 -1
- package/dist/themes/dialogs.toast.css +1 -1
- package/dist/themes/essentials.css +1 -1
- package/dist/themes/essentials.dialog.css +1 -1
- package/dist/themes/essentials.toast.css +1 -1
- package/dist/themes/flat.css +1 -1
- package/dist/themes/flat.dialog.css +1 -1
- package/dist/themes/flat.toast.css +1 -1
- package/dist/themes/gradient-strip.css +1 -1
- package/dist/themes/gradient-strip.dialog.css +1 -1
- package/dist/themes/gradient-strip.toast.css +1 -1
- package/dist/themes/gradient.css +1 -1
- package/dist/themes/gradient.dialog.css +1 -1
- package/dist/themes/gradient.toast.css +1 -1
- package/dist/themes/ios-glass.css +1 -1
- package/dist/themes/ios-glass.dialog.css +1 -1
- package/dist/themes/ios-glass.toast.css +1 -1
- package/dist/themes/liquid-glass.css +1 -1
- package/dist/themes/liquid-glass.dialog.css +1 -1
- package/dist/themes/liquid-glass.toast.css +1 -1
- package/dist/themes/material.css +1 -1
- package/dist/themes/material.dialog.css +1 -1
- package/dist/themes/material.toast.css +1 -1
- package/dist/themes/minimal.css +1 -1
- package/dist/themes/minimal.dialog.css +1 -1
- package/dist/themes/minimal.toast.css +1 -1
- package/dist/themes/neon.css +1 -1
- package/dist/themes/neon.dialog.css +1 -1
- package/dist/themes/neon.toast.css +1 -1
- package/dist/themes/outline.css +1 -1
- package/dist/themes/outline.dialog.css +1 -1
- package/dist/themes/outline.toast.css +1 -1
- package/dist/themes/pastel.css +1 -1
- package/dist/themes/pastel.dialog.css +1 -1
- package/dist/themes/pastel.toast.css +1 -1
- package/dist/themes/pill.css +1 -1
- package/dist/themes/pill.dialog.css +1 -1
- package/dist/themes/pill.toast.css +1 -1
- package/dist/themes/ripple.css +1 -1
- package/dist/themes/ripple.dialog.css +1 -1
- package/dist/themes/ripple.toast.css +1 -1
- package/dist/themes/showcase.css +1 -1
- package/dist/themes/showcase.dialog.css +1 -1
- package/dist/themes/showcase.toast.css +1 -1
- package/dist/themes/sweet.css +1 -1
- package/dist/themes/sweet.dialog.css +1 -1
- package/dist/themes/sweet.toast.css +1 -1
- package/dist/{toast-api-C3NL4zla.d.cts → toast-api-D6WYDtUy.d.cts} +5 -3
- package/dist/{toast-api-C3NL4zla.d.ts → toast-api-D6WYDtUy.d.ts} +5 -3
- package/dist/{ui-BRRU9D4b.d.ts → ui-Cs1AjRNH.d.ts} +2 -2
- package/dist/{ui-30FIsmS5.d.cts → ui-D5FwMD8Y.d.cts} +2 -2
- package/dist/vue.cjs +2 -2
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.d.cts +130 -13
- package/dist/vue.d.ts +130 -13
- package/dist/vue.js +2 -2
- package/dist/vue.js.map +1 -1
- package/package.json +6 -6
- package/dist/dialog-BDLOS-N9.d.cts +0 -56
- package/dist/dialog-BwJckkzq.d.cts +0 -56
- package/dist/dialog-DWyGuoVI.d.cts +0 -56
- package/dist/dialog-D_JZtadd.d.cts +0 -56
- package/dist/dialog-GDDN2Jkl.d.ts +0 -56
- package/dist/dialog-zlFXWvsk.d.ts +0 -56
- package/dist/toast-api-DksXya0f.d.cts +0 -704
- package/dist/toast-api-DksXya0f.d.ts +0 -704
- package/dist/toast-api-TqsztUqW.d.cts +0 -704
- package/dist/toast-api-TqsztUqW.d.ts +0 -704
- package/dist/ui-Bk3-iiT3.d.cts +0 -97
- package/dist/ui-BwjuXLKj.d.ts +0 -97
- package/dist/ui-CVyKIiVQ.d.ts +0 -97
- package/dist/ui-Cma14-bn.d.cts +0 -97
- package/dist/ui-ImWgPMgJ.d.ts +0 -97
- package/dist/ui-u9GYcdbJ.d.cts +0 -97
|
@@ -1,704 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Injectable clock and scheduler interface.
|
|
3
|
-
* Abstracts time and timers so tests and headless engines can run deterministically.
|
|
4
|
-
*/
|
|
5
|
-
interface Clock {
|
|
6
|
-
/** Returns the current timestamp in milliseconds. */
|
|
7
|
-
now(): number;
|
|
8
|
-
/**
|
|
9
|
-
* Schedules a callback after `ms` milliseconds.
|
|
10
|
-
* @returns A cancellation function.
|
|
11
|
-
*/
|
|
12
|
-
setTimeout(fn: () => void, ms: number): () => void;
|
|
13
|
-
/**
|
|
14
|
-
* Schedules a recurring callback every `ms` milliseconds.
|
|
15
|
-
* @returns A cancellation function.
|
|
16
|
-
*/
|
|
17
|
-
setInterval(fn: () => void, ms: number): () => void;
|
|
18
|
-
}
|
|
19
|
-
/** Default system clock using standard global timer functions. */
|
|
20
|
-
declare const defaultClock: Clock;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Shared type definitions for the glazekit framework-agnostic core.
|
|
24
|
-
* This module is 100% renderer-agnostic: no DOM, no framework imports.
|
|
25
|
-
*/
|
|
26
|
-
/** Identifier of a toast. Strings and numbers are supported. */
|
|
27
|
-
type ToastId = string | number;
|
|
28
|
-
/**
|
|
29
|
-
* Anything a renderer can display. The concrete meaning depends on the adapter:
|
|
30
|
-
* a string for the web renderer, a React element for `glazekit/react`,
|
|
31
|
-
* a VNode for `glazekit/vue`, etc.
|
|
32
|
-
*/
|
|
33
|
-
type Renderable = unknown;
|
|
34
|
-
/** Built-in toast types. */
|
|
35
|
-
type BuiltInToastType = 'default' | 'message' | 'success' | 'error' | 'info' | 'warning' | 'loading';
|
|
36
|
-
/** Toast type name: a built-in type or custom registered type string. */
|
|
37
|
-
type ToastType = BuiltInToastType | (string & {});
|
|
38
|
-
/** Placements supported by toast regions (6 positions). */
|
|
39
|
-
type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
40
|
-
/** The five rows of the dialog placement grid. */
|
|
41
|
-
type DialogRow = 'top' | 'upper' | 'center' | 'lower' | 'bottom';
|
|
42
|
-
/** The three columns of the dialog placement grid. */
|
|
43
|
-
type DialogColumn = 'start' | 'center' | 'end';
|
|
44
|
-
/** 15 dialog placements, row-column formatted. */
|
|
45
|
-
type DialogPosition = `${DialogRow}-${DialogColumn}` | 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'center-start' | 'center-end' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
46
|
-
/** Unified position type encompassing 6 toast positions and 15 dialog placements. */
|
|
47
|
-
type Position = ToastPosition | DialogPosition;
|
|
48
|
-
/** Known theme presets. */
|
|
49
|
-
type ThemeName = 'essentials' | 'showcase' | 'dialogs' | 'ios-glass' | 'liquid-glass' | 'aurora' | 'classic-stack' | 'classic-bar' | 'pill' | 'ripple' | 'gradient-strip' | 'sweet' | 'material' | 'basic' | 'minimal' | 'flat' | 'outline' | 'neon' | 'gradient' | 'brutal' | 'pastel' | (string & {});
|
|
50
|
-
/** Variants supported in the essentials theme. */
|
|
51
|
-
type EssentialsToastVariant = 'minimal' | 'success' | 'error' | 'warning' | 'accent-bar' | 'badge-title' | 'progress-bar' | 'pill' | 'undo-bar' | 'inline-confirm' | 'loading-percent' | 'avatar';
|
|
52
|
-
/** Variants supported in the showcase theme. */
|
|
53
|
-
type ShowcaseToastVariant = 'glass-gradient' | 'emerald' | 'neon-error' | 'ios-banner' | 'dev-dark' | 'countdown-ring' | 'stacked' | 'upload-card' | 'island' | 'gradient-border' | 'soft-light' | 'message-actions';
|
|
54
|
-
/** Variants supported in the ios-glass and liquid-glass themes. */
|
|
55
|
-
type IosGlassToastVariant = 'banner-light' | 'banner-dark' | 'capsule-success' | 'island-call' | 'hud-silent' | 'system-alert' | 'device-popup' | 'grouped-stack' | 'progress-ring' | 'shake-error' | 'focus-toggle' | 'compact-action';
|
|
56
|
-
/** Toast variant types across all themes. */
|
|
57
|
-
type ToastVariant = EssentialsToastVariant | ShowcaseToastVariant | IosGlassToastVariant | (string & {});
|
|
58
|
-
/** Dialog variant types across all themes. */
|
|
59
|
-
type DialogVariant = 'warning-confirm' | 'danger-confirm' | 'type-to-confirm' | 'rename-prompt' | 'success' | 'update-info' | 'dark-logout' | 'ios-glass-alert' | 'bottom-sheet-confirm' | 'reauth-password' | 'otp-code' | 'session-countdown' | (string & {});
|
|
60
|
-
/** Action item button in a toast actions array. */
|
|
61
|
-
interface ToastActionItem {
|
|
62
|
-
label?: string;
|
|
63
|
-
text?: string;
|
|
64
|
-
onClick?: (event: MouseEvent) => void;
|
|
65
|
-
kind?: 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
66
|
-
autoDismiss?: boolean;
|
|
67
|
-
}
|
|
68
|
-
/** Avatar display options in a toast. */
|
|
69
|
-
interface ToastAvatarOption {
|
|
70
|
-
initials?: string;
|
|
71
|
-
name?: string;
|
|
72
|
-
src?: string;
|
|
73
|
-
alt?: string;
|
|
74
|
-
color?: string;
|
|
75
|
-
}
|
|
76
|
-
/** Switch toggle in a toast. */
|
|
77
|
-
interface ToastToggleOption {
|
|
78
|
-
checked?: boolean;
|
|
79
|
-
defaultChecked?: boolean;
|
|
80
|
-
onChange?: (checked: boolean) => void;
|
|
81
|
-
label?: string;
|
|
82
|
-
}
|
|
83
|
-
/** Color scheme selection. `auto` follows system preference. */
|
|
84
|
-
type ColorMode = 'light' | 'dark' | 'auto';
|
|
85
|
-
type Mode = ColorMode;
|
|
86
|
-
/** Text direction. `auto` inherits from root context. */
|
|
87
|
-
type Direction = 'ltr' | 'rtl' | 'auto';
|
|
88
|
-
/** Events that pause a countdown timer. */
|
|
89
|
-
type PauseOn = 'hover' | 'focus' | 'hidden' | 'manual' | (string & {});
|
|
90
|
-
/** Directions in which a toast can be swiped away. */
|
|
91
|
-
type SwipeDirection = 'left' | 'right' | 'up' | 'down';
|
|
92
|
-
/** Why a toast was removed. */
|
|
93
|
-
type CloseReason = 'auto' | 'user' | 'swipe' | 'click' | 'action' | 'cancel' | 'api' | 'overflow';
|
|
94
|
-
/** A clickable action or cancel button rendered inside a toast. */
|
|
95
|
-
interface ToastAction {
|
|
96
|
-
/** Visible button label. */
|
|
97
|
-
label: string;
|
|
98
|
-
/** Called when activated. Calling `preventDefault()` prevents automatic dismissal. */
|
|
99
|
-
onClick?: (event: {
|
|
100
|
-
preventDefault(): void;
|
|
101
|
-
defaultPrevented: boolean;
|
|
102
|
-
}) => void;
|
|
103
|
-
/** Optional accessible label when the text alone is ambiguous. */
|
|
104
|
-
ariaLabel?: string;
|
|
105
|
-
}
|
|
106
|
-
/** Alias for ToastAction. */
|
|
107
|
-
type ToastButton = ToastAction;
|
|
108
|
-
/** Slot class names a consumer can override. */
|
|
109
|
-
interface ToastClassNames {
|
|
110
|
-
toast?: string;
|
|
111
|
-
title?: string;
|
|
112
|
-
description?: string;
|
|
113
|
-
icon?: string;
|
|
114
|
-
avatar?: string;
|
|
115
|
-
actionButton?: string;
|
|
116
|
-
cancelButton?: string;
|
|
117
|
-
closeButton?: string;
|
|
118
|
-
progress?: string;
|
|
119
|
-
content?: string;
|
|
120
|
-
count?: string;
|
|
121
|
-
link?: string;
|
|
122
|
-
actions?: string;
|
|
123
|
-
action?: string;
|
|
124
|
-
cancel?: string;
|
|
125
|
-
badge?: string;
|
|
126
|
-
time?: string;
|
|
127
|
-
kbd?: string;
|
|
128
|
-
}
|
|
129
|
-
/** Stacking mode for toasts. */
|
|
130
|
-
type StackMode = boolean | 'stacked' | 'expanded' | 'list';
|
|
131
|
-
/** Built-in animation presets for toast enter/exit. */
|
|
132
|
-
type AnimationType = 'slide' | 'bounce' | 'zoom' | 'flip' | 'spring' | 'fade' | 'none';
|
|
133
|
-
/** Region offset configuration. */
|
|
134
|
-
type OffsetConfig = number | string | {
|
|
135
|
-
top?: number | string;
|
|
136
|
-
bottom?: number | string;
|
|
137
|
-
left?: number | string;
|
|
138
|
-
right?: number | string;
|
|
139
|
-
};
|
|
140
|
-
/** Context provided to `ui.toast.custom` renderers. */
|
|
141
|
-
interface ToastRenderContext {
|
|
142
|
-
id: ToastId;
|
|
143
|
-
dismiss: () => void;
|
|
144
|
-
update: (patch: ToastPatch) => void;
|
|
145
|
-
}
|
|
146
|
-
/** Custom renderer callback. */
|
|
147
|
-
type ToastCustomRenderer = (context: ToastRenderContext) => Renderable;
|
|
148
|
-
/**
|
|
149
|
-
* Options accepted by every toast creation call.
|
|
150
|
-
*/
|
|
151
|
-
interface ToastOptions {
|
|
152
|
-
/** Stable identifier. Reusing an active id updates in-place. */
|
|
153
|
-
id?: ToastId;
|
|
154
|
-
/** Toast type preset. */
|
|
155
|
-
type?: ToastType;
|
|
156
|
-
/** Heading text or renderable node. */
|
|
157
|
-
title?: Renderable;
|
|
158
|
-
/** Secondary subtitle or body text. */
|
|
159
|
-
description?: Renderable;
|
|
160
|
-
/** Theme-declared variant preset. */
|
|
161
|
-
variant?: ToastVariant;
|
|
162
|
-
/** Tone icon chip badge or custom badge description. */
|
|
163
|
-
badge?: string | {
|
|
164
|
-
icon?: Renderable;
|
|
165
|
-
tone?: string;
|
|
166
|
-
label?: string;
|
|
167
|
-
};
|
|
168
|
-
/** Keyboard shortcut hint chip, e.g. 'Esc'. */
|
|
169
|
-
kbd?: string;
|
|
170
|
-
/** Timestamp: number, Date, formatted string or boolean for 'now'. */
|
|
171
|
-
timestamp?: number | Date | string | boolean;
|
|
172
|
-
/** Locale for timestamp relative time formatting (e.g. 'en', 'es'). */
|
|
173
|
-
timestampLocale?: string;
|
|
174
|
-
/** Progress indicator type: 'bar' | 'ring' | 'none' or boolean. */
|
|
175
|
-
progress?: 'bar' | 'ring' | 'none' | boolean;
|
|
176
|
-
/** Determinate progress value between 0 and 1. */
|
|
177
|
-
progressValue?: number;
|
|
178
|
-
/** Progress label string, e.g. "64%" or "4.2 MB of 6.8 MB". */
|
|
179
|
-
progressLabel?: string;
|
|
180
|
-
/** Action buttons array. */
|
|
181
|
-
actions?: ToastActionItem[];
|
|
182
|
-
/** Interactive toggle switch. */
|
|
183
|
-
toggle?: ToastToggleOption;
|
|
184
|
-
/** Group key for grouped notifications stack. */
|
|
185
|
-
group?: string;
|
|
186
|
-
/** Play error shake animation on entrance. */
|
|
187
|
-
shake?: boolean;
|
|
188
|
-
/** Glowing border / box-shadow. */
|
|
189
|
-
glow?: boolean;
|
|
190
|
-
/** Gradient border accent. */
|
|
191
|
-
gradientBorder?: boolean;
|
|
192
|
-
/** Dynamic Island pill layout. */
|
|
193
|
-
island?: boolean;
|
|
194
|
-
/** Centered floating HUD overlay (does not steal focus). */
|
|
195
|
-
hud?: boolean;
|
|
196
|
-
/** Icon: false disables, custom string or node replaces the built-in icon. */
|
|
197
|
-
icon?: Renderable | false;
|
|
198
|
-
/** Avatar URL, initials object, or node shown before text. */
|
|
199
|
-
avatar?: Renderable | ToastAvatarOption;
|
|
200
|
-
/** Duration in ms. `0` or `Infinity` makes it persistent. */
|
|
201
|
-
duration?: number;
|
|
202
|
-
/** Screen region placement. */
|
|
203
|
-
position?: ToastPosition;
|
|
204
|
-
/** Primary action button. */
|
|
205
|
-
action?: ToastAction;
|
|
206
|
-
/** Secondary cancel button. */
|
|
207
|
-
cancel?: ToastAction;
|
|
208
|
-
/** Show explicit close button. */
|
|
209
|
-
closeButton?: boolean;
|
|
210
|
-
/** Accessible label for the close button. */
|
|
211
|
-
closeButtonLabel?: string;
|
|
212
|
-
/** Enter/exit animation preset. */
|
|
213
|
-
animation?: AnimationType;
|
|
214
|
-
/** Allow user dismissal. */
|
|
215
|
-
dismissible?: boolean;
|
|
216
|
-
/** Dismiss on body click. */
|
|
217
|
-
closeOnClick?: boolean;
|
|
218
|
-
/** Triggers that pause countdown. */
|
|
219
|
-
pauseOn?: PauseOn[];
|
|
220
|
-
/** Enable swipe dismissal. */
|
|
221
|
-
swipe?: boolean;
|
|
222
|
-
/** Directions allowed for swipe. */
|
|
223
|
-
swipeDirections?: SwipeDirection[];
|
|
224
|
-
/** Distance in pixels to trigger swipe dismiss. */
|
|
225
|
-
dragThreshold?: number;
|
|
226
|
-
/** Rich, saturated type backgrounds. */
|
|
227
|
-
richColors?: boolean;
|
|
228
|
-
/** Invert color scheme. */
|
|
229
|
-
invert?: boolean;
|
|
230
|
-
/** Theme preset override. */
|
|
231
|
-
theme?: ThemeName;
|
|
232
|
-
/** Additional CSS class. */
|
|
233
|
-
className?: string;
|
|
234
|
-
/** Granular slot CSS classes. */
|
|
235
|
-
classNames?: ToastClassNames;
|
|
236
|
-
/** Inline style overrides. */
|
|
237
|
-
style?: Record<string, string | number>;
|
|
238
|
-
/** Unstyled mode removing theme styles. */
|
|
239
|
-
unstyled?: boolean;
|
|
240
|
-
/** Sanitized HTML string for description. */
|
|
241
|
-
html?: string;
|
|
242
|
-
/** Hyperlink URL. */
|
|
243
|
-
href?: string;
|
|
244
|
-
/** Hyperlink target. */
|
|
245
|
-
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
246
|
-
/** ARIA live level. */
|
|
247
|
-
ariaLive?: 'polite' | 'assertive' | 'off';
|
|
248
|
-
/** ARIA role. */
|
|
249
|
-
role?: 'status' | 'alert' | 'log';
|
|
250
|
-
/** Deduplication: boolean or custom string key. */
|
|
251
|
-
dedupe?: boolean | string;
|
|
252
|
-
/** High priority toast: bypasses maxVisible queue limit and uses assertive live region. */
|
|
253
|
-
important?: boolean;
|
|
254
|
-
/** Lifecycle hook: fired when toast mounts/opens. Exactly once. */
|
|
255
|
-
onOpen?: (toast: ToastRecord) => void;
|
|
256
|
-
/** Lifecycle hook: fired when toast closes/exits. Exactly once. */
|
|
257
|
-
onClose?: (toast: ToastRecord, reason: CloseReason) => void;
|
|
258
|
-
/** Lifecycle hook: fired on user dismissal. Exactly once. */
|
|
259
|
-
onDismiss?: (toast: ToastRecord, reason: CloseReason) => void;
|
|
260
|
-
/** Lifecycle hook: fired when auto-close timer elapses. Exactly once. */
|
|
261
|
-
onAutoClose?: (toast: ToastRecord) => void;
|
|
262
|
-
/** Container element id. */
|
|
263
|
-
container?: string;
|
|
264
|
-
/** Text direction. */
|
|
265
|
-
dir?: Direction;
|
|
266
|
-
}
|
|
267
|
-
/** Fields that can be modified on an existing toast. */
|
|
268
|
-
type ToastPatch = Omit<ToastOptions, 'id'> & {
|
|
269
|
-
/** Resets the timer countdown after patching. Defaults to true. */
|
|
270
|
-
resetTimer?: boolean;
|
|
271
|
-
};
|
|
272
|
-
/** Immutable snapshot record of an active toast. */
|
|
273
|
-
interface ToastRecord extends ToastOptions {
|
|
274
|
-
id: ToastId;
|
|
275
|
-
type: ToastType;
|
|
276
|
-
duration: number;
|
|
277
|
-
position: ToastPosition;
|
|
278
|
-
ariaLive: 'polite' | 'assertive' | 'off';
|
|
279
|
-
role: 'status' | 'alert' | 'log';
|
|
280
|
-
createdAt: number;
|
|
281
|
-
updatedAt: number;
|
|
282
|
-
revision: number;
|
|
283
|
-
timerEpoch: number;
|
|
284
|
-
count: number;
|
|
285
|
-
visible: boolean;
|
|
286
|
-
dismissed: boolean;
|
|
287
|
-
pausedBy: string[];
|
|
288
|
-
remaining: number;
|
|
289
|
-
custom?: ToastCustomRenderer;
|
|
290
|
-
}
|
|
291
|
-
/** Definition for registering a custom toast type. */
|
|
292
|
-
interface ToastTypeDefinition {
|
|
293
|
-
defaults?: ToastOptions;
|
|
294
|
-
icon?: Renderable;
|
|
295
|
-
color?: string;
|
|
296
|
-
duration?: number;
|
|
297
|
-
ariaLive?: 'polite' | 'assertive' | 'off';
|
|
298
|
-
}
|
|
299
|
-
/** Global configuration for toasts and dialogs. */
|
|
300
|
-
interface GlazeConfig {
|
|
301
|
-
theme: ThemeName;
|
|
302
|
-
mode: ColorMode;
|
|
303
|
-
position: ToastPosition;
|
|
304
|
-
duration: number;
|
|
305
|
-
maxVisible: number;
|
|
306
|
-
gap: number;
|
|
307
|
-
stack: StackMode;
|
|
308
|
-
dir: Direction;
|
|
309
|
-
hotkey: string;
|
|
310
|
-
pauseOn: PauseOn[];
|
|
311
|
-
container: string | undefined;
|
|
312
|
-
shadow: boolean;
|
|
313
|
-
closeButton: boolean;
|
|
314
|
-
richColors: boolean;
|
|
315
|
-
invert: boolean;
|
|
316
|
-
swipe: boolean;
|
|
317
|
-
dragThreshold: number;
|
|
318
|
-
progress: boolean;
|
|
319
|
-
closeOnClick: boolean;
|
|
320
|
-
exitDuration: number;
|
|
321
|
-
historyLimit: number;
|
|
322
|
-
regionLabel: string;
|
|
323
|
-
closeLabel: string;
|
|
324
|
-
startPaused: boolean;
|
|
325
|
-
newestOnTop: boolean;
|
|
326
|
-
dedupeWindow: number;
|
|
327
|
-
animation?: AnimationType;
|
|
328
|
-
offset?: OffsetConfig;
|
|
329
|
-
mobileOffset?: number | string;
|
|
330
|
-
}
|
|
331
|
-
type Config = GlazeConfig;
|
|
332
|
-
type GlazeConfigPatch = Partial<GlazeConfig>;
|
|
333
|
-
/** Outcome delivered to promise descriptions. */
|
|
334
|
-
type PromiseOutcome<T> = {
|
|
335
|
-
status: 'success';
|
|
336
|
-
value: T;
|
|
337
|
-
} | {
|
|
338
|
-
status: 'error';
|
|
339
|
-
error: unknown;
|
|
340
|
-
};
|
|
341
|
-
/** Message or patch for a promise state phase. */
|
|
342
|
-
type PromiseMessage<V> = string | ToastPatch | ((value: V) => string | ToastPatch);
|
|
343
|
-
/** Options given to `ui.toast.promise`. */
|
|
344
|
-
interface PromiseMessages<T> {
|
|
345
|
-
loading: string | ToastPatch;
|
|
346
|
-
success?: PromiseMessage<T>;
|
|
347
|
-
error?: PromiseMessage<unknown>;
|
|
348
|
-
description?: string | ((outcome: PromiseOutcome<T>) => string);
|
|
349
|
-
finally?: () => void | Promise<void>;
|
|
350
|
-
}
|
|
351
|
-
type PromiseData<T> = PromiseMessages<T>;
|
|
352
|
-
/** Return handle from `ui.toast.promise`. */
|
|
353
|
-
interface PromiseHandle<T> {
|
|
354
|
-
id: ToastId;
|
|
355
|
-
unwrap(): Promise<T>;
|
|
356
|
-
}
|
|
357
|
-
/** Input kinds supported by dialog prompts. */
|
|
358
|
-
type DialogInputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | 'textarea' | 'select' | 'radio' | 'checkbox' | 'range' | 'date' | 'time' | 'datetime-local' | 'week' | 'month' | 'file' | 'otp';
|
|
359
|
-
/** Icon preset for dialogs. */
|
|
360
|
-
type DialogIcon = 'success' | 'error' | 'warning' | 'info' | 'question' | 'custom' | (string & {});
|
|
361
|
-
/** Tone preset for dialogs. */
|
|
362
|
-
type DialogTone = 'info' | 'warning' | 'danger';
|
|
363
|
-
/** Backdrop visual style. */
|
|
364
|
-
type DialogBackdrop = 'blur' | 'dim' | 'none' | (string & {});
|
|
365
|
-
/** Reason why a dialog was dismissed without confirm/deny. */
|
|
366
|
-
type DismissReason = 'cancel' | 'backdrop' | 'close' | 'esc' | 'timer';
|
|
367
|
-
/** Result resolved by a dialog promise. */
|
|
368
|
-
interface DialogResult<V = unknown> {
|
|
369
|
-
isConfirmed: boolean;
|
|
370
|
-
isDenied: boolean;
|
|
371
|
-
isDismissed: boolean;
|
|
372
|
-
value: V | undefined;
|
|
373
|
-
dismiss: DismissReason | undefined;
|
|
374
|
-
}
|
|
375
|
-
/** Choice item for select or radio inputs. */
|
|
376
|
-
interface DialogChoice {
|
|
377
|
-
value: string;
|
|
378
|
-
label: string;
|
|
379
|
-
disabled?: boolean;
|
|
380
|
-
}
|
|
381
|
-
/** Configuration of a dialog action button. */
|
|
382
|
-
interface DialogButton {
|
|
383
|
-
show?: boolean;
|
|
384
|
-
label?: string;
|
|
385
|
-
color?: string;
|
|
386
|
-
aria?: string;
|
|
387
|
-
}
|
|
388
|
-
/** Imperative handle over an open dialog. */
|
|
389
|
-
interface DialogHandle<T = unknown> {
|
|
390
|
-
close(result?: Partial<DialogResult<T>>): void;
|
|
391
|
-
update(patch: Partial<DialogOptions>): void;
|
|
392
|
-
setLoading(loading: boolean | 'confirm' | 'deny'): void;
|
|
393
|
-
showError(message: string | undefined | null): void;
|
|
394
|
-
timer: {
|
|
395
|
-
pause(): void;
|
|
396
|
-
resume(): void;
|
|
397
|
-
add(ms: number): void;
|
|
398
|
-
remaining(): number;
|
|
399
|
-
paused(): boolean;
|
|
400
|
-
};
|
|
401
|
-
readonly result: Promise<DialogResult<T>>;
|
|
402
|
-
}
|
|
403
|
-
type ValidateResult = string | undefined | null;
|
|
404
|
-
/** Options for dialogs (confirm, alert, prompt, steps). */
|
|
405
|
-
interface DialogOptions {
|
|
406
|
-
/** Theme-declared variant preset. */
|
|
407
|
-
variant?: DialogVariant;
|
|
408
|
-
/** Button layout direction or hairline division. */
|
|
409
|
-
buttonLayout?: 'row' | 'stack' | 'divided';
|
|
410
|
-
/** Expected text for type-to-confirm validation. */
|
|
411
|
-
confirmText?: string;
|
|
412
|
-
/** Whether type-to-confirm matching is case sensitive. */
|
|
413
|
-
caseSensitive?: boolean;
|
|
414
|
-
/** Inline callout notice box. */
|
|
415
|
-
notice?: {
|
|
416
|
-
icon?: Renderable;
|
|
417
|
-
text: string;
|
|
418
|
-
tone?: 'info' | 'warning' | 'danger';
|
|
419
|
-
};
|
|
420
|
-
/** OTP length in digits (defaults to 6). */
|
|
421
|
-
otpLength?: number;
|
|
422
|
-
/** OTP input kind. Defaults to 'numeric'. */
|
|
423
|
-
otpType?: 'numeric' | 'alphanumeric';
|
|
424
|
-
/** Callback fired when all OTP digits are filled. */
|
|
425
|
-
onOtpComplete?: (code: string) => void;
|
|
426
|
-
/** Live countdown in seconds or boolean. */
|
|
427
|
-
countdown?: number | boolean;
|
|
428
|
-
/** Resend cooldown in seconds. */
|
|
429
|
-
resendCooldown?: number;
|
|
430
|
-
/** Callback when user clicks resend code. */
|
|
431
|
-
onResend?: () => void;
|
|
432
|
-
title?: string;
|
|
433
|
-
text?: string;
|
|
434
|
-
html?: string;
|
|
435
|
-
icon?: DialogIcon;
|
|
436
|
-
iconContent?: Renderable;
|
|
437
|
-
tone?: DialogTone;
|
|
438
|
-
confirmButton?: DialogButton;
|
|
439
|
-
denyButton?: DialogButton;
|
|
440
|
-
cancelButton?: DialogButton;
|
|
441
|
-
reverseButtons?: boolean;
|
|
442
|
-
focusOn?: 'confirm' | 'deny' | 'cancel' | 'input' | 'close' | 'none';
|
|
443
|
-
input?: DialogInputType;
|
|
444
|
-
inputValue?: string | number | boolean;
|
|
445
|
-
placeholder?: string;
|
|
446
|
-
options?: readonly DialogChoice[] | readonly string[] | Readonly<Record<string, string>>;
|
|
447
|
-
inputLabel?: string;
|
|
448
|
-
inputAttributes?: Readonly<Record<string, string>>;
|
|
449
|
-
validate?: (value: unknown, handle: DialogHandle) => ValidateResult | Promise<ValidateResult>;
|
|
450
|
-
preConfirm?: (value: unknown, handle: DialogHandle) => unknown | Promise<unknown>;
|
|
451
|
-
preDeny?: (value: unknown, handle: DialogHandle) => unknown | Promise<unknown>;
|
|
452
|
-
allowOutsideClick?: boolean;
|
|
453
|
-
allowEscape?: boolean;
|
|
454
|
-
backdrop?: DialogBackdrop;
|
|
455
|
-
position?: DialogPosition;
|
|
456
|
-
grow?: 'row' | 'column' | 'fullscreen';
|
|
457
|
-
draggable?: boolean;
|
|
458
|
-
width?: string | number;
|
|
459
|
-
padding?: string | number;
|
|
460
|
-
footer?: string;
|
|
461
|
-
image?: {
|
|
462
|
-
src: string;
|
|
463
|
-
alt: string;
|
|
464
|
-
width?: number;
|
|
465
|
-
height?: number;
|
|
466
|
-
};
|
|
467
|
-
timer?: number;
|
|
468
|
-
timerProgressBar?: boolean;
|
|
469
|
-
closeButtonLabel?: string;
|
|
470
|
-
className?: string;
|
|
471
|
-
theme?: ThemeName;
|
|
472
|
-
priority?: number;
|
|
473
|
-
didOpen?: (handle: DialogHandle) => void;
|
|
474
|
-
willClose?: (handle: DialogHandle, result: DialogResult) => void;
|
|
475
|
-
}
|
|
476
|
-
/** Discriminated union mapping input types to typed values. */
|
|
477
|
-
type TypedDialogOptions<T = unknown> = (Omit<DialogOptions, 'input' | 'inputValue' | 'validate' | 'preConfirm'> & {
|
|
478
|
-
input?: undefined;
|
|
479
|
-
inputValue?: undefined;
|
|
480
|
-
validate?: (value: undefined, handle: DialogHandle<undefined>) => ValidateResult | Promise<ValidateResult>;
|
|
481
|
-
preConfirm?: (value: undefined, handle: DialogHandle<undefined>) => T | Promise<T>;
|
|
482
|
-
}) | (Omit<DialogOptions, 'input' | 'inputValue' | 'validate' | 'preConfirm'> & {
|
|
483
|
-
input: 'number' | 'range';
|
|
484
|
-
inputValue?: number;
|
|
485
|
-
validate?: (value: number, handle: DialogHandle<number>) => ValidateResult | Promise<ValidateResult>;
|
|
486
|
-
preConfirm?: (value: number, handle: DialogHandle<number>) => T | Promise<T>;
|
|
487
|
-
}) | (Omit<DialogOptions, 'input' | 'inputValue' | 'validate' | 'preConfirm'> & {
|
|
488
|
-
input: 'checkbox';
|
|
489
|
-
inputValue?: boolean;
|
|
490
|
-
validate?: (value: boolean, handle: DialogHandle<boolean>) => ValidateResult | Promise<ValidateResult>;
|
|
491
|
-
preConfirm?: (value: boolean, handle: DialogHandle<boolean>) => T | Promise<T>;
|
|
492
|
-
}) | (Omit<DialogOptions, 'input' | 'inputValue' | 'validate' | 'preConfirm'> & {
|
|
493
|
-
input: 'text' | 'email' | 'password' | 'tel' | 'url' | 'search' | 'textarea' | 'select' | 'radio' | 'date' | 'time' | 'datetime-local' | 'week' | 'month' | 'file' | 'otp';
|
|
494
|
-
inputValue?: string;
|
|
495
|
-
validate?: (value: string, handle: DialogHandle<string>) => ValidateResult | Promise<ValidateResult>;
|
|
496
|
-
preConfirm?: (value: string, handle: DialogHandle<string>) => T | Promise<T>;
|
|
497
|
-
});
|
|
498
|
-
/** State of an active dialog. */
|
|
499
|
-
interface DialogState {
|
|
500
|
-
options: DialogOptions;
|
|
501
|
-
loading: 'confirm' | 'deny' | null;
|
|
502
|
-
error: string | undefined;
|
|
503
|
-
open: boolean;
|
|
504
|
-
revision: number;
|
|
505
|
-
}
|
|
506
|
-
/** Visual style of an action sheet entry. */
|
|
507
|
-
type SheetActionStyle = 'default' | 'destructive' | 'cancel';
|
|
508
|
-
/** Action choice in an action sheet. */
|
|
509
|
-
interface SheetAction {
|
|
510
|
-
label: string;
|
|
511
|
-
value?: unknown;
|
|
512
|
-
style?: SheetActionStyle;
|
|
513
|
-
tone?: DialogTone;
|
|
514
|
-
icon?: string;
|
|
515
|
-
disabled?: boolean;
|
|
516
|
-
description?: string;
|
|
517
|
-
}
|
|
518
|
-
/** Options for action sheet modal. */
|
|
519
|
-
interface SheetOptions {
|
|
520
|
-
title?: string;
|
|
521
|
-
text?: string;
|
|
522
|
-
message?: string;
|
|
523
|
-
html?: string;
|
|
524
|
-
actions: readonly SheetAction[];
|
|
525
|
-
cancel?: {
|
|
526
|
-
label: string;
|
|
527
|
-
} | false;
|
|
528
|
-
cancelLabel?: string;
|
|
529
|
-
backdrop?: DialogBackdrop;
|
|
530
|
-
allowOutsideClick?: boolean;
|
|
531
|
-
allowEscape?: boolean;
|
|
532
|
-
className?: string;
|
|
533
|
-
theme?: ThemeName;
|
|
534
|
-
}
|
|
535
|
-
/** Options for bottom sheet modal. */
|
|
536
|
-
interface BottomSheetOptions {
|
|
537
|
-
title?: string;
|
|
538
|
-
text?: string;
|
|
539
|
-
html?: string;
|
|
540
|
-
icon?: DialogIcon | string;
|
|
541
|
-
iconContent?: Renderable;
|
|
542
|
-
tone?: DialogTone;
|
|
543
|
-
confirmButton?: DialogButton;
|
|
544
|
-
cancelButton?: DialogButton;
|
|
545
|
-
variant?: DialogVariant;
|
|
546
|
-
snapPoints?: readonly number[];
|
|
547
|
-
initialSnap?: number;
|
|
548
|
-
dismissible?: boolean;
|
|
549
|
-
handle?: boolean;
|
|
550
|
-
backdrop?: DialogBackdrop;
|
|
551
|
-
allowOutsideClick?: boolean;
|
|
552
|
-
allowEscape?: boolean;
|
|
553
|
-
closeButtonLabel?: string;
|
|
554
|
-
handleLabel?: string;
|
|
555
|
-
className?: string;
|
|
556
|
-
theme?: ThemeName;
|
|
557
|
-
didOpen?: (handle: BottomSheetHandle) => void;
|
|
558
|
-
willClose?: (handle: BottomSheetHandle) => void;
|
|
559
|
-
}
|
|
560
|
-
interface BottomSheetHandle {
|
|
561
|
-
close(reason?: DismissReason): void;
|
|
562
|
-
snapTo(index: number): void;
|
|
563
|
-
update(patch: Pick<BottomSheetOptions, 'title' | 'text' | 'html'>): void;
|
|
564
|
-
readonly body: Renderable;
|
|
565
|
-
readonly result: Promise<DialogResult>;
|
|
566
|
-
}
|
|
567
|
-
/** Options for loading overlay. */
|
|
568
|
-
interface LoadingOptions {
|
|
569
|
-
text?: string;
|
|
570
|
-
title?: string;
|
|
571
|
-
progress?: number;
|
|
572
|
-
backdrop?: DialogBackdrop;
|
|
573
|
-
allowEscape?: boolean;
|
|
574
|
-
className?: string;
|
|
575
|
-
theme?: ThemeName;
|
|
576
|
-
}
|
|
577
|
-
interface LoadingHandle {
|
|
578
|
-
update(patch: Pick<LoadingOptions, 'text' | 'progress'>): void;
|
|
579
|
-
close(): void;
|
|
580
|
-
readonly closed: Promise<void>;
|
|
581
|
-
}
|
|
582
|
-
/** Unsubscribe function. */
|
|
583
|
-
type Unsubscribe = () => void;
|
|
584
|
-
/** Listener callback. */
|
|
585
|
-
type Listener<T = void> = (state: T) => void;
|
|
586
|
-
/** Observable store interface matching React useSyncExternalStore and Svelte store contracts. */
|
|
587
|
-
interface Store<T> {
|
|
588
|
-
subscribe(listener: ((state: T) => void) | (() => void)): Unsubscribe;
|
|
589
|
-
getSnapshot(): T;
|
|
590
|
-
setState(updater: T | ((prev: T) => T), immediate?: boolean): void;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
/** Library default configuration. */
|
|
594
|
-
declare const DEFAULT_CONFIG: Readonly<GlazeConfig>;
|
|
595
|
-
/** Observable configuration container holding immutable snapshots. */
|
|
596
|
-
interface ConfigStore {
|
|
597
|
-
/** Returns the current immutable configuration snapshot. */
|
|
598
|
-
get(): Readonly<GlazeConfig>;
|
|
599
|
-
/** Merges a partial configuration and notifies subscribers. Returns the updated snapshot. */
|
|
600
|
-
set(patch: Partial<GlazeConfig>): Readonly<GlazeConfig>;
|
|
601
|
-
/** Restores library defaults. */
|
|
602
|
-
reset(): void;
|
|
603
|
-
/** Subscribes to configuration changes. */
|
|
604
|
-
subscribe(listener: Listener): Unsubscribe;
|
|
605
|
-
}
|
|
606
|
-
/**
|
|
607
|
-
* Resolves an option according to precedence:
|
|
608
|
-
* Call option > Theme default > Global config > Library default.
|
|
609
|
-
*/
|
|
610
|
-
declare const resolvePrecedence: <T>(callVal: T | undefined, themeVal: T | undefined, globalVal: T | undefined, defaultVal: T) => T;
|
|
611
|
-
/** Creates an isolated, immutable configuration store. */
|
|
612
|
-
declare function createConfigStore(initial?: Partial<GlazeConfig>): ConfigStore;
|
|
613
|
-
|
|
614
|
-
/** Registry of custom and built-in toast types. */
|
|
615
|
-
interface TypeRegistry {
|
|
616
|
-
/**
|
|
617
|
-
* Registers or replaces a toast type.
|
|
618
|
-
* @param name Non-empty type name.
|
|
619
|
-
* @param definition Defaults, icon, color tokens, default duration, ariaLive.
|
|
620
|
-
*/
|
|
621
|
-
add(name: string, definition?: ToastTypeDefinition): void;
|
|
622
|
-
/** Removes a type. Returns whether it existed. */
|
|
623
|
-
remove(name: string): boolean;
|
|
624
|
-
/** Looks a type up. */
|
|
625
|
-
get(name: string): ToastTypeDefinition | undefined;
|
|
626
|
-
/** Lists registered custom type names. */
|
|
627
|
-
list(): string[];
|
|
628
|
-
}
|
|
629
|
-
/** Creates a type registry. */
|
|
630
|
-
declare function createTypeRegistry(): TypeRegistry;
|
|
631
|
-
|
|
632
|
-
/** Pause reason used by `startPaused`. */
|
|
633
|
-
declare const MANUAL_PAUSE = "manual";
|
|
634
|
-
/** Options for creating a toast manager / store. */
|
|
635
|
-
interface ToastManagerOptions {
|
|
636
|
-
config?: ConfigStore;
|
|
637
|
-
clock?: Clock;
|
|
638
|
-
now?: () => number;
|
|
639
|
-
types?: TypeRegistry;
|
|
640
|
-
}
|
|
641
|
-
/** Input for adding a toast. */
|
|
642
|
-
interface AddToastInput extends ToastOptions {
|
|
643
|
-
custom?: ToastCustomRenderer;
|
|
644
|
-
}
|
|
645
|
-
/** State container for toasts. Pure logic: no DOM, no framework. */
|
|
646
|
-
interface ToastManager {
|
|
647
|
-
add(input: AddToastInput): ToastId;
|
|
648
|
-
update(id: ToastId, patch: ToastPatch): boolean;
|
|
649
|
-
dismiss(id?: ToastId, reason?: CloseReason): void;
|
|
650
|
-
dismissAll(reason?: CloseReason): void;
|
|
651
|
-
pause(id: ToastId | undefined, reason: string): void;
|
|
652
|
-
resume(id: ToastId | undefined, reason: string): void;
|
|
653
|
-
extend(id: ToastId, ms: number): void;
|
|
654
|
-
getRemaining(id: ToastId): number;
|
|
655
|
-
getToasts(): readonly ToastRecord[];
|
|
656
|
-
getHistory(): readonly ToastRecord[];
|
|
657
|
-
clear(): void;
|
|
658
|
-
clearHistory(): void;
|
|
659
|
-
subscribe(listener: Listener): Unsubscribe;
|
|
660
|
-
readonly config: ConfigStore;
|
|
661
|
-
readonly types: TypeRegistry;
|
|
662
|
-
}
|
|
663
|
-
type ToastStore = ToastManager;
|
|
664
|
-
declare function createToastManager(options?: ToastManagerOptions): ToastManager;
|
|
665
|
-
declare const createToastStore: typeof createToastManager;
|
|
666
|
-
|
|
667
|
-
/** Callable toast function shape shared by all entry points. */
|
|
668
|
-
type ToastFn = (message?: Renderable, options?: ToastOptions) => ToastId;
|
|
669
|
-
/** The `ui.toast` API. */
|
|
670
|
-
interface ToastApi extends ToastFn {
|
|
671
|
-
/** Success toast. */
|
|
672
|
-
success: ToastFn;
|
|
673
|
-
/** Error toast. Uses an assertive live region. */
|
|
674
|
-
error: ToastFn;
|
|
675
|
-
/** Informational toast. */
|
|
676
|
-
info: ToastFn;
|
|
677
|
-
/** Warning toast. */
|
|
678
|
-
warning: ToastFn;
|
|
679
|
-
/** Loading toast with indefinite duration. */
|
|
680
|
-
loading: ToastFn;
|
|
681
|
-
/** Neutral message toast. */
|
|
682
|
-
message: ToastFn;
|
|
683
|
-
/** Custom renderer. */
|
|
684
|
-
custom: (renderer: ToastCustomRenderer, options?: ToastOptions) => ToastId;
|
|
685
|
-
/** Updates an existing toast. */
|
|
686
|
-
update: (id: ToastId, patch: ToastPatch) => boolean;
|
|
687
|
-
/** Dismisses one toast, or all when id is omitted. */
|
|
688
|
-
dismiss: (id?: ToastId) => void;
|
|
689
|
-
/** Dismisses every toast in every region. */
|
|
690
|
-
dismissAll: () => void;
|
|
691
|
-
/** Tracks a promise with loading, success and error states. */
|
|
692
|
-
promise: <T>(input: Promise<T> | (() => Promise<T>), messages: PromiseMessages<T>, options?: ToastOptions) => PromiseHandle<T>;
|
|
693
|
-
/** Returns a snapshot of active and queued toasts. */
|
|
694
|
-
getToasts: () => readonly ToastRecord[];
|
|
695
|
-
/** Returns closed toasts up to `config.historyLimit`. */
|
|
696
|
-
getHistory: () => readonly ToastRecord[];
|
|
697
|
-
/** Registry of custom toast types. */
|
|
698
|
-
readonly types: TypeRegistry;
|
|
699
|
-
}
|
|
700
|
-
/** Builds the `ui.toast` API on top of a store/manager. */
|
|
701
|
-
declare function createToastApi(store: ToastStore): ToastApi;
|
|
702
|
-
|
|
703
|
-
export { DEFAULT_CONFIG as D, MANUAL_PAUSE as M, createConfigStore as ao, createToastApi as ap, createToastManager as aq, createToastStore as ar, createTypeRegistry as as, defaultClock as at, resolvePrecedence as au };
|
|
704
|
-
export type { Store as $, AddToastInput as A, BottomSheetHandle as B, Clock as C, EssentialsToastVariant as E, LoadingHandle as F, GlazeConfig as G, LoadingOptions as H, IosGlassToastVariant as I, Mode as J, Position as K, Listener as L, PromiseData as N, OffsetConfig as O, PauseOn as P, PromiseHandle as Q, PromiseMessage as R, PromiseMessages as S, ToastApi as T, PromiseOutcome as U, Renderable as V, SheetAction as W, SheetActionStyle as X, SheetOptions as Y, ShowcaseToastVariant as Z, StackMode as _, ToastRecord as a, SwipeDirection as a0, ThemeName as a1, ToastAction as a2, ToastActionItem as a3, ToastAvatarOption as a4, ToastButton as a5, ToastClassNames as a6, ToastCustomRenderer as a7, ToastFn as a8, ToastId as a9, ToastManager as aa, ToastManagerOptions as ab, ToastOptions as ac, ToastPatch as ad, ToastPosition as ae, ToastRenderContext as af, ToastToggleOption as ag, ToastType as ah, ToastTypeDefinition as ai, ToastVariant as aj, TypeRegistry as ak, TypedDialogOptions as al, Unsubscribe as am, ValidateResult as an, ToastStore as b, AnimationType as c, BottomSheetOptions as d, BuiltInToastType as e, CloseReason as f, ColorMode as g, Config as h, ConfigStore as i, DialogBackdrop as j, DialogButton as k, DialogChoice as l, DialogColumn as m, DialogHandle as n, DialogIcon as o, DialogInputType as p, DialogOptions as q, DialogPosition as r, DialogResult as s, DialogRow as t, DialogState as u, DialogTone as v, DialogVariant as w, Direction as x, DismissReason as y, GlazeConfigPatch as z };
|