@@ -9,12 +9,14 @@ export type Tab =
99export const COLOR_MODELS = [ 'rgb' , 'hsl' , 'oklch' ] as const ;
1010export type ColorModel = ( typeof COLOR_MODELS ) [ number ] ;
1111
12+ export type ToastAction = { label : string ; run : ( ) => void } ;
13+
1214// --- Reactive state ---
1315let activeTab = $state < Tab > ( 'editor' ) ;
1416let sidebarVisible = $state < boolean > ( true ) ;
1517let toastMessage = $state < string > ( '' ) ;
1618let toastVisible = $state < boolean > ( false ) ;
17- let toastAction = $state < { label : string ; run : ( ) => void } | null > ( null ) ;
19+ let toastAction = $state < ToastAction | null > ( null ) ;
1820let liveApply = $state < boolean > ( readBoolPref ( 'aether-live-apply' , false ) ) ;
1921let targetsVisible = $state < boolean > (
2022 readBoolPref ( 'aether-targets-visible' , true )
@@ -96,9 +98,7 @@ export function toggleSidebar(): void {
9698
9799export function showToast (
98100 msg : string ,
99- durationOrOpts :
100- | number
101- | { duration ?: number ; action ?: { label : string ; run : ( ) => void } } = 3000
101+ durationOrOpts : number | { duration ?: number ; action ?: ToastAction } = 3000
102102) : void {
103103 const opts =
104104 typeof durationOrOpts === 'number'
@@ -114,7 +114,7 @@ export function showToast(
114114 } , duration ) ;
115115}
116116
117- export function getToastAction ( ) : { label : string ; run : ( ) => void } | null {
117+ export function getToastAction ( ) : ToastAction | null {
118118 return toastAction ;
119119}
120120
0 commit comments