model.js 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. "use strict";
  2. // Copyright 2012 United States Government, as represented by the Secretary of Defense, Under
  3. // Secretary of Defense (Personnel & Readiness).
  4. //
  5. // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  6. // in compliance with the License. You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software distributed under the License
  11. // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  12. // or implied. See the License for the specific language governing permissions and limitations under
  13. // the License.
  14. /// Model API.
  15. ///
  16. /// @module vwf/api/model
  17. define( function() {
  18. var exports = {
  19. /// Description.
  20. ///
  21. /// @function
  22. ///
  23. /// @param {ID} nodeID
  24. /// @param {ID} childID
  25. /// @param {String} childExtendsID
  26. /// @param {String[]} childImplementsIDs
  27. /// @param {String} childSource
  28. /// @param {String} childType
  29. /// @param {String} childIndex
  30. /// When `nodeID` is falsy, the URI of the component, or `undefined` if the component
  31. /// wasn't loaded from a URI. When `nodeID` is truthy, the numerical index of the child's
  32. /// position in the parent's array, starting at `0`. When child order is significant to
  33. /// the driver, the child should be placed at the given position in the parent's array.
  34. /// Nodes won't necessarily arrive in numerical order since varying dependencies cause
  35. /// nodes to become ready at indeterminate times.
  36. /// @param {String} childName
  37. /// @param {module:vwf/api/model~readyCallback} callback
  38. ///
  39. /// @returns {}
  40. creatingNode: [ /* nodeID, childID, childExtendsID, childImplementsIDs, childSource, childType,
  41. childIndex, childName, callback( ready ) */ ],
  42. /// Description.
  43. ///
  44. /// @function
  45. ///
  46. /// @param {ID} nodeID
  47. /// @param {ID} childID
  48. /// @param {String} childExtendsID
  49. /// @param {String[]} childImplementsIDs
  50. /// @param {String} childSource
  51. /// @param {String} childType
  52. /// @param {String} childIndex
  53. /// When `nodeID` is falsy, the URI of the component, or `undefined` if the component
  54. /// wasn't loaded from a URI. When `nodeID` is truthy, the numerical index of the child's
  55. /// position in the parent's array, starting at `0`. When child order is significant to
  56. /// the driver, the child should be placed at the given position in the parent's array.
  57. /// Nodes won't necessarily arrive in numerical order since varying dependencies cause
  58. /// nodes to become ready at indeterminate times.
  59. /// @param {String} childName
  60. ///
  61. /// @returns {}
  62. initializingNode: [ /* nodeID, childID, childExtendsID, childImplementsIDs, childSource, childType,
  63. childIndex, childName */ ],
  64. /// Description.
  65. ///
  66. /// @function
  67. ///
  68. /// @param {ID} nodeID
  69. /// @param {ID} childID
  70. /// @param {ID} childInitializingNodeID
  71. ///
  72. /// @returns {}
  73. initializingNodeFromPrototype: [ /* nodeID, childID, childInitializingNodeID */ ],
  74. /// Description.
  75. ///
  76. /// @function
  77. ///
  78. /// @param {ID} nodeID
  79. ///
  80. /// @returns {}
  81. deletingNode: [ /* nodeID */ ],
  82. /// Description.
  83. ///
  84. /// @function
  85. ///
  86. /// @param {}
  87. ///
  88. /// @returns {}
  89. addingChild: [],
  90. /// Description.
  91. ///
  92. /// @function
  93. ///
  94. /// @param {}
  95. ///
  96. /// @returns {}
  97. removingChild: [],
  98. /// Description.
  99. ///
  100. /// @function
  101. ///
  102. /// @param {}
  103. ///
  104. /// @returns {}
  105. settingProperties: [],
  106. /// Description.
  107. ///
  108. /// @function
  109. ///
  110. /// @param {}
  111. ///
  112. /// @returns {}
  113. gettingProperties: [],
  114. /// Description.
  115. ///
  116. /// @function
  117. ///
  118. /// @param {}
  119. ///
  120. /// @returns {}
  121. creatingProperty: [],
  122. /// Description.
  123. ///
  124. /// @function
  125. ///
  126. /// @param {}
  127. ///
  128. /// @returns {}
  129. initializingProperty: [],
  130. // TODO: deletingProperty
  131. /// Description.
  132. ///
  133. /// @function
  134. ///
  135. /// @param {ID} nodeID
  136. /// @param {String} propertyName
  137. /// @param {Object} propertyValue
  138. ///
  139. /// @returns {Object}
  140. /// A value set on property or undefined if not set.
  141. ///
  142. /// The first non-undefined return value will be sent with the "satProperty" event (which
  143. /// may differ from the incoming propertyValue).
  144. settingProperty: [],
  145. /// Description.
  146. ///
  147. /// @function
  148. ///
  149. /// @param {}
  150. ///
  151. /// @returns {}
  152. gettingProperty: [],
  153. /// Description.
  154. ///
  155. /// @function
  156. ///
  157. /// @param {ID} nodeID
  158. /// @param {String} methodName
  159. /// @param {String[]} methodParameters
  160. /// @param {String} methodBody
  161. ///
  162. /// @returns {Handler} methodHandler
  163. creatingMethod: [ /* nodeID, methodName, methodParameters, methodBody */ ],
  164. // TODO: deletingMethod
  165. /// Description.
  166. ///
  167. /// @function
  168. ///
  169. /// @param {ID} nodeID
  170. /// @param {String} methodName
  171. /// @param {Handler} methodHandler
  172. ///
  173. /// @returns {Handler} methodHandler
  174. settingMethod: [ /* nodeID, methodName, methodHandler */ ],
  175. /// Description.
  176. ///
  177. /// @function
  178. ///
  179. /// @param {ID} nodeID
  180. /// @param {String} methodName
  181. ///
  182. /// @returns {Handler} methodHandler
  183. gettingMethod: [ /* nodeID, methodName */ ],
  184. /// Description.
  185. ///
  186. /// @function
  187. ///
  188. /// @param {ID} nodeID
  189. /// @param {String} methodName
  190. /// @param {String[]} methodParameters
  191. ///
  192. /// @returns {}
  193. callingMethod: [ /* nodeID, methodName, methodParameters */ ],
  194. /// Description.
  195. ///
  196. /// @function
  197. ///
  198. /// @param {ID} nodeID
  199. /// @param {String} eventName
  200. /// @param {ListenerID} eventListenerID
  201. /// @param {Handler} eventHandler
  202. /// @param {ID} eventContextID
  203. /// @param {String[]} eventPhases
  204. ///
  205. /// @returns {Boolean}
  206. addingEventListener: [ /* nodeID, eventName, eventListenerID, eventHandler, eventContextID, eventPhases */ ],
  207. /// Description.
  208. ///
  209. /// @function
  210. ///
  211. /// @param {ID} nodeID
  212. /// @param {String} eventName
  213. /// @param {ListenerID} eventListenerID
  214. ///
  215. /// @returns {Boolean}
  216. removingEventListener: [ /* nodeID, eventName, eventListenerID */ ],
  217. /// Description.
  218. ///
  219. /// @function
  220. ///
  221. /// @param {ID} nodeID
  222. /// @param {String} eventName
  223. /// @param {ListenerID} eventListenerID
  224. /// @param {Listener} eventListener
  225. ///
  226. /// @returns {Listener}
  227. settingEventListener: [ /* nodeID, eventName, eventListenerID, eventListener */ ],
  228. /// Description.
  229. ///
  230. /// @function
  231. ///
  232. /// @param {ID} nodeID
  233. /// @param {String} eventName
  234. /// @param {ListenerID} eventListenerID
  235. ///
  236. /// @returns {Listener}
  237. gettingEventListener: [ /* nodeID, eventName, eventListenerID */ ],
  238. /// Description.
  239. ///
  240. /// @function
  241. ///
  242. /// @param {ID} nodeID
  243. /// @param {String} eventName
  244. /// @param {ID} eventContextID
  245. ///
  246. /// @returns {}
  247. flushingEventListeners: [ /* nodeID, eventName, eventContextID */ ],
  248. /// Description.
  249. ///
  250. /// @function
  251. ///
  252. /// @param {ID} nodeID
  253. /// @param {String} eventName
  254. /// @param {String[]} eventParameters
  255. ///
  256. /// @returns {}
  257. creatingEvent: [ /* nodeID, eventName, eventParameters */ ],
  258. // TODO: deletingEvent
  259. /// Description.
  260. ///
  261. /// @function
  262. ///
  263. /// @param {ID} nodeID
  264. /// @param {String} eventName
  265. /// @param {String[]} eventParameters
  266. ///
  267. /// @returns {}
  268. firingEvent: [ /* nodeID, eventName, eventParameters */ ],
  269. /// Description.
  270. ///
  271. /// @function
  272. ///
  273. /// @param {}
  274. /// @returns {}
  275. executing: [],
  276. /// Time has changed, probably by about the same amount as last time.
  277. ///
  278. /// Don't rely on `ticking` notifications; but if you do, don't rely on them to arrive at
  279. /// any particular rate. `ticking` may be removed in the future to allow the reflector to
  280. /// vary the idle message interval.
  281. ///
  282. /// To schedule actions for certain times, use the `when` parameter in the
  283. /// {@link module:vwf/kernel/model Kernel API}.
  284. ///
  285. /// @function
  286. ///
  287. /// @param {Number} time
  288. ///
  289. /// @returns {}
  290. ///
  291. /// @deprecated in version 0.6.23. Use the {@link module:vwf/kernel/model Kernel API} `when`
  292. /// parameter to schedule future actions.
  293. ticking: [],
  294. /// Description.
  295. ///
  296. /// @callback module:vwf/api/model~readyCallback
  297. ///
  298. /// @param {Boolean} ready
  299. };
  300. return exports;
  301. } );