UNPKG

2.15 kBTypeScriptView Raw
1/// <reference types="node" />
2
3import NotificationCenter = require("./notifiers/notificationcenter");
4import NotifySend = require("./notifiers/notifysend");
5import WindowsToaster = require("./notifiers/toaster");
6import WindowsBalloon = require("./notifiers/balloon");
7import Growl = require("./notifiers/growl");
8
9declare namespace nodeNotifier {
10 interface NodeNotifier extends NodeJS.EventEmitter {
11 notify(notification?: NotificationCenter.Notification, callback?: NotificationCallback): NotificationCenter;
12 notify(notification?: WindowsToaster.Notification, callback?: NotificationCallback): WindowsToaster;
13 notify(notification?: WindowsBalloon.Notification, callback?: NotificationCallback): WindowsBalloon;
14 notify(notification?: NotifySend.Notification, callback?: NotificationCallback): NotifySend;
15 notify(notification?: Growl.Notification, callback?: NotificationCallback): Growl;
16 notify(notification?: Notification | string, callback?: NotificationCallback): NodeNotifier;
17 NotificationCenter: typeof NotificationCenter;
18 NotifySend: typeof NotifySend;
19 WindowsToaster: typeof WindowsToaster;
20 WindowsBalloon: typeof WindowsBalloon;
21 Growl: typeof Growl;
22 }
23
24 interface Notification {
25 title?: string | undefined;
26 message?: string | undefined;
27 /** Absolute path (not balloons) */
28 icon?: string | undefined;
29 /** Wait with callback until user action is taken on notification */
30 wait?: boolean | undefined;
31 }
32
33 interface NotificationMetadata {
34 activationType?: string | undefined;
35 activationAt?: string | undefined;
36 deliveredAt?: string | undefined;
37 activationValue?: string | undefined;
38 activationValueIndex?: string | undefined;
39 }
40
41 interface NotificationCallback {
42 (err: Error | null, response: string, metadata?: NotificationMetadata): void;
43 }
44
45 interface Option {
46 withFallback?: boolean | undefined;
47 customPath?: string | undefined;
48 }
49}
50
51declare var nodeNotifier: nodeNotifier.NodeNotifier;
52
53export = nodeNotifier;