-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.d.ts
49 lines (42 loc) · 1.17 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
import { EventEmitter } from 'events';
export interface TrayOptions {
title?: string;
icon?: Buffer;
debug?: boolean;
action?: Function;
useTempDir?: boolean | "clean";
}
export interface ItemOptions {
action?: Function;
label?: string;
disabled?: boolean;
checked?: boolean;
bold?: boolean;
type?: string;
}
export interface NotifyOptions {
title?: string;
msg?: string;
timeout?: number;
style?: 'info' | 'warn' | 'error';
}
export class Tray extends EventEmitter {
constructor(opts?: TrayOptions);
static create(opts?: TrayOptions, ready?: Function): Promise<Tray>;
setTitle(title: string): void;
setIcon(icon: Buffer): void;
setAction(action: Function): void;
notify(title: string, msg: string, action?: Function): void;
setMenu(...items: Item[]): void;
asXML(): string;
kill(): void;
separator(): Item;
item(label: string, props?: ItemOptions): Item;
}
export class Item {
constructor(label: string, props?: ItemOptions);
add(...items: Item[]): void;
asXML(): string;
}
export function create(opts?: TrayOptions, ready?: Function): Promise<Tray>;
export default { create: Tray.create }