-
Notifications
You must be signed in to change notification settings - Fork 29.8k
/
index.d.ts
229 lines (199 loc) · 7.85 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
// Type definitions for node-notifier 5.4.1
// Project: https://github.com/mikaelbr/node-notifier
// Definitions by: Qubo <https://github.com/tkQubo>
// Lorenzo Rapetti <https://github.com/loryman>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
declare module "node-notifier" {
import NotificationCenter = require('node-notifier/notifiers/notificationcenter');
import NotifySend = require("node-notifier/notifiers/notifysend");
import WindowsToaster = require("node-notifier/notifiers/toaster");
import WindowsBalloon = require("node-notifier/notifiers/balloon");
import Growl = require("node-notifier/notifiers/growl");
namespace nodeNotifier {
interface NodeNotifier extends NodeJS.EventEmitter {
notify(
notification?: NotificationCenter.Notification,
callback?: NotificationCallback
): NotificationCenter;
notify(
notification?: WindowsToaster.Notification,
callback?: NotificationCallback
): WindowsToaster;
notify(
notification?: WindowsBalloon.Notification,
callback?: NotificationCallback
): WindowsBalloon;
notify(
notification?: NotifySend.Notification,
callback?: NotificationCallback
): NotifySend;
notify(notification?: Growl.Notification, callback?: NotificationCallback): Growl;
notify(notification?: Notification, callback?: NotificationCallback): NodeNotifier;
notify(notification?: string, callback?: NotificationCallback): NodeNotifier;
NotificationCenter: typeof NotificationCenter;
NotifySend: typeof NotifySend;
WindowsToaster: typeof WindowsToaster;
WindowsBalloon: typeof WindowsBalloon;
Growl: typeof Growl;
}
interface Notification {
title?: string;
message?: string;
/** Absolute path (not balloons) */
icon?: string;
/** Wait with callback until user action is taken on notification */
wait?: boolean;
}
interface NotificationMetadata {
activationType?: string;
activationAt?: string;
deliveredAt?: string;
activationValue?: string;
activationValueIndex?: string;
}
interface NotificationCallback {
(
err: Error | null,
response: string,
metadata?: NotificationMetadata,
): void;
}
interface Option {
withFallback?: boolean;
customPath?: string;
}
}
var nodeNotifier: nodeNotifier.NodeNotifier;
export = nodeNotifier;
}
declare module "node-notifier/notifiers/notificationcenter" {
import notifier = require('node-notifier');
class NotificationCenter {
constructor(option?: notifier.Option);
notify(notification?: NotificationCenter.Notification, callback?: notifier.NotificationCallback): NotificationCenter;
}
namespace NotificationCenter {
interface Notification extends notifier.Notification {
/**
* Case Sensitive string for location of sound file, or use one of macOS' native sounds.
*/
sound?: boolean | string;
subtitle?: string;
/** Attach image? (Absolute path) */
contentImage?: string;
/** URL to open on click */
open?: string;
/**
* The amount of seconds before the notification closes.
* Takes precedence over wait if both are defined.
*/
timeout?: number | false;
/** Label for cancel button */
closeLabel?: string;
/** Action label or list of labels in case of dropdown. */
actions?: string | string[];
/** Label to be used if there are multiple actions */
dropdownLabel?: string;
/**
* If notification should take input.
* Value passed as third argument in callback and event emitter.
*/
reply?: boolean;
}
}
export = NotificationCenter;
}
declare module "node-notifier/notifiers/notifysend" {
import notifier = require('node-notifier');
class NotifySend {
constructor(option?: notifier.Option);
notify(notification?: NotifySend.Notification, callback?: notifier.NotificationCallback): NotifySend;
}
namespace NotifySend {
interface Notification {
title?: string;
message?: string;
icon?: string;
/** Specifies the urgency level (low, normal, critical). */
urgency?: string;
/** Specifies the timeout in milliseconds at which to expire the notification */
time?: number;
/** Specifies the notification category */
category?: string;
/** Specifies basic extra data to pass. Valid types are int, double, string and byte. */
hint?: string;
}
}
export = NotifySend;
}
declare module "node-notifier/notifiers/toaster" {
import notifier = require('node-notifier');
class WindowsToaster {
constructor(option?: notifier.Option);
notify(notification?: WindowsToaster.Notification, callback?: notifier.NotificationCallback): WindowsToaster;
}
namespace WindowsToaster {
interface Notification extends notifier.Notification {
/**
* Defined by http://msdn.microsoft.com/en-us/library/windows/apps/hh761492.aspx
*/
sound?: boolean | string;
/** ID to use for closing notification. */
id?: number;
/** App.ID and app Name. Defaults to no value, causing SnoreToast text to be visible. */
appID?: string;
/** Refer to previously created notification to close. */
remove?: number;
/**
* Creates a shortcut <path> in the start menu which point to the
* executable <application>, appID used for the notifications.
*/
install?: string;
}
}
export = WindowsToaster;
}
declare module "node-notifier/notifiers/growl" {
import notifier = require('node-notifier');
class Growl {
constructor(option?: Growl.Option);
notify(notification?: Growl.Notification, callback?: notifier.NotificationCallback): Growl;
}
namespace Growl {
interface Option {
name?: string;
host?: string;
port?: number;
}
interface Notification extends notifier.Notification {
/** whether or not to sticky the notification (defaults to false) */
sticky?: boolean;
/** type of notification to use (defaults to the first registered type) */
label?: string;
/** the priority of the notification from lowest (-2) to highest (2) */
priority?: number;
}
}
export = Growl;
}
declare module "node-notifier/notifiers/balloon" {
import notifier = require('node-notifier');
class WindowsBalloon {
constructor(option?: notifier.Option);
notify(notification?: WindowsBalloon.Notification, callback?: notifier.NotificationCallback): WindowsBalloon;
}
namespace WindowsBalloon {
interface Notification {
title?: string;
message?: string;
/** How long to show balloons in ms */
time?: number;
/** Wait with callback until user action is taken on notification */
wait?: boolean;
/** The notification type */
type?: 'info' | 'warn' | 'error';
}
}
export = WindowsBalloon;
}