chore(Notification): improve types

This commit is contained in:
Benjamin Canac
2023-05-23 15:24:32 +02:00
parent 6d3309c42d
commit 45ba3b26da
7 changed files with 41 additions and 35 deletions

View File

@@ -1,5 +1,5 @@
export * from './avatar'
export * from './clipboard'
export * from './command-palette'
export * from './notification'
export * from './popper'
export * from './toast'

23
src/runtime/types/notification.d.ts vendored Normal file
View File

@@ -0,0 +1,23 @@
import type { Avatar } from './avatar'
import type { Button } from './button'
import appConfig from '#build/app.config'
export interface NotificationAction extends Partial<Button> {
click: Function
}
export interface Notification {
id: string
title: string
description: string
icon?: string
avatar?: Partial<Avatar>
close?: Partial<Button>
timeout: number
actions?: NotificationAction[]
click?: Function
callback?: Function
progressColor?: string
progressVariant?: string
ui?: Partial<typeof appConfig.ui.notification>
}

View File

@@ -1,17 +0,0 @@
import type { Button } from './button'
export interface ToastNotificationAction extends Partial<Button> {
click: Function
}
export interface ToastNotification {
id: string
title: string
description: string
type: string
icon?: string
timeout: number
actions?: ToastNotificationAction[]
click?: Function
callback?: Function
}