OLD | NEW |
(Empty) | |
| 1 [ |
| 2 { |
| 3 "namespace": "experimental.declarative", |
| 4 "types": [ |
| 5 { |
| 6 "id": "Rule", |
| 7 "type": "object", |
| 8 "description": "Description of a declarative rule for handling events.", |
| 9 "properties": { |
| 10 "id": { |
| 11 "type": "string", |
| 12 "optional": true, |
| 13 "description": "Optional identifier that allows referencing this rul
e." |
| 14 }, |
| 15 "conditions": { |
| 16 "type": "array", |
| 17 "items": {"type": "any"}, |
| 18 "description": "List of conditions that can trigger the actions." |
| 19 }, |
| 20 "actions": { |
| 21 "type": "array", |
| 22 "items": {"type": "any"}, |
| 23 "description": "List of actions that are triggered if one of the con
dtions is fulfilled." |
| 24 }, |
| 25 "priority": { |
| 26 "type": "integer", |
| 27 "optional": true, |
| 28 "description": "Optional priority of this rule. Defaults to 100." |
| 29 } |
| 30 } |
| 31 } |
| 32 ], |
| 33 "functions": [ |
| 34 { |
| 35 "name": "addRules", |
| 36 "type": "function", |
| 37 "description": "Registers rules to handle events.", |
| 38 "parameters": [ |
| 39 { |
| 40 "name": "event", |
| 41 "type": "string", |
| 42 "description": "Name of the event this function affects." |
| 43 }, |
| 44 { |
| 45 "name": "rules", |
| 46 "type": "array", |
| 47 "items": {"$ref": "Rule"}, |
| 48 "description": "Rules to be registered. These do not replace previou
sly registered rules." |
| 49 }, |
| 50 { |
| 51 "name": "callback", |
| 52 "optional": true, |
| 53 "type": "function", |
| 54 "parameters": [ |
| 55 { |
| 56 "name": "rules", |
| 57 "type": "array", |
| 58 "items": {"$ref": "Rule"}, |
| 59 "description": "Rules that were registered, the optional paramet
ers are filled with values." |
| 60 } |
| 61 ], |
| 62 "description": "Called with registered rules." |
| 63 } |
| 64 ] |
| 65 }, |
| 66 { |
| 67 "name": "getRules", |
| 68 "type": "function", |
| 69 "description": "Returns currently registered rules.", |
| 70 "parameters": [ |
| 71 { |
| 72 "name": "event", |
| 73 "type": "string", |
| 74 "description": "Name of the event this function affects." |
| 75 }, |
| 76 { |
| 77 "name": "ruleIdentifiers", |
| 78 "type": "array", |
| 79 "items": {"type": "string"}, |
| 80 "description": "If non-empty, only rules with identifiers contained
in this array are returned." |
| 81 }, |
| 82 { |
| 83 "name": "callback", |
| 84 "type": "function", |
| 85 "parameters": [ |
| 86 { |
| 87 "name": "rules", |
| 88 "type": "array", |
| 89 "items": {"$ref": "Rule"}, |
| 90 "description": "Rules that were registered, the optional paramet
ers are filled with values." |
| 91 } |
| 92 ], |
| 93 "description": "Called with registered rules." |
| 94 } |
| 95 ] |
| 96 }, |
| 97 { |
| 98 "name": "removeRules", |
| 99 "type": "function", |
| 100 "description": "Unregisters currently registered rules.", |
| 101 "parameters": [ |
| 102 { |
| 103 "name": "event", |
| 104 "type": "string", |
| 105 "description": "Name of the event this function affects." |
| 106 }, |
| 107 { |
| 108 "name": "ruleIdentifiers", |
| 109 "type": "array", |
| 110 "items": {"type": "string"}, |
| 111 "description": "If non-empty, only rules with identifiers contained
in this array are unregistered." |
| 112 }, |
| 113 { |
| 114 "name": "callback", |
| 115 "optional": true, |
| 116 "type": "function", |
| 117 "parameters": [], |
| 118 "description": "Called when rules were unregistered." |
| 119 } |
| 120 ] |
| 121 } |
| 122 ] |
| 123 } |
| 124 ] |
| 125 |
OLD | NEW |