Skip to content

Latest commit

 

History

History
77 lines (47 loc) · 1.48 KB

File metadata and controls

77 lines (47 loc) · 1.48 KB

alarms

Documentation: Chrome Alarms API

A promise-based wrapper for the Chrome alarms API.

Methods

Events

clearAlarm

clearAlarm(name: string): Promise<boolean>

Clears the alarm with the specified name, returning true if an existing alarm was found and cleared.

clearAllAlarm

clearAllAlarm(): Promise<boolean>

Clears all alarms, returning true if any alarms were found and cleared.

createAlarm

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

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

getAllAlarm(): Promise<chrome.alarms.Alarm[]>

Retrieves all set alarms.

onAlarm

onAlarm(callback: (alarm: chrome.alarms.Alarm) => void): () => void

Adds a listener that triggers when an alarm goes off. Returns an unsubscribe function.