70 lines
1.6 KiB
TypeScript
70 lines
1.6 KiB
TypeScript
export type ReminderStatus = "pending" | "sent" | "failed" | "snoozed" | "cancelled" | "done";
|
|
export type ReminderPriority = "low" | "normal" | "high";
|
|
export type ProviderType = "local" | "telegram" | "ntfy" | "webhook" | "discord";
|
|
|
|
export interface Reminder {
|
|
id: string;
|
|
title: string;
|
|
body?: string;
|
|
dueAt: string;
|
|
sourceFile?: string;
|
|
sourceLine?: number;
|
|
completed: boolean;
|
|
channels: string[];
|
|
priority: ReminderPriority;
|
|
status: ReminderStatus;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
lastError?: string;
|
|
}
|
|
|
|
export interface NotificationPayload {
|
|
title: string;
|
|
message: string;
|
|
sourceFile?: string;
|
|
sourceLine?: number;
|
|
priority?: ReminderPriority;
|
|
url?: string;
|
|
dueAt: string;
|
|
}
|
|
|
|
export interface NotificationProviderConfig {
|
|
id: string;
|
|
type: ProviderType;
|
|
name: string;
|
|
enabled: boolean;
|
|
config: Record<string, unknown>;
|
|
}
|
|
|
|
export interface PluginSettings {
|
|
defaultChannels: string[];
|
|
scanVaultOnStartup: boolean;
|
|
scanOnFileChange: boolean;
|
|
checkIntervalSeconds: number;
|
|
afterSend: "keep" | "mark-sent" | "mark-done";
|
|
reminderSyntax: string;
|
|
notificationProviders: NotificationProviderConfig[];
|
|
}
|
|
|
|
export interface PluginData {
|
|
settings: PluginSettings;
|
|
reminders: Reminder[];
|
|
}
|
|
|
|
export interface ParsedReminderInput {
|
|
title: string;
|
|
body?: string;
|
|
dueAt: string;
|
|
sourceFile?: string;
|
|
sourceLine?: number;
|
|
channels: string[];
|
|
priority?: ReminderPriority;
|
|
}
|
|
|
|
export interface NotificationProvider {
|
|
id: ProviderType;
|
|
name: string;
|
|
send(payload: NotificationPayload, config: NotificationProviderConfig): Promise<void>;
|
|
test(config: NotificationProviderConfig): Promise<void>;
|
|
}
|