Merge pull request #10298 from korve/master

extends node-webkit App and Window classes with EventEmitter as they can emit events
This commit is contained in:
Mine Starks
2016-08-03 16:57:33 -07:00
committed by GitHub
3 changed files with 34 additions and 2 deletions
+2 -2
View File
@@ -156,7 +156,7 @@ declare module "nw.gui" {
eval(frame: HTMLIFrameElement, script: string): void;
}
export interface App {
export interface App extends EventEmitter {
argv: any;
fullArgv: any;
dataPath: string;
@@ -199,7 +199,7 @@ declare module "nw.gui" {
menu?: Menu;
}
export class Tray implements TrayOption {
export class Tray extends EventEmitter implements TrayOption {
constructor(option: TrayOption);
title: string;
tooltip: string;
+15
View File
@@ -0,0 +1,15 @@
/// <reference path="trayballoon.d.ts" />
import trayballoon = require( "trayballoon" );
function testTrayballoon() {
trayballoon( {
text: "text",
title: "title",
icon: "icon",
timeout: 5000,
wait: true
}, () => {
} );
}
+17
View File
@@ -0,0 +1,17 @@
// Type definitions for trayballoon
// Project: https://github.com/sindresorhus/trayballoon
// Definitions by: André Eckardt <https://github.com/korve>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare interface TrayballoonOptions {
text:string
title?:string
icon?:string
timeout?:number
wait?:boolean
}
declare function trayballoonFn( opts:TrayballoonOptions, fn:Function ): void;
declare module "trayballoon" {
export = trayballoonFn;
}