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