Chromium Code Reviews| Index: chrome/common/extensions/api/experimental.declarative.json |
| diff --git a/chrome/common/extensions/api/experimental.declarative.json b/chrome/common/extensions/api/experimental.declarative.json |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f2d3cf13d768b16cac25db3cf207b37945c41818 |
| --- /dev/null |
| +++ b/chrome/common/extensions/api/experimental.declarative.json |
| @@ -0,0 +1,125 @@ |
| +[ |
| + { |
| + "namespace": "experimental.declarative", |
| + "types": [ |
| + { |
| + "id": "Rule", |
| + "type": "object", |
| + "description": "Description of a declarative rule for handling events.", |
| + "properties": { |
| + "id": { |
| + "type": "string", |
| + "optional": true, |
| + "description": "Optional identifier that allows referencing this rule." |
| + }, |
| + "conditions": { |
| + "type": "array", |
| + "items": {"type": "any"}, |
| + "description": "List of conditions that can trigger the actions." |
| + }, |
| + "actions": { |
| + "type": "array", |
| + "items": {"type": "any"}, |
| + "description": "List of actions that are triggered if one of the condtions is fulfilled." |
| + }, |
| + "priority": { |
| + "type": "integer", |
| + "optional": true, |
| + "description": "Optional priority of this rule. Defaults to 100." |
| + } |
| + } |
| + } |
| + ], |
| + "functions": [ |
| + { |
| + "name": "addRules", |
| + "type": "function", |
| + "description": "Registers rules to handle events.", |
| + "parameters": [ |
| + { |
| + "name": "event", |
| + "type": "string", |
| + "description": "Name of the event this function affects." |
| + }, |
| + { |
| + "name": "rules", |
| + "type": "array", |
| + "items": {"$ref": "Rule"}, |
| + "description": "Rules to be registered. These does not replace previously registered rules." |
|
Matt Perry
2012/01/24 22:39:10
"These do not"
battre
2012/01/25 19:25:08
Done.
|
| + }, |
| + { |
| + "name": "callback", |
| + "optional": true, |
| + "type": "function", |
| + "parameters": [ |
| + { |
| + "name": "rules", |
| + "type": "array", |
| + "items": {"$ref": "Rule"}, |
| + "description": "Rules that were registered, the optional parameters are filled with values." |
| + } |
| + ], |
| + "description": "Called with registered rules." |
| + } |
| + ] |
| + }, |
| + { |
| + "name": "getRules", |
| + "type": "function", |
| + "description": "Returns currently registered rules.", |
| + "parameters": [ |
| + { |
| + "name": "event", |
| + "type": "string", |
| + "description": "Name of the event this function affects." |
| + }, |
| + { |
| + "name": "rule_identifiers", |
|
Matt Perry
2012/01/24 22:39:10
camelCase
battre
2012/01/25 19:25:08
Done.
|
| + "type": "array", |
| + "items": {"type": "string"}, |
| + "description": "If non-empty, only rules with identifiers contained in this array are returned." |
| + }, |
| + { |
| + "name": "callback", |
| + "type": "function", |
| + "parameters": [ |
| + { |
| + "name": "rules", |
| + "type": "array", |
| + "items": {"$ref": "Rule"}, |
| + "description": "Rules that were registered, the optional parameters are filled with values." |
| + } |
| + ], |
| + "description": "Called with registered rules." |
| + } |
| + ] |
| + }, |
| + { |
| + "name": "removeRules", |
| + "type": "function", |
| + "description": "Unregisters currently registered rules.", |
| + "parameters": [ |
| + { |
| + "name": "event", |
| + "type": "string", |
| + "description": "Name of the event this function affects." |
| + }, |
| + { |
| + "name": "rule_identifiers", |
| + "type": "array", |
| + "items": {"type": "string"}, |
| + "description": "If non-empty, only rules with identifiers contained in this array are unregistered." |
| + }, |
| + { |
| + "name": "callback", |
| + "optional": true, |
| + "type": "function", |
| + "parameters": [], |
| + "description": "Called when rules were unregistered." |
| + } |
| + ] |
| + } |
| + ] |
| + } |
| +] |
| + |