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..06026e6c0756457eaae56d80e15a75e059be52de |
--- /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 do not replace previously registered rules." |
+ }, |
+ { |
+ "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": "ruleIdentifiers", |
+ "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": "ruleIdentifiers", |
+ "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." |
+ } |
+ ] |
+ } |
+ ] |
+ } |
+] |
+ |