mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-03-05 13:30:49 -08:00
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import type { NotificationConstructorOptions } from 'electron';
|
|
import { ProxyPropertyType } from '@/helpers/electron-ipc-proxy/common';
|
|
import { NotificationChannel } from '@/constants/channels';
|
|
import { BehaviorSubject } from 'rxjs';
|
|
|
|
export interface IPauseNotificationsInfo {
|
|
reason: string;
|
|
tilDate: Date;
|
|
schedule: { from: Date; to: Date };
|
|
}
|
|
|
|
/**
|
|
* Preference and method about notification, to set and pause notification.
|
|
*/
|
|
export interface INotificationService {
|
|
pauseNotificationsInfo$: BehaviorSubject<IPauseNotificationsInfo | undefined>;
|
|
show(options: NotificationConstructorOptions): Promise<void>;
|
|
updatePauseNotificationsInfo(): Promise<void>;
|
|
getPauseNotificationsInfo: () => Promise<IPauseNotificationsInfo | undefined>;
|
|
}
|
|
export const NotificationServiceIPCDescriptor = {
|
|
channel: NotificationChannel.name,
|
|
properties: {
|
|
pauseNotificationsInfo$: ProxyPropertyType.Value$,
|
|
show: ProxyPropertyType.Function,
|
|
updatePauseNotificationsInfo: ProxyPropertyType.Function,
|
|
getPauseNotificationsInfo: ProxyPropertyType.Function,
|
|
},
|
|
};
|