view.js 11 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. /// View API.
  15. ///
  16. /// @module vwf/api/view
  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/view~readyCallback} callback
  38. ///
  39. /// @returns {}
  40. createdNode: [ /* 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. initializedNode: [ /* nodeID, childID, childExtendsID, childImplementsIDs, childSource, childType,
  63. childIndex, childName */ ],
  64. /// Description.
  65. ///
  66. /// @function
  67. ///
  68. /// @param {ID} nodeID
  69. ///
  70. /// @returns {}
  71. deletedNode: [ /* nodeID */ ],
  72. /// Description.
  73. ///
  74. /// @function
  75. ///
  76. /// @param {ID} nodeID
  77. /// @param {ID} childID
  78. /// @param {String} childName
  79. ///
  80. /// @returns {}
  81. addedChild: [ /* nodeID, childID, childName */ ],
  82. /// Description.
  83. ///
  84. /// @function
  85. ///
  86. /// @param {ID} nodeID
  87. /// @param {ID} childID
  88. ///
  89. /// @returns {}
  90. removedChild: [ /* nodeID, childID */ ],
  91. /// Description.
  92. ///
  93. /// @function
  94. ///
  95. /// @param {ID} nodeID
  96. /// @param {String} propertyName
  97. /// @param {Value} propertyValue
  98. ///
  99. /// @returns {}
  100. createdProperty: [ /* nodeID, propertyName, propertyValue */ ],
  101. /// Description.
  102. ///
  103. /// @function
  104. ///
  105. /// @param {ID} nodeID
  106. /// @param {String} propertyName
  107. /// @param {Value} propertyValue
  108. ///
  109. /// @returns {}
  110. initializedProperty: [ /* nodeID, propertyName, propertyValue */ ],
  111. // TODO: deletedProperty
  112. /// Description.
  113. ///
  114. /// @function
  115. ///
  116. /// @param {ID} nodeID
  117. /// @param {String} propertyName
  118. /// @param {Value} propertyValue
  119. /// The internal value of the property set in the model driver (which
  120. /// may differ from the value originally passed in to the model driver).
  121. ///
  122. /// @returns {}
  123. satProperty: [ /* nodeID, propertyName, propertyValue */ ],
  124. /// Description.
  125. ///
  126. /// @function
  127. ///
  128. /// @param {ID} nodeID
  129. /// @param {String} propertyName
  130. /// @param {Value} propertyValue
  131. ///
  132. /// @returns {}
  133. gotProperty: [ /* nodeID, propertyName, propertyValue */ ],
  134. /// Description.
  135. ///
  136. /// @function
  137. ///
  138. /// @param {ID} nodeID
  139. /// @param {String} methodName
  140. /// @param {String[]} methodParameters
  141. /// @param {String} methodBody
  142. ///
  143. /// @returns {}
  144. createdMethod: [ /* nodeID, methodName, methodParameters, methodBody */ ],
  145. // TODO: deletedMethod
  146. /// Description.
  147. ///
  148. /// @function
  149. ///
  150. /// @param {ID} nodeID
  151. /// @param {String} methodName
  152. /// @param {Handler} methodHandler
  153. ///
  154. /// @returns {}
  155. satMethod: [ /* nodeID, methodName, methodHandler */ ],
  156. /// Description.
  157. ///
  158. /// @function
  159. ///
  160. /// @param {ID} nodeID
  161. /// @param {String} methodName
  162. /// @param {Handler} methodHandler
  163. ///
  164. /// @returns {}
  165. gotMethod: [ /* nodeID, methodName, methodHandler */ ],
  166. /// Description.
  167. ///
  168. /// @function
  169. ///
  170. /// @param {ID} nodeID
  171. /// @param {String} methodName
  172. /// @param {String[]} methodParameters
  173. /// @param {Value} methodValue
  174. ///
  175. /// @returns {}
  176. calledMethod: [ /* nodeID, methodName, methodParameters, methodValue */ ],
  177. /// Description.
  178. ///
  179. /// @function
  180. ///
  181. /// @param {ID} nodeID
  182. /// @param {String} eventName
  183. /// @param {String[]} eventParameters
  184. ///
  185. /// @returns {}
  186. createdEvent: [ /* nodeID, eventName, eventParameters */ ],
  187. // TODO: deletedEvent
  188. /// Description.
  189. ///
  190. /// @function
  191. ///
  192. /// @param {ID} nodeID
  193. /// @param {String} eventName
  194. /// @param {ListenerID} eventListenerID
  195. /// @param {Handler} eventHandler
  196. /// @param {ID} eventContextID
  197. /// @param {String[]} eventPhases
  198. ///
  199. /// @returns {}
  200. addedEventListener: [ /* nodeID, eventName, eventListenerID, eventHandler, eventContextID, eventPhases */ ],
  201. /// Description.
  202. ///
  203. /// @function
  204. ///
  205. /// @param {ID} nodeID
  206. /// @param {String} eventName
  207. /// @param {ListenerID} eventListenerID
  208. ///
  209. /// @returns {}
  210. removedEventListener: [ /* nodeID, eventName, eventListenerID */ ],
  211. /// Description.
  212. ///
  213. /// @function
  214. ///
  215. /// @param {ID} nodeID
  216. /// @param {String} eventName
  217. /// @param {ListenerID} eventListenerID
  218. /// @param {Listener} eventListener
  219. ///
  220. /// @returns {}
  221. satEventListener: [ /* nodeID, eventName, eventListenerID, eventListener */ ],
  222. /// Description.
  223. ///
  224. /// @function
  225. ///
  226. /// @param {ID} nodeID
  227. /// @param {String} eventName
  228. /// @param {ListenerID} eventListenerID
  229. /// @param {Listener} eventListener
  230. ///
  231. /// @returns {}
  232. gotEventListener: [ /* nodeID, eventName, eventListenerID, eventListener */ ],
  233. /// Description.
  234. ///
  235. /// @function
  236. ///
  237. /// @param {ID} nodeID
  238. /// @param {String} eventName
  239. /// @param {ID} eventContextID
  240. ///
  241. /// @returns {}
  242. flushedEventListeners: [ /* nodeID, eventName, eventContextID */ ],
  243. /// Description.
  244. ///
  245. /// @function
  246. ///
  247. /// @param {ID} nodeID
  248. /// @param {String} eventName
  249. /// @param {String[]} eventParameters
  250. ///
  251. /// @returns {}
  252. firedEvent: [ /* nodeID, eventName, eventParameters */ ],
  253. /// Description.
  254. ///
  255. /// @function
  256. ///
  257. /// @param {ID} nodeID
  258. /// @param {String} scriptText
  259. /// @param {String} scriptType
  260. ///
  261. /// @returns {}
  262. executed: [ /* nodeID, scriptText, scriptType */ ],
  263. /// Time has changed, probably by about the same amount as last time.
  264. ///
  265. /// `ticked` notifications are sent periodically as time moves forward. They are sent at
  266. /// roughly consistent intervals in real time while the application is running. However,
  267. /// application processing delays and network jitter will affect the specific interval.
  268. ///
  269. /// Don't rely on `ticked` notifications to arrive at any particular rate. `ticked` is
  270. /// currently derived from reflector idle messages. Future versions of the reflector may
  271. /// vary the idle message interval based on network conditions and the application state.
  272. ///
  273. /// Use {@link external:Window#requestAnimationFrame window.requestAnimationFrame} or
  274. /// {@link external:WindowTimers#setInterval window.setInterval} for real-time
  275. /// notifications. To receive notifications following application state changes, but not
  276. /// necessarily periodically, listen for {@link module:vwf/api/view.tocked view.tocked}.
  277. ///
  278. /// @function
  279. ///
  280. /// @param {Number} time
  281. ///
  282. /// @returns {}
  283. ticked: [ /* time */ ],
  284. /// Time has changed.
  285. ///
  286. /// Unlike {@link module:vwf/api/view.ticked view.ticked}, `tocked` notifications are sent
  287. /// each time that time moves forward. Time changes may occur when previously scheduled
  288. /// actions are executed or as regular idle progress. Since the application state only
  289. /// changes when simulation time changes, `tocked` notifications may be used as an
  290. /// application-wide change notification.
  291. ///
  292. /// @function
  293. ///
  294. /// @param {Number} time
  295. ///
  296. /// @returns {}
  297. tocked: [ /* time */ ],
  298. /// Description.
  299. ///
  300. /// @callback module:vwf/api/view~readyCallback
  301. ///
  302. /// @param {Boolean} ready
  303. };
  304. return exports;
  305. } );