import { NotifyControl, NotificationPriority, NotificationAction } from './types.js'; import { Subscription } from '@napplet/core'; /** * Napplet NAP notify shim entrypoint. * * @module */ /** * Handle notify.* messages from the shell via the central message listener. */ declare function handleNotifyMessage(msg: { type: string; [key: string]: unknown; }): void; /** * Send a notification to the shell. * Returns the shell-assigned notification ID on success. * * @param notification The notification payload (title required, others optional) * @returns The confirmed notification result with notificationId */ declare function send(notification: { title: string; body?: string; icon?: string; actions?: NotificationAction[]; channel?: string; priority?: NotificationPriority; }): Promise<{ notificationId: string; }>; /** * Dismiss a notification by ID. Fire-and-forget. * * @param notificationId The shell-assigned notification ID to dismiss */ declare function dismiss(notificationId: string): void; /** * Set the badge count for this napplet. Fire-and-forget. * Pass `0` to clear the badge. * * @param count The badge count (0 to clear) */ declare function badge(count: number): void; /** * Register a notification channel. Fire-and-forget. * Channels let users control notification categories independently. * * @param channel The channel to register */ declare function registerChannel(channel: { channelId: string; label: string; description?: string; defaultPriority?: NotificationPriority; }): void; /** * Request permission to send notifications. * The shell MAY prompt the user asynchronously. * * @param channel Optional channel to request permission for * @returns Whether permission was granted */ declare function requestPermission(channel?: string): Promise<{ granted: boolean; }>; /** * Listen for action button clicks on notifications. * Returns a Subscription with close() to stop listening. * * @param callback Called with (notificationId, actionId) when an action is clicked * @returns A Subscription with `close()` to unsubscribe */ declare function onAction(callback: (notificationId: string, actionId: string) => void): Subscription; /** * Listen for notification body clicks. * Returns a Subscription with close() to stop listening. * * @param callback Called with (notificationId) when a notification is clicked * @returns A Subscription with `close()` to unsubscribe */ declare function onClicked(callback: (notificationId: string) => void): Subscription; /** * Listen for notification dismissals. * Returns a Subscription with close() to stop listening. * * @param callback Called with (notificationId, reason?) when a notification is dismissed * @returns A Subscription with `close()` to unsubscribe */ declare function onDismissed(callback: (notificationId: string, reason?: string) => void): Subscription; /** * Listen for the shell's notification capability list. * Returns a Subscription with close() to stop listening. * * @param callback Called with the shell's supported notification controls * @returns A Subscription with `close()` to unsubscribe */ declare function onControls(callback: (controls: NotifyControl[]) => void): Subscription; /** * Install the notify shim. Currently a no-op placeholder -- * notifications are sent on demand, not at install time. * * @returns cleanup function that clears all state */ declare function installNotifyShim(): () => void; export { badge, dismiss, handleNotifyMessage, installNotifyShim, onAction, onClicked, onControls, onDismissed, registerChannel, requestPermission, send };