Documentation
    Preparing search index...

    Interface NotifyServiceOptions

    Host hooks required to turn NAP-NOTIFY messages into observable behavior.

    interface NotifyServiceOptions {
        controls?: readonly NotifyControl[];
        destroyWindow?: (windowId: string) => void | Promise<void>;
        dismiss?: (
            windowId: string,
            notificationId: string,
        ) => void | Promise<void>;
        generateId?: () => string;
        onError?: (error: unknown) => void;
        present?: (presentation: NotifyPresentation) => void | Promise<void>;
        registerChannel?: (
            windowId: string,
            channel: NotifyChannelRegisterMessage,
        ) => void | Promise<void>;
        requestPermission?: (
            windowId: string,
            channel?: string,
        ) => boolean | Promise<boolean>;
        setBadge?: (windowId: string, count: number) => void | Promise<void>;
    }
    Index

    Properties

    controls?: readonly NotifyControl[]

    Notification controls implemented by the host backend.

    destroyWindow?: (windowId: string) => void | Promise<void>

    Release host-owned state when the runtime destroys a napplet window.

    dismiss?: (windowId: string, notificationId: string) => void | Promise<void>

    Remove an active notification from host presentation.

    generateId?: () => string

    Generate a shell-assigned notification identifier.

    onError?: (error: unknown) => void

    Observe asynchronous fire-and-forget backend failures.

    present?: (presentation: NotifyPresentation) => void | Promise<void>

    Render or otherwise deliver a notification. Missing backends fail closed.

    registerChannel?: (
        windowId: string,
        channel: NotifyChannelRegisterMessage,
    ) => void | Promise<void>

    Persist a channel registration in host-owned state.

    requestPermission?: (
        windowId: string,
        channel?: string,
    ) => boolean | Promise<boolean>

    Apply policy or prompt the user for notification permission.

    setBadge?: (windowId: string, count: number) => void | Promise<void>

    Display or clear the requesting napplet's badge count.