From 39baf904d4e672e3ed88d293282a14989331b3f7 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sat, 13 Feb 2016 22:00:25 +0000 Subject: [PATCH] Fix chrome.events.Event definition Made all methods to strictly accept same type of function; fixes removeListener incompatibility. --- chrome/chrome.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index 17613b88c2..70c897421a 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -2537,14 +2537,14 @@ declare module chrome.events { } /** An object which allows the addition and removal of listeners for a Chrome event. */ - interface Event { + interface Event { /** * Registers an event listener callback to an event. * @param callback Called when an event occurs. The parameters of this function depend on the type of event. * The callback parameter should be a function that looks like this: * function() {...}; */ - addListener(callback: Function): void; + addListener(callback: T): void; /** * Returns currently registered rules. * @param callback Called with registered rules. @@ -2565,7 +2565,7 @@ declare module chrome.events { /** * @param callback Listener whose registration status shall be tested. */ - hasListener(callback: Function): boolean; + hasListener(callback: T): boolean; /** * Unregisters currently registered rules. * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are unregistered. @@ -2596,7 +2596,7 @@ declare module chrome.events { * The callback parameter should be a function that looks like this: * function() {...}; */ - removeListener(callback: () => void): void; + removeListener(callback: T): void; hasListeners(): boolean; }