UNPKG

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