Cross-platform native desktop notification helpers for MoonBit.
let result = @notification.show("Build finished", title=Some("CI"))
ignore(result)///|
test "build a notification value" {
let request = @notification.Notification::new(
"Artifacts uploaded",
title=Some("Release"),
level=@notification.Warning,
)
assert_eq(request.body, "Artifacts uploaded")
}pub(all) struct Notification {
title : String?
body : String
level : NotificationLevel
} derive(Eq, Show)fn ensure_supported() -> Result[Unit, String]fn is_supported() -> Boolfn show_with_window(window_handle : Int64, body : String, title? : String?, level? : NotificationLevel) -> Result[Unit, String]Cross-platform native desktop notification helpers for MoonBit.