From 9889f42a78b3782105e157a5e05ca2d657d860ab Mon Sep 17 00:00:00 2001 From: "battre@chromium.org" Date: Wed, 20 Jun 2012 14:08:02 +0000 Subject: Document signatures for Event.[add|remove|has]Listener() BUG=132950 TEST=no Review URL: https://chromiumcodereview.appspot.com/10553002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143168 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/extensions/api/events.json | 57 +++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 5 deletions(-) (limited to 'chrome/common/extensions/api/events.json') diff --git a/chrome/common/extensions/api/events.json b/chrome/common/extensions/api/events.json index 25c8fa9..da3369413 100644 --- a/chrome/common/extensions/api/events.json +++ b/chrome/common/extensions/api/events.json @@ -14,11 +14,58 @@ "description": "An object which allows the addition and removal of listeners for a Chrome event.", "additionalProperties": { "type": "any"}, "functions": [ - // TODO(battre): Add correct signatures. - { "name": "addListener", "type": "function", "parameters": [] }, - { "name": "removeListener", "type": "function", "parameters": [] }, - { "name": "hasListener", "type": "function", "parameters": [] }, - { "name": "hasListeners", "type": "function", "parameters": [] }, + { + "name": "addListener", + "nocompile": true, + "type": "function", + "description": "Registers an event listener callback to an event.", + "parameters": [ + { + "name": "callback", + "type": "function", + "description": "Called when an event occurs. The parameters of this function depend on the type of event." + } + ] + }, + { + "name": "removeListener", + "nocompile": true, + "type": "function", + "description": "Deregisters an event listener callback from an event.", + "parameters": [ + { + "name": "callback", + "type": "function", + "description": "Listener that shall be unregistered." + } + ] + }, + { + "name": "hasListener", + "nocompile": true, + "type": "function", + "parameters": [ + { + "name": "callback", + "type": "function", + "description": "Listener whose registration status shall be tested." + } + ], + "returns": { + "type": "boolean", + "description": "True if callback is registered to the event." + } + }, + { + "name": "hasListeners", + "nocompile": true, + "type": "function", + "parameters": [], + "returns": { + "type": "boolean", + "description": "True if any event listeners are registered to the event." + } + }, { "name": "addRules", "type": "function", -- cgit v1.1