Reference
AdanotchKit
The whole global AdanotchKit object; methods, return types and the permissions they need.
Everything is on the global AdanotchKit object; there is nothing to import. The types are in adanotch/adanotch.d.ts in your extension folder.
const { activity, ui, storage, network, island, events, system, battery, clipboard, notify, media, calendar, reminders, secrets, open, render } = AdanotchKit;Registering
Prop
Type
Context
The ctx passed to setup, update, onAction, onSettingsChange and event handlers:
Prop
Type
System
Prop
Type
interface BatteryState {
percentage: number;
isCharging: boolean;
isPluggedIn: boolean;
hasInternalBattery: boolean;
minutesRemaining: number | null; // null while macOS is estimating
devices: { name: string; percentage: number }[]; // Bluetooth devices that report a battery
}Media
Uses what Adanotch's Music module sees; that module must be on.
Prop
Type
interface NowPlaying {
title: string;
artist: string;
album: string;
duration: number; // seconds
elapsed: number; // seconds
isPlaying: boolean;
app: string; // "com.spotify.client"
}Calendar and Reminders
Prop
Type
interface CalendarEvent {
id: string;
title: string;
calendar: string;
start: number; // ms; new Date(start)
end: number;
meetingURL: string | null; // Zoom, Meet, Teams…
attendees: number;
}
interface Reminder {
id: string;
title: string;
list: string;
due: number | null; // ms
isCompleted: boolean;
isOverdue: boolean;
}Clipboard
Prop
Type
Island
Prop
Type
Other
Prop
Type
Error classes
Global; check them with instanceof.
| Class | When |
|---|---|
PermissionError | A permission not asked for or turned off by the user; no macOS access; a domain not allowed |
NetworkError | No connection, DNS, refused connection, a response over 5 MB, too many requests |
TimeoutError | A fetch timed out |
QuotaExceededError | storage.set past 512 KB |