jsf.js_next_gen 1.0.0-beta-20 → 4.0.0-RC.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/.mocharc.json +2 -1
  2. package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
  3. package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
  4. package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
  5. package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
  6. package/.nyc_output/processinfo/index.json +1 -0
  7. package/.nycrc +2 -1
  8. package/README.md +78 -24
  9. package/dist/docs/assets/highlight.css +21 -0
  10. package/dist/docs/assets/search.js +1 -1
  11. package/dist/docs/assets/style.css +34 -2
  12. package/dist/docs/functions/{jsf.ajax.addOnError.html → faces.ajax.addOnError.html} +15 -13
  13. package/dist/docs/functions/{jsf.ajax.addOnEvent.html → faces.ajax.addOnEvent.html} +15 -13
  14. package/dist/docs/functions/{jsf.ajax.request.html → faces.ajax.request.html} +15 -13
  15. package/dist/docs/functions/{jsf.ajax.response.html → faces.ajax.response.html} +15 -13
  16. package/dist/docs/functions/{jsf.getClientWindow.html → faces.getClientWindow.html} +17 -14
  17. package/dist/docs/functions/{jsf.getProjectStage.html → faces.getProjectStage.html} +18 -15
  18. package/dist/docs/functions/{jsf.getViewState.html → faces.getViewState.html} +18 -15
  19. package/dist/docs/functions/{jsf.push.close.html → faces.push.close.html} +15 -13
  20. package/dist/docs/functions/{jsf.push.init.html → faces.push.init.html} +29 -19
  21. package/dist/docs/functions/{jsf.push.open.html → faces.push.open.html} +15 -13
  22. package/dist/docs/functions/{jsf.util.chain.html → faces.util.chain.html} +12 -10
  23. package/dist/docs/functions/myfaces.ab.html +10 -8
  24. package/dist/docs/index.html +71 -29
  25. package/dist/docs/modules/{jsf.ajax.html → faces.ajax.html} +18 -16
  26. package/dist/docs/modules/faces.html +75 -0
  27. package/dist/docs/modules/{jsf.push.html → faces.push.html} +16 -14
  28. package/dist/docs/modules/{jsf.util.html → faces.util.html} +12 -10
  29. package/dist/docs/modules/myfaces.html +8 -6
  30. package/dist/docs/modules.html +9 -7
  31. package/dist/docs/variables/faces.contextpath.html +57 -0
  32. package/dist/docs/variables/{jsf.implversion.html → faces.implversion.html} +17 -14
  33. package/dist/docs/variables/{jsf.separatorchar.html → faces.separatorchar.html} +18 -15
  34. package/dist/docs/variables/faces.specversion.html +64 -0
  35. package/dist/docs/variables/myfaces.oam.html +8 -6
  36. package/dist/window/faces-development.js +7688 -0
  37. package/dist/window/faces-development.js.br +0 -0
  38. package/dist/window/faces-development.js.gz +0 -0
  39. package/dist/window/faces-development.js.map +1 -0
  40. package/dist/window/faces.js +3 -0
  41. package/dist/window/faces.js.LICENSE.txt +87 -0
  42. package/dist/window/faces.js.br +0 -0
  43. package/dist/window/faces.js.gz +0 -0
  44. package/dist/window/faces.js.map +1 -0
  45. package/dist/window/jsf-development.js +3011 -2963
  46. package/dist/window/jsf-development.js.br +0 -0
  47. package/dist/window/jsf-development.js.gz +0 -0
  48. package/dist/window/jsf-development.js.map +1 -1
  49. package/dist/window/jsf.js +2 -1
  50. package/dist/window/jsf.js.LICENSE.txt +87 -0
  51. package/dist/window/jsf.js.br +0 -0
  52. package/dist/window/jsf.js.gz +0 -0
  53. package/dist/window/jsf.js.map +1 -1
  54. package/package.json +12 -12
  55. package/pom.xml +14 -0
  56. package/src/main/java/com/example/jsfs_js_ts/DecoratedFacesJS.java +94 -0
  57. package/src/main/java/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.java +54 -0
  58. package/src/main/java/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.java +57 -0
  59. package/src/main/java/com/example/jsfs_js_ts/FacesJSMappingDecorator.java +138 -0
  60. package/src/main/typescript/@types/definitions/index.d.ts +147 -0
  61. package/src/main/typescript/api/{Jsf.ts → _api.ts} +61 -49
  62. package/src/main/typescript/api/faces.ts +44 -0
  63. package/src/main/typescript/api/jsf.ts +43 -0
  64. package/src/main/typescript/impl/AjaxImpl.ts +39 -42
  65. package/src/main/typescript/impl/PushImpl.ts +27 -30
  66. package/src/main/typescript/impl/core/Const.ts +38 -16
  67. package/src/main/typescript/impl/core/ImplTypes.ts +1 -1
  68. package/src/main/typescript/impl/i18n/Messages.ts +2 -2
  69. package/src/main/typescript/impl/util/Assertions.ts +3 -3
  70. package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
  71. package/src/main/typescript/impl/util/AsyncRunnable.ts +5 -5
  72. package/src/main/typescript/impl/util/ExtDomQuery.ts +200 -48
  73. package/src/main/typescript/impl/util/IListener.ts +1 -1
  74. package/src/main/typescript/impl/util/Lang.ts +25 -25
  75. package/src/main/typescript/impl/xhrCore/ErrorData.ts +2 -3
  76. package/src/main/typescript/impl/xhrCore/EventData.ts +4 -3
  77. package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +19 -11
  78. package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +15 -14
  79. package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +15 -11
  80. package/src/main/typescript/impl/xhrCore/Response.ts +30 -24
  81. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +69 -49
  82. package/src/main/typescript/impl/xhrCore/XhrFormData.ts +9 -7
  83. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +76 -60
  84. package/src/main/typescript/myfaces/OamSubmit.ts +12 -15
  85. package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +277 -65
  86. package/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.ts +1 -1
  87. package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.ts +1 -1
  88. package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.ts +1 -1
  89. package/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.ts +1 -1
  90. package/src/main/typescript/test/frameworkBase/_ext/monadish/StreamTest.spec.ts +1 -1
  91. package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test.js +1 -0
  92. package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test2.js +1 -0
  93. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +75 -30
  94. package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +44 -4
  95. package/src/main/typescript/test/impl/ImplTest.spec.ts +18 -22
  96. package/src/main/typescript/test/impl/ImplTest_23.spec.ts +129 -0
  97. package/src/main/typescript/test/impl/SeparatorCharsTest.spec.ts +7 -6
  98. package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +15 -24
  99. package/src/main/typescript/test/queue/AsynchronousProbe.ts +1 -1
  100. package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +4 -4
  101. package/src/main/typescript/test/xhrCore/EventTests.spec.ts +15 -23
  102. package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +3 -3
  103. package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +7 -32
  104. package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +16 -37
  105. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +17 -16
  106. package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +364 -0
  107. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +102 -47
  108. package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +362 -0
  109. package/src/main/typescript/test/xhrCore/ShadowDomTest.spec.ts +6 -9
  110. package/src/main/typescript/test/xhrCore/WebsocketTest.ts +15 -15
  111. package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +3 -3
  112. package/{target/main/typescript/impl/util/AsyncRunnable.js → src/main/typescript/test/xhrCore/fixtures/addedViewHead1.js} +4 -6
  113. package/src/main/typescript/test/xhrCore/fixtures/addedViewHead2.css +18 -0
  114. package/src/main/typescript/test/xhrCore/fixtures/addedViewHead2.js +16 -0
  115. package/src/main/typescript/test/xhrCore/fixtures/addedViewHead3.js +16 -0
  116. package/src/main/typescript/test/xhrCore/fixtures/nonce_script.js +16 -0
  117. package/src/main/typescript/tsconfig-typedoc.json +17 -1
  118. package/src/main/typescript/tsconfig.json +23 -5
  119. package/src/test/resources/jsf-development.js +1 -1
  120. package/src/test.html +75 -0
  121. package/src/tmp/test.html +92 -0
  122. package/target/api/{Jsf.js → _api.js} +68 -70
  123. package/target/api/_api.js.map +1 -0
  124. package/target/api/faces.js +45 -0
  125. package/target/api/faces.js.map +1 -0
  126. package/target/api/jsf.js +45 -0
  127. package/target/api/jsf.js.map +1 -0
  128. package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
  129. package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
  130. package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
  131. package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
  132. package/target/impl/AjaxImpl.js +85 -93
  133. package/target/impl/AjaxImpl.js.map +1 -1
  134. package/target/impl/PushImpl.js +63 -64
  135. package/target/impl/PushImpl.js.map +1 -1
  136. package/target/impl/core/Const.js +38 -19
  137. package/target/impl/core/Const.js.map +1 -1
  138. package/target/impl/core/ImplTypes.js +10 -15
  139. package/target/impl/core/ImplTypes.js.map +1 -1
  140. package/target/impl/i18n/Messages.js +5 -6
  141. package/target/impl/i18n/Messages.js.map +1 -1
  142. package/target/impl/util/Assertions.js +12 -21
  143. package/target/impl/util/Assertions.js.map +1 -1
  144. package/target/impl/util/AsyncQueue.js +28 -36
  145. package/target/impl/util/AsyncQueue.js.map +1 -1
  146. package/target/impl/util/AsyncRunnable.js +1 -1
  147. package/target/impl/util/ExtDomQuery.js +235 -138
  148. package/target/impl/util/ExtDomQuery.js.map +1 -1
  149. package/target/impl/util/Lang.js +43 -50
  150. package/target/impl/util/Lang.js.map +1 -1
  151. package/target/impl/xhrCore/ErrorData.js +37 -62
  152. package/target/impl/xhrCore/ErrorData.js.map +1 -1
  153. package/target/impl/xhrCore/EventData.js +12 -14
  154. package/target/impl/xhrCore/EventData.js.map +1 -1
  155. package/target/impl/xhrCore/RequestDataResolver.js +27 -29
  156. package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
  157. package/target/impl/xhrCore/ResonseDataResolver.js +25 -23
  158. package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
  159. package/target/impl/xhrCore/Response.js +40 -36
  160. package/target/impl/xhrCore/Response.js.map +1 -1
  161. package/target/impl/xhrCore/ResponseProcessor.js +165 -167
  162. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  163. package/target/impl/xhrCore/XhrFormData.js +75 -103
  164. package/target/impl/xhrCore/XhrFormData.js.map +1 -1
  165. package/target/impl/xhrCore/XhrRequest.js +160 -145
  166. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  167. package/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +4 -0
  168. package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +4 -0
  169. package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst +1 -0
  170. package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst +1 -0
  171. package/target/myfaces/OamSubmit.js +32 -20
  172. package/target/myfaces/OamSubmit.js.map +1 -1
  173. package/target/surefire-reports/TEST-com.example.jsfs_js_ts.JsfsJsTsApplicationTests.xml +78 -0
  174. package/target/surefire-reports/com.example.jsfs_js_ts.JsfsJsTsApplicationTests.txt +7 -0
  175. package/target/test/frameworkBase/LangTest.spec.js +46 -32
  176. package/target/test/frameworkBase/LangTest.spec.js.map +1 -1
  177. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +372 -134
  178. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
  179. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +46 -32
  180. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +1 -1
  181. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +25 -34
  182. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -1
  183. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +9 -9
  184. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +1 -1
  185. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +32 -32
  186. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
  187. package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +51 -49
  188. package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js.map +1 -1
  189. package/target/test/frameworkBase/_ext/shared/StandardInits.js +277 -124
  190. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  191. package/target/test/frameworkBase/_ext/shared/XmlResponses.js +199 -18
  192. package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
  193. package/target/test/impl/ImplTest.spec.js +45 -33
  194. package/target/test/impl/ImplTest.spec.js.map +1 -1
  195. package/target/test/impl/ImplTest_23.spec.js +133 -0
  196. package/target/test/impl/ImplTest_23.spec.js.map +1 -0
  197. package/target/test/impl/SeparatorCharsTest.spec.js +22 -20
  198. package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
  199. package/target/test/myfaces/OamSubmit.spec.js +35 -42
  200. package/target/test/myfaces/OamSubmit.spec.js.map +1 -1
  201. package/target/test/queue/AsynchronousProbe.js +24 -30
  202. package/target/test/queue/AsynchronousProbe.js.map +1 -1
  203. package/target/test/queue/AsynchronousQueueTest.spec.js +40 -71
  204. package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
  205. package/target/test/xhrCore/EventTests.spec.js +47 -83
  206. package/target/test/xhrCore/EventTests.spec.js.map +1 -1
  207. package/target/test/xhrCore/FakeWebsocket.js +15 -17
  208. package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
  209. package/target/test/xhrCore/FileUploadTest.spec.js +50 -91
  210. package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
  211. package/target/test/xhrCore/RequestParamsTest.spec.js +49 -98
  212. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  213. package/target/test/xhrCore/RequestTest.spec.js +84 -120
  214. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  215. package/target/test/{typescript/xhrCore/RequestTest.js → xhrCore/RequestTest_23.spec.js} +142 -127
  216. package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -0
  217. package/target/test/xhrCore/ResponseTest.spec.js +183 -105
  218. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  219. package/target/test/xhrCore/ResponseTest23.spec.js +312 -0
  220. package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -0
  221. package/target/test/xhrCore/ShadowDomTest.spec.js +33 -66
  222. package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
  223. package/target/test/xhrCore/WebsocketTest.js +64 -97
  224. package/target/test/xhrCore/WebsocketTest.js.map +1 -1
  225. package/target/test/xhrCore/XhrFormDataTest.spec.js +42 -16
  226. package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
  227. package/target/test-classes/jsf-development.js +452 -3674
  228. package/target/test-classes/jsf.js +1 -1
  229. package/target/test-classes/jsf.js.br +0 -0
  230. package/target/test-classes/jsf.js.gz +0 -0
  231. package/webpack.config.js +7 -4
  232. package/webpack.config.js.map +1 -1
  233. package/webpack.config.ts +23 -4
  234. package/dist/docs/modules/jsf.html +0 -71
  235. package/dist/docs/variables/jsf.specversion.html +0 -52
  236. package/integrationdeploy.cmd +0 -4
  237. package/integrationsdeploy.sh +0 -5
  238. package/remap.js +0 -44
  239. package/remap.js.map +0 -1
  240. package/src/main/java/com/example/jsfs_js_ts/JsfsJsTsApplication.java +0 -12
  241. package/src/main/types/typedefs.d.ts +0 -66
  242. package/target/api/Jsf.js.map +0 -1
  243. package/target/classes/com/example/jsfs_js_ts/JsfsJsTsApplication.class +0 -0
  244. package/target/impl/util/ListenerQueue.js +0 -3
  245. package/target/impl/util/ListenerQueue.js.map +0 -1
  246. package/target/main/typescript/api/Jsf.js +0 -258
  247. package/target/main/typescript/api/Jsf.js.map +0 -1
  248. package/target/main/typescript/impl/AjaxImpl.js +0 -569
  249. package/target/main/typescript/impl/AjaxImpl.js.map +0 -1
  250. package/target/main/typescript/impl/PushImpl.js +0 -215
  251. package/target/main/typescript/impl/PushImpl.js.map +0 -1
  252. package/target/main/typescript/impl/core/Const.js +0 -135
  253. package/target/main/typescript/impl/core/Const.js.map +0 -1
  254. package/target/main/typescript/impl/core/ImplTypes.js +0 -43
  255. package/target/main/typescript/impl/core/ImplTypes.js.map +0 -1
  256. package/target/main/typescript/impl/i18n/Messages.js +0 -114
  257. package/target/main/typescript/impl/i18n/Messages.js.map +0 -1
  258. package/target/main/typescript/impl/util/Assertions.js +0 -90
  259. package/target/main/typescript/impl/util/Assertions.js.map +0 -1
  260. package/target/main/typescript/impl/util/AsyncQueue.js +0 -104
  261. package/target/main/typescript/impl/util/AsyncQueue.js.map +0 -1
  262. package/target/main/typescript/impl/util/AsyncRunnable.js.map +0 -1
  263. package/target/main/typescript/impl/util/ExtDomQuery.js +0 -129
  264. package/target/main/typescript/impl/util/ExtDomQuery.js.map +0 -1
  265. package/target/main/typescript/impl/util/Lang.js +0 -215
  266. package/target/main/typescript/impl/util/Lang.js.map +0 -1
  267. package/target/main/typescript/impl/util/ListenerQueue.js +0 -3
  268. package/target/main/typescript/impl/util/ListenerQueue.js.map +0 -1
  269. package/target/main/typescript/impl/xhrCore/ErrorData.js +0 -89
  270. package/target/main/typescript/impl/xhrCore/ErrorData.js.map +0 -1
  271. package/target/main/typescript/impl/xhrCore/EventData.js +0 -30
  272. package/target/main/typescript/impl/xhrCore/EventData.js.map +0 -1
  273. package/target/main/typescript/impl/xhrCore/IResponseProcessor.js +0 -3
  274. package/target/main/typescript/impl/xhrCore/IResponseProcessor.js.map +0 -1
  275. package/target/main/typescript/impl/xhrCore/RequestDataResolver.js +0 -143
  276. package/target/main/typescript/impl/xhrCore/RequestDataResolver.js.map +0 -1
  277. package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js +0 -103
  278. package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js.map +0 -1
  279. package/target/main/typescript/impl/xhrCore/Response.js +0 -167
  280. package/target/main/typescript/impl/xhrCore/Response.js.map +0 -1
  281. package/target/main/typescript/impl/xhrCore/ResponseProcessor.js +0 -368
  282. package/target/main/typescript/impl/xhrCore/ResponseProcessor.js.map +0 -1
  283. package/target/main/typescript/impl/xhrCore/XhrFormData.js +0 -272
  284. package/target/main/typescript/impl/xhrCore/XhrFormData.js.map +0 -1
  285. package/target/main/typescript/impl/xhrCore/XhrRequest.js +0 -281
  286. package/target/main/typescript/impl/xhrCore/XhrRequest.js.map +0 -1
  287. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.js +0 -293
  288. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.js.map +0 -1
  289. package/target/test/frameworkBase/_ext/monadish/LangTest.js +0 -89
  290. package/target/test/frameworkBase/_ext/monadish/LangTest.js.map +0 -1
  291. package/target/test/frameworkBase/_ext/monadish/MappingTest.js +0 -39
  292. package/target/test/frameworkBase/_ext/monadish/MappingTest.js.map +0 -1
  293. package/target/test/frameworkBase/_ext/monadish/MonadTest.js +0 -155
  294. package/target/test/frameworkBase/_ext/monadish/MonadTest.js.map +0 -1
  295. package/target/test/frameworkBase/_ext/monadish/StreamTest.js +0 -176
  296. package/target/test/frameworkBase/_ext/monadish/StreamTest.js.map +0 -1
  297. package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.js +0 -1
  298. package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.js.map +0 -1
  299. package/target/test/typescript/frameworkBase/LangTest.js +0 -112
  300. package/target/test/typescript/frameworkBase/LangTest.js.map +0 -1
  301. package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js +0 -293
  302. package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js.map +0 -1
  303. package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js +0 -89
  304. package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js.map +0 -1
  305. package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js +0 -115
  306. package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
  307. package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js +0 -39
  308. package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js.map +0 -1
  309. package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js +0 -155
  310. package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js.map +0 -1
  311. package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js +0 -176
  312. package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js.map +0 -1
  313. package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js +0 -1
  314. package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js.map +0 -1
  315. package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js +0 -264
  316. package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
  317. package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js +0 -23
  318. package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
  319. package/target/test/typescript/impl/ImplTest.js +0 -98
  320. package/target/test/typescript/impl/ImplTest.js.map +0 -1
  321. package/target/test/typescript/impl/SeparatorCharsTest.js +0 -72
  322. package/target/test/typescript/impl/SeparatorCharsTest.js.map +0 -1
  323. package/target/test/typescript/queue/AsynchronousProbe.js +0 -99
  324. package/target/test/typescript/queue/AsynchronousProbe.js.map +0 -1
  325. package/target/test/typescript/queue/AsynchronousQueueTest.js +0 -130
  326. package/target/test/typescript/queue/AsynchronousQueueTest.js.map +0 -1
  327. package/target/test/typescript/xhrCore/EventTests.js +0 -155
  328. package/target/test/typescript/xhrCore/EventTests.js.map +0 -1
  329. package/target/test/typescript/xhrCore/FakeWebsocket.js +0 -25
  330. package/target/test/typescript/xhrCore/FakeWebsocket.js.map +0 -1
  331. package/target/test/typescript/xhrCore/FileUploadTest.js +0 -166
  332. package/target/test/typescript/xhrCore/FileUploadTest.js.map +0 -1
  333. package/target/test/typescript/xhrCore/RequestParamsTest.js +0 -151
  334. package/target/test/typescript/xhrCore/RequestParamsTest.js.map +0 -1
  335. package/target/test/typescript/xhrCore/RequestTest.js.map +0 -1
  336. package/target/test/typescript/xhrCore/ResponseTest.js +0 -257
  337. package/target/test/typescript/xhrCore/ResponseTest.js.map +0 -1
  338. package/target/test/typescript/xhrCore/ShadowDomTest.js +0 -122
  339. package/target/test/typescript/xhrCore/ShadowDomTest.js.map +0 -1
  340. package/target/test/typescript/xhrCore/WebsocketTest.js +0 -182
  341. package/target/test/typescript/xhrCore/WebsocketTest.js.map +0 -1
  342. package/target/test/typescript/xhrCore/XhrFormDataTest.js +0 -58
  343. package/target/test/typescript/xhrCore/XhrFormDataTest.js.map +0 -1
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "jsf.js_next_gen",
3
- "version": "1.0.0-beta-20",
3
+ "version": "4.0.0-RC.1",
4
4
  "description": "A next generation typescript reimplementation of jsf.js",
