gui/pkg/notification/platform.go
Virgil da22bedbc6
Some checks failed
Security Scan / security (push) Failing after 42s
Test / test (push) Failing after 1m31s
refactor(ax): align public APIs with AX principles
2026-03-31 05:13:43 +00:00

32 lines
933 B
Go

// pkg/notification/platform.go
package notification
// Platform abstracts the native notification backend.
type Platform interface {
Send(options NotificationOptions) error
RequestPermission() (bool, error)
CheckPermission() (bool, error)
}
// NotificationSeverity indicates the severity for dialog fallback.
type NotificationSeverity int
const (
SeverityInfo NotificationSeverity = iota
SeverityWarning
SeverityError
)
// NotificationOptions contains options for sending a notification.
type NotificationOptions struct {
ID string `json:"id,omitempty"`
Title string `json:"title"`
Message string `json:"message"`
Subtitle string `json:"subtitle,omitempty"`
Severity NotificationSeverity `json:"severity,omitempty"`
}
// PermissionStatus indicates whether notifications are authorised.
type PermissionStatus struct {
Granted bool `json:"granted"`
}