release: v0.2.1 — bug修复、代码去重、功能增强、覆盖率88.57%

This commit is contained in:
2026-07-25 13:01:59 +08:00
parent cca2675fb4
commit bc1128bd1f
23 changed files with 1703 additions and 320 deletions
+5 -1
View File
@@ -1,7 +1,7 @@
/**
* MetonaToast — 核心类型定义
* @module types
* @version 0.2.0
* @version 0.2.1
*/
// ========== 基础类型 ==========
@@ -83,6 +83,7 @@ export interface ToastConfig {
className?: string;
style?: Record<string, string>;
onShow?: ((toast: ToastInstance) => void) | null;
onBeforeShow?: ((toast: ToastInstance) => boolean | void) | null;
onClose?: ((toast: ToastInstance) => void) | null;
onClick?: ((toast: ToastInstance) => void) | null;
onUpdate?: ((toast: ToastInstance) => void) | null;
@@ -135,6 +136,8 @@ export interface ToastInstance {
_palette(): { theme: string; c: TypeColor; t: Partial<ThemeConfig> };
create(): this;
update(partial: Partial<ToastOptions>): this;
updatePosition(position: string): this;
remove(): void;
close(immediate?: boolean): void;
_pause(): void;
_resume(): void;
@@ -485,6 +488,7 @@ export interface MeToast {
// Toast 管理
find(id: string): ToastInstance | undefined;
dismiss(id?: string): void;
removeToast(id: string): void;
clear(position?: ToastPosition): void;
getToasts(): ToastInstance[];
count(): number;