5
- "main": "dist/window/jsf.js",
5
+ "main": "dist/window/faces.js",
6
6
  "scripts": {
7
7
  "doc": "npx typedoc --tsconfig src/main/typescript/tsconfig-typedoc.json",
8
8
  "test": "env TS_NODE_PROJECT=./src/main/typescript/tsconfig.json mocha",
@@ -22,32 +22,32 @@
22
22
  "devDependencies": {
23
23
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
24
24
  "@types/chai": "^4.3.3",
25
- "@types/mocha": "^9.1.1",
26
- "@types/node": "^18.7.18",
25
+ "@types/mocha": "^10.0.0",
26
+ "@types/node": "^18.11.9",
27
27
  "@types/sinon": "^10.0.13",
28
28
  "babel-plugin-syntax-dynamic-import": "^6.18.0",
29
29
  "chai": "^4.3.6",
30
30
  "compression-webpack-plugin": "^10.0.0",
31
31
  "html-webpack-plugin": "^5.5.0",
32
32
  "http-server": "^14.1.1",
33
- "jsdom": "^20.0.0",
33
+ "jsdom": "^20.0.2",
34
34
  "jsdom-global": "^3.0.2",
35
- "mocha": "^10.0.0",
36
- "npm-check-updates": "^16.2.1",
35
+ "mocha": "^10.1.0",
36
+ "npm-check-updates": "^16.3.16",
37
37
  "nyc": "^15.1.0",
38
38
  "replace-in-file": "^6.3.5",
39
- "rxjs": "^7.5.6",
40
- "sinon": "^14.0.0",
39
+ "rxjs": "^7.5.7",
40
+ "sinon": "^14.0.1",
41
41
  "terser-webpack-plugin": "^5.3.6",
42
42
  "ts-loader": "^9.4.1",
43
43
  "ts-node": "^10.9.1",
44
- "typedoc": "^0.23.15",
45
- "typescript": "^4.8.3",
44
+ "typedoc": "^0.23.20",
45
+ "typescript": "^4.8.4",
46
46
  "webpack": "^5.74.0",
47
47
  "webpack-cli": "^4.10.0",
48
48
  "webpack-dev-server": "^4.11.1"
49
49
  },
50
50
  "dependencies": {
51
- "mona-dish": "0.21.17"
51
+ "mona-dish": "0.23.5"
52
52
  }
53
53
  }
