Documentation
On this page

Function · Desktop Services

showNotification

Displays a native desktop notification.

@sharpts/gui · SharpTS 572a2e31be0e

Signature

TypeScript
showNotification(options: DesktopNotificationOptions): Promise<void>

Parameters

NameTypeDescription
optionsDesktopNotificationOptionsNotification title, body, and sound options.

Returns

Promise<void> — A promise completed after the notification request is submitted.

Remarks

Notifications are currently supported only for installed Windows MSIX applications. Headless hosts validate the request without displaying it.

Throws

  • When the title is empty or longer than 256 characters, the message exceeds 4,096 characters, the platform is unsupported, or Windows notification submission fails.

Examples

TypeScript
import { showNotification } from "@sharpts/gui";

await showNotification({
    title: "Export complete",
    message: "preview.png is ready"
});

Source

src/SharpTS.Gui.Sdk/GuiPackage/runtime.ts:1742 at SharpTS revision 572a2e31be0e2a09be0138bc44501b34d6245b51.