scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
54 lines (51 loc) • 2.05 kB
TypeScript
import { AbsNotification } from 'scriptable-abstract';
import { NotificationMockState, NotificationSound } from '../../types/notification.js';
/**
* Mock implementation of Scriptable's Notification.
* Provides functionality for managing notifications.
* @implements Notification
*/
declare class MockNotification extends AbsNotification<NotificationMockState> {
private static schedules;
private static lastDelivered;
constructor();
get asNotification(): Notification;
get identifier(): string;
get title(): string;
set title(value: string);
get body(): string;
set body(value: string);
get subtitle(): string;
set subtitle(value: string);
get threadIdentifier(): string;
set threadIdentifier(value: string);
get preferredContentHeight(): number;
set preferredContentHeight(value: number);
get badge(): number;
set badge(value: number);
get userInfo(): Record<string, unknown>;
set userInfo(value: Record<string, unknown>);
get sound(): NotificationSound;
set sound(value: NotificationSound);
get openURL(): string;
set openURL(value: string);
get deliveryDate(): Date;
get nextTriggerDate(): Date;
get scriptName(): string;
set scriptName(value: string);
get actions(): Notification.Actions;
setTriggerDate(date: Date): void;
setDailyTrigger(hour: number, minute: number, _repeats?: boolean): void;
setWeeklyTrigger(weekday: number, hour: number, minute: number, _repeats?: boolean): void;
addAction(title: string, url: string): void;
remove(): Promise<void>;
schedule(): Promise<void>;
static allPending(): Promise<Notification[]>;
static removePending(): Promise<void>;
static removePendingNotification(identifier: string): Promise<void>;
static getLastDelivered(): Notification | null;
static reset(): void;
scheduleNotification(date: Date, _repeats?: boolean): Promise<void>;
scheduleNotificationAt(date: Date, _repeats?: boolean): Promise<void>;
}
export { MockNotification };