package/pom.xml CHANGED
@@ -16,6 +16,7 @@
16
16
 
17
17
  <properties>
18
18
  <java.version>1.8</java.version>
19
+ <myfaces-version>4.0.0-SNAPSHOT</myfaces-version>
19
20
  </properties>
20
21
 
21
22
  <dependencies>
@@ -40,6 +41,19 @@
40
41
  <artifactId>spring-boot-starter-test</artifactId>
41
42
  <scope>test</scope>
42
43
  </dependency>
44
+ <dependency>
45
+ <groupId>org.apache.myfaces.core</groupId>
46
+ <artifactId>myfaces-api</artifactId>
47
+ <version>${myfaces-version}</version>
48
+ <scope>provided</scope>
49
+ </dependency>
50
+
51
+ <dependency>
52
+ <groupId>org.apache.myfaces.core</groupId>
53
+ <artifactId>myfaces-impl</artifactId>
54
+ <version>${myfaces-version}</version>
55
+ <scope>provided</scope>
56
+ </dependency>
43
57
  </dependencies>
44
58
 
45
59
  <build>
@@ -0,0 +1,94 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+ package com.example.jsfs_js_ts;
20
+
21
+ import jakarta.faces.application.Resource;
22
+ import jakarta.faces.context.FacesContext;
23
+
24
+ import java.io.*;
25
+ import java.net.URL;
26
+ import java.util.Map;
27
+
28
+ /**
29
+ * This class replicates a certain behavior we have
30
+ * in myfaces for the internal faces.js (which is based
31
+ * upon this projects code)
32
+ * MyFaces has a resource loader
33
+ * which replaces el constructs with their variable values, in faces.js
34
+ * We replicate this here in a somewhat hackish manner, atm
35
+ * only the context path is generated this way, because
36
+ * for other constructs which we use it we have pure js fallbacks
37
+ * delivering the same values
38
+ *
39
+ * You can use this class if you need or to provide the requestContextPath
40
+ * on js level (and extend it if you need to provide more)
41
+ */
42
+ public class DecoratedFacesJS extends Resource {
43
+
44
+ Resource delegate;
45
+
46
+ public DecoratedFacesJS(Resource delegate) {
47
+ this.delegate = delegate;
48
+ }
49
+
50
+ @Override
51
+ public InputStream getInputStream() throws IOException {
52
+ try (
53
+ InputStream inputStream = delegate.getInputStream();
54
+ ByteArrayOutputStream writer = new ByteArrayOutputStream();
55
+ ) {
56
+ new BufferedReader(new InputStreamReader(inputStream))
57
+ .lines()
58
+ .map(line -> {
59
+ //we theoretically could replace this with an el resolver
60
+ //but for now checking for the exact pattern suffices
61
+ String PATTERN = "#{facesContext.externalContext.requestContextPath}";
62
+ return line != null && line.contains(PATTERN) ? line.replace(PATTERN, FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath()) : line;
63
+ }).forEach(line -> {
64
+ try {
65
+ writer.write(line.getBytes());
66
+ writer.write("\n".getBytes());
67
+ } catch (IOException e) {
68
+ throw new RuntimeException(e);
69
+ }
70
+ });
71
+ return new ByteArrayInputStream(writer.toByteArray());
72
+ }
73
+ }
74
+
75
+ @Override
76
+ public String getRequestPath() {
77
+ return delegate.getRequestPath();
78
+ }
79
+
80
+ @Override
81
+ public Map<String, String> getResponseHeaders() {
82
+ return delegate.getResponseHeaders();
83
+ }
84
+
85
+ @Override
86
+ public URL getURL() {
87
+ return delegate.getURL();
88
+ }
89
+
90
+ @Override
91
+ public boolean userAgentNeedsUpdate(FacesContext context) {
92
+ return delegate.userAgentNeedsUpdate(context);
93
+ }
94
+ }
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+ package com.example.jsfs_js_ts;
20
+
21
+ import jakarta.faces.application.Resource;
22
+ import jakarta.faces.application.ResourceHandler;
23
+ import jakarta.faces.application.ResourceHandlerWrapper;
24
+
25
+ /**
26
+ * a decorator which can be used to replace the templated variables in faces.js
27
+ * with their real world counterparts
28
+ */
29
+ public class DecoratingResourceHandlerWrapper extends ResourceHandlerWrapper {
30
+ public DecoratingResourceHandlerWrapper(ResourceHandler delegate) {
31
+ super(delegate);
32
+ }
33
+
34
+ @Override
35
+ public Resource createResource(String resourceName) {
36
+ if (resourceName.contains("faces.js") || resourceName.contains("faces-development.js")) {
37
+ return new DecoratedFacesJS(super.createResource(resourceName));
38
+ }
39
+ return super.createResource(resourceName);
40
+ }
41
+
42
+ @Override
43
+ public Resource createResource(String resourceName, String libraryName) {
44
+ if (resourceName.contains("faces.js") || resourceName.contains("faces-development.js")) {
45
+ return new DecoratedFacesJS(super.createResource(resourceName, libraryName));
46
+ }
47
+ return super.createResource(resourceName, libraryName);
48
+ }
49
+
50
+ @Override
51
+ public Resource createResource(String resourceName, String libraryName, String contentType) {
52
+ return super.createResource(resourceName, libraryName, contentType);
53
+ }
54
+ }
@@ -0,0 +1,57 @@
1
+ /* Licensed to the Apache Software Foundation (ASF) under one or more
2
+ * contributor license agreements. See the NOTICE file distributed with
3
+ * this work for additional information regarding copyright ownership.
4
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5
+ * (the "License"); you may not use this file except in compliance with
6
+ * 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
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package com.example.jsfs_js_ts;
17
+
18
+ import jakarta.faces.application.Resource;
19
+ import jakarta.faces.application.ResourceHandler;
20
+ import jakarta.faces.application.ResourceHandlerWrapper;
21
+
22
+ /**
23
+ * this class decorates a resource handler
24
+ * which dynamically adds the correct mapping data to the
25
+ * faces.js file depending on the configuration
26
+ *
27
+ * Note, you only need this class in your own projects, if you add
28
+ * the scripts to a Faces resource library.
29
+ * MyFaces itself has a similar mechanism in 4.0.0+ placed
30
+ * directly in the resource handler code.
31
+ */
32
+ public class FacesJSMapFileResourceWrapper extends ResourceHandlerWrapper {
33
+ public FacesJSMapFileResourceWrapper(ResourceHandler delegate) {
34
+ super(delegate);
35
+ }
36
+
37
+ @Override
38
+ public Resource createResource(String resourceName) {
39
+ if (resourceName.contains("faces.js") || resourceName.contains("faces-development.js")) {
40
+ return new DecoratedFacesJS(super.createResource(resourceName));
41
+ }
42
+ return super.createResource(resourceName);
43
+ }
44
+
45
+ @Override
46
+ public Resource createResource(String resourceName, String libraryName) {
47
+ if (!resourceName.contains(".map") && (resourceName.contains("faces.js") || resourceName.contains("faces-development.js"))) {
48
+ return new FacesJSMappingDecorator(super.createResource(resourceName, libraryName));
49
+ }
50
+ return super.createResource(resourceName, libraryName);
51
+ }
52
+
53
+ @Override
54
+ public Resource createResource(String resourceName, String libraryName, String contentType) {
55
+ return super.createResource(resourceName, libraryName, contentType);
56
+ }
57
+ }
@@ -0,0 +1,138 @@
1
+ /* Licensed to the Apache Software Foundation (ASF) under one or more
2
+ * contributor license agreements. See the NOTICE file distributed with
3
+ * this work for additional information regarding copyright ownership.
4
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5
+ * (the "License"); you may not use this file except in compliance with
6
+ * 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
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package com.example.jsfs_js_ts;
17
+
18
+ import jakarta.faces.FacesException;
19
+ import jakarta.faces.application.Resource;
20
+ import jakarta.faces.context.FacesContext;
21
+
22
+ import java.io.*;
23
+ import java.net.MalformedURLException;
24
+ import java.net.URL;
25
+ import java.util.Map;
26
+
27
+ /**
28
+ * The core implementation of the mapping file decoration.
29
+ * We basically rip out the old mapping file reference
30
+ * and add the new one, on the fly, when the resource is loaded.
31
+ */
32
+ public class FacesJSMappingDecorator extends Resource {
33
+
34
+ public static final String URL_ENCODING = "UTF-8";
35
+ Resource delegate;
36
+
37
+ public FacesJSMappingDecorator(Resource delegate) {
38
+ this.delegate = delegate;
39
+ }
40
+
41
+ @Override
42
+ public InputStream getInputStream() throws IOException {
43
+ try (
44
+ InputStream inputStream = delegate.getInputStream();
45
+ ByteArrayOutputStream writer = new ByteArrayOutputStream();
46
+ ) {
47
+ new BufferedReader(new InputStreamReader(inputStream))
48
+ .lines()
49
+ .forEach(line -> {
50
+ if (line.contains("//# sourceMappingURL=")) {
51
+ return;
52
+ }
53
+ try {
54
+ writer.write(line.getBytes());
55
+ writer.write("\n".getBytes());
56
+ } catch (IOException e) {
57
+ throw new FacesException(e);
58
+ }
59
+ });
60
+ // let´s add the decoration
61
+ String resourcePath = remapNames(delegate.getRequestPath());
62
+ resourcePath = resourcePath.substring(resourcePath.lastIndexOf("/") + 1);
63
+
64
+ writer.write("\n//# sourceMappingURL=".getBytes());
65
+ writer.write(resourcePath.getBytes());
66
+ return new ByteArrayInputStream(writer.toByteArray());
67
+ }
68
+ }
69
+
70
+ @Override
71
+ public String getRequestPath() {
72
+ return delegate.getRequestPath();
73
+ }
74
+
75
+ @Override
76
+ public Map<String, String> getResponseHeaders() {
77
+ return delegate.getResponseHeaders();
78
+ }
79
+
80
+ @Override
81
+ public URL getURL() {
82
+ try {
83
+ return remapNames(delegate.getURL());
84
+ } catch (MalformedURLException e) {
85
+ throw new FacesException(e);
86
+ }
87
+ }
88
+
89
+ @Override
90
+ public boolean userAgentNeedsUpdate(FacesContext context) {
91
+ return delegate.userAgentNeedsUpdate(context);
92
+ }
93
+
94
+ @Override
95
+ public String getContentType() {
96
+ return delegate.getContentType();
97
+ }
98
+
99
+ @Override
100
+ public String getLibraryName() {
101
+ return delegate.getLibraryName();
102
+ }
103
+
104
+ @Override
105
+ public String getResourceName() {
106
+ return remapNames(delegate.getResourceName());
107
+ }
108
+
109
+ @Override
110
+ public void setContentType(String contentType) {
111
+ delegate.setContentType(contentType);
112
+ }
113
+
114
+ @Override
115
+ public void setLibraryName(String libraryName) {
116
+ delegate.setLibraryName(libraryName);
117
+ }
118
+
119
+ @Override
120
+ public void setResourceName(String resourceName) {
121
+ delegate.setResourceName(resourceName);
122
+ }
123
+
124
+ @Override
125
+ public String toString() {
126
+ return delegate.toString();
127
+ }
128
+
129
+ private String remapNames(String in) {
130
+ return in.replace("faces-development.js", "faces-development.js.map")
131
+ .replace("faces.js", "faces.js.map");
132
+ }
133
+
134
+ private URL remapNames(URL in) throws MalformedURLException {
135
+ return new URL(in.toString().replace("faces-development.js", "faces-development.js.map")
136
+ .replace("faces.js", "faces.js.map"));
137
+ }
138
+ }
@@ -0,0 +1,147 @@
1
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
2
+ * contributor license agreements. See the NOTICE file distributed with
3
+ * this work for additional information regarding copyright ownership.
4
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5
+ * (the "License"); you may not use this file except in compliance with
6
+ * 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
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ /**
18
+ * Basic internal types used
19
+ *
20
+ * This file is only there to allow global calls into window, faces and ajax
21
+ * in a typesafe manner, hence eliminating <b>any</b> casts.
22
+ */
23
+ declare global {
24
+
25
+ type Consumer<T> = (s?: T) => void;
26
+ type AssocArr<T> = { [key: string]: T };
27
+ type EvalFuncs = Array<Function | string>;
28
+ type Options = { [key: string]: string | Function | { [key: string]: string | Function } };
29
+ type Context = AssocArr<any>;
30
+ type ElemDef = Element | string;
31
+
32
+ /**
33
+ * * <ul>
34
+ * <li> errorData.type : &quot;error&quot;</li>
35
+ * <li> errorData.status : the error status message</li>
36
+ * <li> errorData.serverErrorName : the server error name in case of a server error</li>
37
+ * <li> errorData.serverErrorMessage : the server error message in case of a server error</li>
38
+ * <li> errorData.source : the issuing source element which triggered the requestInternal </li>
39
+ * <li> eventData.responseCode: the response code (aka http requestInternal response code, 401 etc...) </li>
40
+ * <li> eventData.responseText: the requestInternal response text </li>
41
+ * <li> eventData.responseXML: the requestInternal response xml </li>
42
+ * </ul>
43
+ */
44
+ interface IErrorData {
45
+ type: any;
46
+ status: string;
47
+ serverErrorName: string;
48
+ serverErrorMessage: string;
49
+ source: any;
50
+ responseCode: string;
51
+ responseText: string;
52
+ responseXML: string;
53
+ }
54
+
55
+ /**
56
+ * <ul>
57
+ * <li>status: status of the ajax cycle</li>
58
+ * </ul>
59
+ */
60
+ interface IEventData {
61
+ status: String;
62
+ source: any;
63
+ }
64
+
65
+ interface Ajax {
66
+ request(element: Element, event?: Event, options?: Context): void;
67
+ response(request: XMLHttpRequest, context?: Context): void;
68
+ }
69
+
70
+ interface Util {
71
+ chain(source, event, ...funcs: Array<Function | string>): boolean;
72
+ }
73
+
74
+ interface Push {
75
+ init(socketClientId: string,
76
+ uri: string,
77
+ channel: string,
78
+ onopen: Function,
79
+ onmessage: Function,
80
+ onclose: Function,
81
+ behaviorScripts: any,
82
+ autoconnect: boolean): void;
83
+ open(socketClientId: string);
84
+ close(socketClientId: string): void;
85
+ }
86
+
87
+ interface FacesAPI {
88
+ contextpath: string;
89
+ specversion: number;
90
+ implversion: number;
91
+ separatorchar: string;
92
+
93
+ getProjectStage(): string;
94
+ getViewState(formElement: Element | string): string;
95
+ getClientWindow(rootNode?: Element | string): string;
96
+ getSeparatorChar(): string;
97
+ response(request: XMLHttpRequest, context?: Context): void;
98
+ addOnError(errorFunc: (data: IErrorData) => void): void;
99
+ addOnEvent(eventFunc: (data: IEventData) => void): void;
100
+
101
+ ajax: Ajax;
102
+ util: Util;
103
+ push: Push;
104
+ }
105
+
106
+ interface OAM {
107
+ clearHiddenInput(formName: string, name: string): void;
108
+ setHiddenInput(formName: string, name: string, value: string): void;
109
+ submitForm(formName: string, linkId: string, target: string, params: { [key: string]: any }): boolean;
110
+ }
111
+
112
+ interface MyFacesAPI {
113
+ ab(source: Element, event: Event, eventName: string, execute: string, render: string, options: Context): void;
114
+
115
+ config: { [key: string]: any };
116
+ oam: OAM;
117
+ core: {
118
+ config ?: {[key: string]: any};
119
+ };
120
+ }
121
+
122
+ /*
123
+ * Global namespaces type definitions
124
+ */
125
+ let myfaces: MyFacesAPI;
126
+ let jsf: FacesAPI;
127
+ let faces: FacesAPI;
128
+
129
+ // special "magic", Typescript merges whatever we have
130
+ // to window. This is a language "hack", but documented.
131
+ // see https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html
132
+ // lib.dom.d.ts declares the type Window as being type for window.
133
+ // noinspection JSUnusedGlobalSymbols
134
+ interface Window {
135
+ myfaces: MyFacesAPI,
136
+ faces: FacesAPI,
137
+ jsf: FacesAPI,
138
+ XMLHttpRequest: XMLHttpRequest,
139
+ called: { [key: string]: any }
140
+ }
141
+ }
142
+
143
+ // this is needed to tell the compiler that we have an ambient
144
+ // module, otherwise the global overload would produce an error
145
+ // https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html
146
+ // noinspection JSUnusedGlobalSymbols
147
+ export var __my_faces_ambient_module_glob_;