Documentation: Chrome Alarms API
A promise-based wrapper for the Chrome alarms API.
clearAlarm(name: string): Promise<boolean>
Clears the alarm with the specified name, returning true if an existing alarm was found and cleared.
clearAllAlarm(): Promise<boolean>
Clears all alarms, returning true if any alarms were found and cleared.
createAlarm(name: string, info: chrome.alarms.AlarmCreateInfo): Promise<void>
Creates a new alarm or updates an existing one with the given name and scheduling options.
getAlarm(name: string): Promise<chrome.alarms.Alarm | undefined>
Retrieves details for the alarm with the specified name, or undefined if it does not exist.
getAllAlarm(): Promise<chrome.alarms.Alarm[]>
Retrieves all set alarms.
onAlarm(callback: (alarm: chrome.alarms.Alarm) => void): () => void
Adds a listener that triggers when an alarm goes off. Returns an unsubscribe function.