hammerspoon2-docs
    Preparing search index...

    Interface HSNotificationOptions

    The options for hs.notify.create()

    interface HSNotificationOptions {
        actions?: HSNotificationAction[];
        badge?: number;
        body?: string;
        callback?: (response: HSNotificationResponse) => void;
        interruptionLevel?: "passive" | "active" | "timeSensitive";
        sound?: string | boolean;
        subtitle?: string;
        threadIdentifier?: string;
        title: string;
        trigger?:
            | { interval: number; type: "timeInterval" }
            | {
                date?: Date;
                day?: number;
                hour?: number;
                minute?: number;
                month?: number;
                second?: number;
                type: "calendar";
                weekday?: number;
                year?: number;
            };
        userInfo?: Record<string, any>;
    }
    Index

    Action buttons

    badge?: number

    Value to show on the app icon badge

    body?: string

    The main message body

    callback?: (response: HSNotificationResponse) => void

    Invoked when the user interacts with the notification

    interruptionLevel?: "passive" | "active" | "timeSensitive"

    Controls Focus/DND behaviour. Defaults to "active"

    sound?: string | boolean

    true (the default) for the default sound, false for none, or the name of an .aiff file

    subtitle?: string

    A second line shown beneath the title

    threadIdentifier?: string

    Groups related notifications visually in Notification Center

    title: string

    The bold heading line

    trigger?:
        | { interval: number; type: "timeInterval" }
        | {
            date?: Date;
            day?: number;
            hour?: number;
            minute?: number;
            month?: number;
            second?: number;
            type: "calendar";
            weekday?: number;
            year?: number;
        }

    When to deliver the notification (see the module documentation). Omit for immediate delivery

    userInfo?: Record<string, any>

    Arbitrary payload passed back to the callback