@nativescript/core 9.0.0-alpha.5 → 9.0.0-next-07-20-2025-16403500407

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 (481) hide show
  1. package/accessibility/accessibility-common.d.ts +0 -264
  2. package/accessibility/accessibility-common.js +0 -352
  3. package/accessibility/accessibility-common.js.map +1 -1
  4. package/accessibility/accessibility-css-helper.d.ts +1 -0
  5. package/accessibility/accessibility-css-helper.js +101 -0
  6. package/accessibility/accessibility-css-helper.js.map +1 -0
  7. package/accessibility/accessibility-properties.d.ts +1 -1
  8. package/accessibility/accessibility-properties.js +2 -2
  9. package/accessibility/accessibility-properties.js.map +1 -1
  10. package/accessibility/accessibility-service-common.d.ts +8 -0
  11. package/accessibility/accessibility-service-common.js +26 -0
  12. package/accessibility/accessibility-service-common.js.map +1 -0
  13. package/accessibility/accessibility-service.android.d.ts +6 -0
  14. package/accessibility/accessibility-service.android.js +103 -0
  15. package/accessibility/accessibility-service.android.js.map +1 -0
  16. package/accessibility/accessibility-service.d.ts +10 -0
  17. package/accessibility/accessibility-service.ios.d.ts +6 -0
  18. package/accessibility/accessibility-service.ios.js +61 -0
  19. package/accessibility/accessibility-service.ios.js.map +1 -0
  20. package/accessibility/accessibility-types.d.ts +224 -0
  21. package/accessibility/accessibility-types.js +222 -0
  22. package/accessibility/accessibility-types.js.map +1 -0
  23. package/accessibility/font-scale-common.d.ts +7 -0
  24. package/accessibility/font-scale-common.js +14 -0
  25. package/accessibility/font-scale-common.js.map +1 -0
  26. package/accessibility/font-scale.android.d.ts +5 -0
  27. package/accessibility/font-scale.android.js +55 -0
  28. package/accessibility/font-scale.android.js.map +1 -0
  29. package/accessibility/font-scale.d.ts +9 -0
  30. package/accessibility/font-scale.ios.d.ts +5 -0
  31. package/accessibility/font-scale.ios.js +89 -0
  32. package/accessibility/font-scale.ios.js.map +1 -0
  33. package/accessibility/index.android.d.ts +10 -0
  34. package/accessibility/index.android.js +577 -0
  35. package/accessibility/index.android.js.map +1 -0
  36. package/accessibility/index.d.ts +36 -0
  37. package/accessibility/index.ios.d.ts +9 -0
  38. package/accessibility/index.ios.js +229 -0
  39. package/accessibility/index.ios.js.map +1 -0
  40. package/application/application-common.d.ts +8 -6
  41. package/application/application-common.js +14 -21
  42. package/application/application-common.js.map +1 -1
  43. package/application/application-interfaces.d.ts +3 -2
  44. package/application/application.android.d.ts +7 -14
  45. package/application/application.android.js +75 -754
  46. package/application/application.android.js.map +1 -1
  47. package/application/application.d.ts +0 -25
  48. package/application/application.ios.d.ts +18 -16
  49. package/application/application.ios.js +45 -455
  50. package/application/application.ios.js.map +1 -1
  51. package/application-settings/index.android.js +2 -2
  52. package/application-settings/index.android.js.map +1 -1
  53. package/cli-hooks/{before-checkForChanges.mjs → before-checkForChanges.js} +6 -6
  54. package/cli-hooks/postinstall.js +2 -0
  55. package/cli-hooks/preuninstall.js +2 -0
  56. package/color/color-common.d.ts +19 -18
  57. package/color/color-common.js +14 -13
  58. package/color/color-common.js.map +1 -1
  59. package/color/index.ios.d.ts +1 -2
  60. package/color/index.ios.js.map +1 -1
  61. package/connectivity/index.android.js +4 -5
  62. package/connectivity/index.android.js.map +1 -1
  63. package/core-types/index.d.ts +1 -1
  64. package/core-types/index.js +2 -2
  65. package/core-types/index.js.map +1 -1
  66. package/css/css-tree-parser.js +21 -17
  67. package/css/css-tree-parser.js.map +1 -1
  68. package/css/lib/parse/index.js +577 -475
  69. package/css/package.json +36 -0
  70. package/css/reworkcss.d.ts +28 -25
  71. package/css/reworkcss.js +1 -5
  72. package/css-mediaquery/index.js +1 -1
  73. package/css-mediaquery/index.js.map +1 -1
  74. package/css-value/package.json +23 -0
  75. package/css-value/reworkcss-value.d.ts +8 -31
  76. package/css-value/reworkcss-value.js +111 -89
  77. package/debugger/devtools-elements-interfaces.d.ts +1 -1
  78. package/debugger/devtools-elements.common.js +8 -17
  79. package/debugger/devtools-elements.common.js.map +1 -1
  80. package/debugger/devtools-elements.js +1 -1
  81. package/debugger/devtools-elements.js.map +1 -1
  82. package/debugger/dom-node.d.ts +27 -0
  83. package/debugger/{dom-types.js → dom-node.js} +9 -11
  84. package/debugger/dom-node.js.map +1 -0
  85. package/debugger/webinspector-css.d.ts +18 -18
  86. package/debugger/webinspector-css.js +1 -1
  87. package/debugger/webinspector-css.js.map +1 -1
  88. package/debugger/webinspector-dom.d.ts +15 -15
  89. package/debugger/webinspector-dom.js +1 -1
  90. package/debugger/webinspector-dom.js.map +1 -1
  91. package/debugger/webinspector-network.android.d.ts +9 -9
  92. package/debugger/webinspector-network.android.js +3 -3
  93. package/debugger/webinspector-network.android.js.map +1 -1
  94. package/debugger/webinspector-network.ios.d.ts +9 -9
  95. package/debugger/webinspector-network.ios.js +1 -1
  96. package/debugger/webinspector-network.ios.js.map +1 -1
  97. package/fetch/index.js +458 -448
  98. package/file-system/file-system-access.android.js +39 -32
  99. package/file-system/file-system-access.android.js.map +1 -1
  100. package/file-system/index.d.ts +2 -2
  101. package/file-system/index.js +11 -4
  102. package/file-system/index.js.map +1 -1
  103. package/fps-meter/fps-native.android.d.ts +2 -1
  104. package/fps-meter/fps-native.android.js.map +1 -1
  105. package/fps-meter/fps-native.ios.d.ts +2 -1
  106. package/fps-meter/fps-native.ios.js.map +1 -1
  107. package/global-types.d.ts +1 -1
  108. package/globals/index.js +288 -254
  109. package/globals/index.js.map +1 -1
  110. package/http/http-request/http-request-common.js +2 -2
  111. package/http/http-request/http-request-common.js.map +1 -1
  112. package/http/http-request/index.android.d.ts +7 -3
  113. package/http/http-request/index.android.js +22 -6
  114. package/http/http-request/index.android.js.map +1 -1
  115. package/http/http-request/index.d.ts +1 -5
  116. package/http/http-request/index.ios.d.ts +7 -3
  117. package/http/http-request/index.ios.js +22 -6
  118. package/http/http-request/index.ios.js.map +1 -1
  119. package/http/index.d.ts +105 -6
  120. package/http/index.js +12 -10
  121. package/http/index.js.map +1 -1
  122. package/image-asset/index.android.js +3 -3
  123. package/image-asset/index.android.js.map +1 -1
  124. package/image-source/index.android.d.ts +1 -1
  125. package/image-source/index.android.js +23 -5
  126. package/image-source/index.android.js.map +1 -1
  127. package/image-source/index.ios.js +9 -2
  128. package/image-source/index.ios.js.map +1 -1
  129. package/index.d.ts +8 -12
  130. package/index.js +3 -6
  131. package/index.js.map +1 -1
  132. package/inspector_modules.d.ts +0 -3
  133. package/inspector_modules.js +3 -6
  134. package/inspector_modules.js.map +1 -1
  135. package/js-libs/easysax/easysax.js +3 -5
  136. package/media-query-list/index.js +17 -7
  137. package/media-query-list/index.js.map +1 -1
  138. package/module-name-resolver/index.d.ts +11 -2
  139. package/module-name-resolver/index.js +18 -6
  140. package/module-name-resolver/index.js.map +1 -1
  141. package/module-name-resolver/non-bundle-workflow-compat.js +23 -32
  142. package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
  143. package/package.json +5 -8
  144. package/platform/device/index.android.js +2 -2
  145. package/platform/device/index.android.js.map +1 -1
  146. package/platform/screen/index.android.js +2 -2
  147. package/platform/screen/index.android.js.map +1 -1
  148. package/platform/screen/index.ios.js +2 -2
  149. package/platform/screen/index.ios.js.map +1 -1
  150. package/profiling/index.js +1 -2
  151. package/profiling/index.js.map +1 -1
  152. package/ui/action-bar/action-bar-common.js +2 -4
  153. package/ui/action-bar/action-bar-common.js.map +1 -1
  154. package/ui/action-bar/index.android.js +6 -7
  155. package/ui/action-bar/index.android.js.map +1 -1
  156. package/ui/action-bar/index.ios.js +11 -10
  157. package/ui/action-bar/index.ios.js.map +1 -1
  158. package/ui/activity-indicator/index.ios.js +4 -3
  159. package/ui/activity-indicator/index.ios.js.map +1 -1
  160. package/ui/animation/animation-common.d.ts +4 -4
  161. package/ui/animation/animation-common.js +3 -2
  162. package/ui/animation/animation-common.js.map +1 -1
  163. package/ui/animation/{animation-shared.d.ts → animation-interfaces.d.ts} +31 -39
  164. package/{core-types/animation-types.js → ui/animation/animation-interfaces.js} +1 -1
  165. package/ui/animation/animation-interfaces.js.map +1 -0
  166. package/ui/animation/index.android.d.ts +2 -1
  167. package/ui/animation/index.android.js +5 -5
  168. package/ui/animation/index.android.js.map +1 -1
  169. package/ui/animation/index.d.ts +138 -2
  170. package/ui/animation/index.ios.d.ts +2 -1
  171. package/ui/animation/index.ios.js +3 -3
  172. package/ui/animation/index.ios.js.map +1 -1
  173. package/ui/animation/keyframe-animation.d.ts +118 -67
  174. package/ui/animation/keyframe-animation.js +2 -2
  175. package/ui/animation/keyframe-animation.js.map +1 -1
  176. package/ui/builder/component-builder/index.js +2 -2
  177. package/ui/builder/component-builder/index.js.map +1 -1
  178. package/ui/builder/index.js +3 -415
  179. package/ui/builder/index.js.map +1 -1
  180. package/ui/builder/xml2ui.d.ts +134 -0
  181. package/ui/builder/xml2ui.js +397 -0
  182. package/ui/builder/xml2ui.js.map +1 -0
  183. package/ui/button/index.android.js +1 -2
  184. package/ui/button/index.android.js.map +1 -1
  185. package/ui/core/bindable/index.d.ts +38 -2
  186. package/ui/core/bindable/index.js +2 -1
  187. package/ui/core/bindable/index.js.map +1 -1
  188. package/ui/core/properties/index.d.ts +37 -4
  189. package/ui/core/properties/index.js +35 -6
  190. package/ui/core/properties/index.js.map +1 -1
  191. package/ui/core/view/index.android.d.ts +2 -2
  192. package/ui/core/view/index.android.js +10 -13
  193. package/ui/core/view/index.android.js.map +1 -1
  194. package/ui/core/view/index.d.ts +61 -1
  195. package/ui/core/view/index.ios.d.ts +3 -3
  196. package/ui/core/view/index.ios.js +13 -21
  197. package/ui/core/view/index.ios.js.map +1 -1
  198. package/ui/core/view/view-common.d.ts +16 -19
  199. package/ui/core/view/view-common.js +14 -12
  200. package/ui/core/view/view-common.js.map +1 -1
  201. package/ui/core/view/view-helper/index.ios.d.ts +1 -2
  202. package/ui/core/view/view-helper/index.ios.js +4 -3
  203. package/ui/core/view/view-helper/index.ios.js.map +1 -1
  204. package/ui/core/view/view-helper/view-helper-common.js +3 -1
  205. package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
  206. package/ui/core/view-base/index.d.ts +25 -23
  207. package/ui/core/view-base/index.js +30 -9
  208. package/ui/core/view-base/index.js.map +1 -1
  209. package/ui/dialogs/dialogs-common.js +3 -3
  210. package/ui/dialogs/dialogs-common.js.map +1 -1
  211. package/ui/dialogs/index.android.js +7 -8
  212. package/ui/dialogs/index.android.js.map +1 -1
  213. package/ui/dialogs/index.ios.js +2 -2
  214. package/ui/dialogs/index.ios.js.map +1 -1
  215. package/ui/embedding/index.android.d.ts +1 -1
  216. package/ui/embedding/index.d.ts +1 -1
  217. package/ui/frame/callbacks/activity-callbacks.d.ts +19 -0
  218. package/ui/frame/callbacks/activity-callbacks.js +301 -0
  219. package/ui/frame/callbacks/activity-callbacks.js.map +1 -0
  220. package/ui/frame/{frame-helper-for-android.d.ts → callbacks/fragment-callbacks.d.ts} +1 -20
  221. package/ui/frame/{frame-helper-for-android.js → callbacks/fragment-callbacks.js} +38 -52
  222. package/ui/frame/callbacks/fragment-callbacks.js.map +1 -0
  223. package/ui/frame/fragment.android.js +2 -3
  224. package/ui/frame/fragment.android.js.map +1 -1
  225. package/ui/frame/fragment.transitions.android.js.map +1 -1
  226. package/ui/frame/frame-common.d.ts +2 -2
  227. package/ui/frame/frame-common.js.map +1 -1
  228. package/ui/frame/frame-interfaces.d.ts +4 -4
  229. package/ui/frame/frame-interfaces.js.map +1 -1
  230. package/ui/frame/frame-stack.js.map +1 -1
  231. package/ui/frame/index.android.d.ts +5 -20
  232. package/ui/frame/index.android.js +19 -296
  233. package/ui/frame/index.android.js.map +1 -1
  234. package/ui/frame/index.d.ts +19 -18
  235. package/ui/frame/index.ios.d.ts +1 -1
  236. package/ui/frame/index.ios.js +4 -5
  237. package/ui/frame/index.ios.js.map +1 -1
  238. package/ui/gestures/gestures-common.d.ts +273 -4
  239. package/ui/gestures/gestures-common.js +146 -3
  240. package/ui/gestures/gestures-common.js.map +1 -1
  241. package/ui/gestures/index.android.d.ts +1 -29
  242. package/ui/gestures/index.android.js +2 -4
  243. package/ui/gestures/index.android.js.map +1 -1
  244. package/ui/gestures/index.d.ts +0 -35
  245. package/ui/gestures/index.ios.d.ts +1 -35
  246. package/ui/gestures/index.ios.js +3 -3
  247. package/ui/gestures/index.ios.js.map +1 -1
  248. package/ui/gestures/touch-manager.d.ts +1 -1
  249. package/ui/html-view/index.ios.js +3 -3
  250. package/ui/html-view/index.ios.js.map +1 -1
  251. package/ui/image/image-common.js +1 -1
  252. package/ui/image/image-common.js.map +1 -1
  253. package/ui/image/index.android.js +1 -1
  254. package/ui/image/index.android.js.map +1 -1
  255. package/ui/image-cache/index.ios.js +11 -5
  256. package/ui/image-cache/index.ios.js.map +1 -1
  257. package/ui/index.d.ts +5 -10
  258. package/ui/index.js +3 -11
  259. package/ui/index.js.map +1 -1
  260. package/ui/label/index.ios.js.map +1 -1
  261. package/ui/layouts/absolute-layout/absolute-layout-common.js +1 -1
  262. package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
  263. package/ui/layouts/absolute-layout/index.android.js +1 -1
  264. package/ui/layouts/absolute-layout/index.android.js.map +1 -1
  265. package/ui/layouts/absolute-layout/index.d.ts +1 -1
  266. package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
  267. package/ui/layouts/flexbox-layout/flexbox-layout-common.js +1 -2
  268. package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
  269. package/ui/layouts/flexbox-layout/index.android.js +1 -1
  270. package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
  271. package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
  272. package/ui/layouts/layout-base.android.js +1 -2
  273. package/ui/layouts/layout-base.android.js.map +1 -1
  274. package/ui/layouts/stack-layout/index.ios.js.map +1 -1
  275. package/ui/layouts/wrap-layout/index.android.js +1 -1
  276. package/ui/layouts/wrap-layout/index.android.js.map +1 -1
  277. package/ui/layouts/wrap-layout/index.d.ts +1 -1
  278. package/ui/layouts/wrap-layout/wrap-layout-common.js +1 -1
  279. package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
  280. package/ui/list-view/index.android.js +1 -1
  281. package/ui/list-view/index.android.js.map +1 -1
  282. package/ui/list-view/index.d.ts +1 -1
  283. package/ui/list-view/index.ios.js +1 -1
  284. package/ui/list-view/index.ios.js.map +1 -1
  285. package/ui/list-view/list-view-common.js +1 -1
  286. package/ui/list-view/list-view-common.js.map +1 -1
  287. package/ui/page/index.android.js +1 -2
  288. package/ui/page/index.android.js.map +1 -1
  289. package/ui/page/index.d.ts +1 -1
  290. package/ui/page/index.ios.js +5 -4
  291. package/ui/page/index.ios.js.map +1 -1
  292. package/ui/page/page-common.d.ts +2 -3
  293. package/ui/page/page-common.js +4 -5
  294. package/ui/page/page-common.js.map +1 -1
  295. package/ui/scroll-view/index.ios.js +3 -3
  296. package/ui/scroll-view/index.ios.js.map +1 -1
  297. package/ui/styling/background-common.js +1 -0
  298. package/ui/styling/background-common.js.map +1 -1
  299. package/ui/styling/background.android.d.ts +6 -0
  300. package/ui/styling/background.android.js +53 -1
  301. package/ui/styling/background.android.js.map +1 -1
  302. package/ui/styling/background.ios.js +1 -2
  303. package/ui/styling/background.ios.js.map +1 -1
  304. package/ui/styling/converters.d.ts +2 -2
  305. package/ui/styling/css-shadow.js.map +1 -1
  306. package/ui/styling/css-stroke.js.map +1 -1
  307. package/ui/styling/css-transform.d.ts +1 -1
  308. package/ui/styling/css-utils.js +1 -1
  309. package/ui/styling/css-utils.js.map +1 -1
  310. package/ui/styling/font.android.js +2 -2
  311. package/ui/styling/font.android.js.map +1 -1
  312. package/ui/styling/font.ios.js +10 -10
  313. package/ui/styling/font.ios.js.map +1 -1
  314. package/ui/styling/style/index.d.ts +1 -1
  315. package/ui/styling/style-properties.d.ts +113 -58
  316. package/ui/styling/style-properties.js +93 -7
  317. package/ui/styling/style-properties.js.map +1 -1
  318. package/ui/styling/style-scope.d.ts +48 -85
  319. package/ui/styling/style-scope.js +36 -30
  320. package/ui/styling/style-scope.js.map +1 -1
  321. package/ui/switch/index.ios.js +5 -5
  322. package/ui/switch/index.ios.js.map +1 -1
  323. package/ui/tab-view/index.android.js +6 -6
  324. package/ui/tab-view/index.android.js.map +1 -1
  325. package/ui/text-base/index.android.d.ts +1 -1
  326. package/ui/text-base/index.android.js +4 -4
  327. package/ui/text-base/index.android.js.map +1 -1
  328. package/ui/text-base/index.d.ts +1 -1
  329. package/ui/text-base/index.ios.js +4 -5
  330. package/ui/text-base/index.ios.js.map +1 -1
  331. package/ui/text-view/index.ios.js.map +1 -1
  332. package/ui/transition/fade-transition.ios.js +1 -1
  333. package/ui/transition/fade-transition.ios.js.map +1 -1
  334. package/ui/transition/index.ios.js +1 -1
  335. package/ui/transition/index.ios.js.map +1 -1
  336. package/ui/transition/modal-transition.ios.js +1 -1
  337. package/ui/transition/modal-transition.ios.js.map +1 -1
  338. package/ui/transition/page-transition.android.d.ts +1 -1
  339. package/ui/transition/page-transition.android.js +4 -4
  340. package/ui/transition/page-transition.android.js.map +1 -1
  341. package/ui/transition/page-transition.ios.js +1 -1
  342. package/ui/transition/page-transition.ios.js.map +1 -1
  343. package/ui/transition/shared-transition-helper.ios.js +1 -1
  344. package/ui/transition/shared-transition-helper.ios.js.map +1 -1
  345. package/ui/transition/shared-transition.js +1 -2
  346. package/ui/transition/shared-transition.js.map +1 -1
  347. package/ui/transition/slide-transition.ios.js +2 -2
  348. package/ui/transition/slide-transition.ios.js.map +1 -1
  349. package/utils/{native-helper-for-android.d.ts → android/index.d.ts} +2 -4
  350. package/utils/android/index.js +160 -0
  351. package/utils/android/index.js.map +1 -0
  352. package/utils/common.d.ts +38 -1
  353. package/utils/common.js +111 -1
  354. package/utils/common.js.map +1 -1
  355. package/utils/debug.js +59 -1
  356. package/utils/debug.js.map +1 -1
  357. package/utils/index.android.d.ts +1 -3
  358. package/utils/index.android.js +11 -37
  359. package/utils/index.android.js.map +1 -1
  360. package/utils/index.d.ts +14 -2
  361. package/utils/index.ios.d.ts +1 -4
  362. package/utils/index.ios.js +5 -32
  363. package/utils/index.ios.js.map +1 -1
  364. package/utils/ios/index.d.ts +39 -0
  365. package/utils/ios/index.js +229 -0
  366. package/utils/ios/index.js.map +1 -0
  367. package/utils/layout-helper/index.android.js +4 -4
  368. package/utils/layout-helper/index.android.js.map +1 -1
  369. package/utils/layout-helper/index.d.ts +4 -6
  370. package/utils/layout-helper/index.ios.js +5 -5
  371. package/utils/layout-helper/index.ios.js.map +1 -1
  372. package/utils/layout-helper/layout-helper-common.d.ts +9 -0
  373. package/utils/layout-helper/layout-helper-common.js +9 -1
  374. package/utils/layout-helper/layout-helper-common.js.map +1 -1
  375. package/utils/native-helper.android.d.ts +5 -29
  376. package/utils/native-helper.android.js +131 -18
  377. package/utils/native-helper.android.js.map +1 -1
  378. package/utils/native-helper.d.ts +258 -206
  379. package/utils/native-helper.ios.d.ts +3 -72
  380. package/utils/native-helper.ios.js +3 -250
  381. package/utils/native-helper.ios.js.map +1 -1
  382. package/xhr/index.js +13 -12
  383. package/xhr/index.js.map +1 -1
  384. package/xml/index.d.ts +98 -94
  385. package/xml/index.js +2 -58
  386. package/xml/index.js.map +1 -1
  387. package/accessibility/index.js +0 -2
  388. package/accessibility/index.js.map +0 -1
  389. package/application/helpers-common.d.ts +0 -50
  390. package/application/helpers-common.js +0 -153
  391. package/application/helpers-common.js.map +0 -1
  392. package/application/helpers.android.d.ts +0 -17
  393. package/application/helpers.android.js +0 -173
  394. package/application/helpers.android.js.map +0 -1
  395. package/application/helpers.d.ts +0 -25
  396. package/application/helpers.ios.d.ts +0 -27
  397. package/application/helpers.ios.js +0 -62
  398. package/application/helpers.ios.js.map +0 -1
  399. package/cli-hooks/postinstall.mjs +0 -7
  400. package/cli-hooks/preuninstall.mjs +0 -7
  401. package/color/color-types.d.ts +0 -49
  402. package/color/color-types.js +0 -3
  403. package/color/color-types.js.map +0 -1
  404. package/core-types/animation-types.d.ts +0 -11
  405. package/core-types/animation-types.js.map +0 -1
  406. package/core-types/validators.d.ts +0 -2
  407. package/core-types/validators.js +0 -18
  408. package/core-types/validators.js.map +0 -1
  409. package/css/lib/parse/index.d.ts +0 -1
  410. package/css/lib/parse/index.js.map +0 -1
  411. package/css/reworkcss.js.map +0 -1
  412. package/css-value/reworkcss-value.js.map +0 -1
  413. package/debugger/dom-types.d.ts +0 -24
  414. package/debugger/dom-types.js.map +0 -1
  415. package/fetch/index.d.ts +0 -72
  416. package/fetch/index.js.map +0 -1
  417. package/globals/global-utils.d.ts +0 -27
  418. package/globals/global-utils.js +0 -67
  419. package/globals/global-utils.js.map +0 -1
  420. package/http/http-interfaces.d.ts +0 -84
  421. package/http/http-interfaces.js +0 -6
  422. package/http/http-interfaces.js.map +0 -1
  423. package/http/http-shared.d.ts +0 -5
  424. package/http/http-shared.js +0 -14
  425. package/http/http-shared.js.map +0 -1
  426. package/module-name-resolver/helpers.d.ts +0 -14
  427. package/module-name-resolver/helpers.js +0 -27
  428. package/module-name-resolver/helpers.js.map +0 -1
  429. package/ui/animation/animation-shared.js +0 -4
  430. package/ui/animation/animation-shared.js.map +0 -1
  431. package/ui/animation/animation-types.d.ts +0 -1
  432. package/ui/animation/animation-types.js +0 -3
  433. package/ui/animation/animation-types.js.map +0 -1
  434. package/ui/core/bindable/bindable-types.d.ts +0 -37
  435. package/ui/core/bindable/bindable-types.js +0 -3
  436. package/ui/core/bindable/bindable-types.js.map +0 -1
  437. package/ui/core/properties/property-shared.d.ts +0 -35
  438. package/ui/core/properties/property-shared.js +0 -16
  439. package/ui/core/properties/property-shared.js.map +0 -1
  440. package/ui/core/view/view-helper/view-helper-shared.d.ts +0 -5
  441. package/ui/core/view/view-helper/view-helper-shared.js +0 -6
  442. package/ui/core/view/view-helper/view-helper-shared.js.map +0 -1
  443. package/ui/core/view/view-interfaces.d.ts +0 -54
  444. package/ui/core/view/view-interfaces.js +0 -2
  445. package/ui/core/view/view-interfaces.js.map +0 -1
  446. package/ui/core/view-base/utils.d.ts +0 -1
  447. package/ui/core/view-base/utils.js +0 -9
  448. package/ui/core/view-base/utils.js.map +0 -1
  449. package/ui/frame/frame-helper-for-android.js.map +0 -1
  450. package/ui/gestures/gestures-types.d.ts +0 -108
  451. package/ui/gestures/gestures-types.js +0 -40
  452. package/ui/gestures/gestures-types.js.map +0 -1
  453. package/ui/page/events.d.ts +0 -6
  454. package/ui/page/events.js +0 -7
  455. package/ui/page/events.js.map +0 -1
  456. package/ui/styling/length-shared.d.ts +0 -52
  457. package/ui/styling/length-shared.js +0 -173
  458. package/ui/styling/length-shared.js.map +0 -1
  459. package/ui/styling/styling-profile.d.ts +0 -1
  460. package/ui/styling/styling-profile.js +0 -4
  461. package/ui/styling/styling-profile.js.map +0 -1
  462. package/ui/styling/styling-shared.d.ts +0 -3
  463. package/ui/styling/styling-shared.js +0 -6
  464. package/ui/styling/styling-shared.js.map +0 -1
  465. package/utils/animation-helpers.d.ts +0 -27
  466. package/utils/animation-helpers.js +0 -48
  467. package/utils/animation-helpers.js.map +0 -1
  468. package/utils/debug-source.d.ts +0 -19
  469. package/utils/debug-source.js +0 -78
  470. package/utils/debug-source.js.map +0 -1
  471. package/utils/layout-helper/layout-helper-shared.d.ts +0 -9
  472. package/utils/layout-helper/layout-helper-shared.js +0 -13
  473. package/utils/layout-helper/layout-helper-shared.js.map +0 -1
  474. package/utils/native-helper-for-android.js +0 -273
  475. package/utils/native-helper-for-android.js.map +0 -1
  476. package/utils/shared.d.ts +0 -17
  477. package/utils/shared.js +0 -40
  478. package/utils/shared.js.map +0 -1
  479. package/utils/utils-shared.d.ts +0 -1
  480. package/utils/utils-shared.js +0 -8
  481. package/utils/utils-shared.js.map +0 -1
package/fetch/index.js CHANGED
@@ -1,301 +1,335 @@
1
- const g = (typeof globalThis !== 'undefined' && globalThis) || (typeof self !== 'undefined' && self) || (typeof global !== 'undefined' && global) || {};
2
- const support = {
3
- searchParams: 'URLSearchParams' in g,
4
- iterable: 'Symbol' in g && 'iterator' in Symbol,
5
- blob: 'FileReader' in g &&
6
- 'Blob' in g &&
7
- (() => {
8
- try {
9
- new Blob();
10
- return true;
11
- }
12
- catch (e) {
13
- return false;
14
- }
15
- })(),
16
- formData: 'FormData' in g,
17
- arrayBuffer: 'ArrayBuffer' in g,
18
- };
19
- function isDataView(obj) {
20
- return obj && DataView.prototype.isPrototypeOf(obj);
21
- }
22
- let isArrayBufferView;
23
- if (support.arrayBuffer) {
24
- const viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]'];
25
- isArrayBufferView =
26
- ArrayBuffer.isView ||
27
- ((obj) => {
28
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;
29
- });
30
- }
31
- function normalizeName(name) {
32
- if (typeof name !== 'string') {
33
- name = String(name);
1
+ (function () {
2
+ "use strict";
3
+
4
+ var support = {
5
+ searchParams: "URLSearchParams" in global,
6
+ iterable: "Symbol" in global && "iterator" in Symbol,
7
+ blob:
8
+ "FileReader" in global &&
9
+ "Blob" in global &&
10
+ (function () {
11
+ try {
12
+ new Blob();
13
+ return true;
14
+ } catch (e) {
15
+ return false;
16
+ }
17
+ })(),
18
+ formData: "FormData" in global,
19
+ arrayBuffer: "ArrayBuffer" in global
20
+ };
21
+
22
+ function isDataView(obj) {
23
+ return obj && DataView.prototype.isPrototypeOf(obj);
24
+ }
25
+
26
+ if (support.arrayBuffer) {
27
+ var viewClasses = [
28
+ "[object Int8Array]",
29
+ "[object Uint8Array]",
30
+ "[object Uint8ClampedArray]",
31
+ "[object Int16Array]",
32
+ "[object Uint16Array]",
33
+ "[object Int32Array]",
34
+ "[object Uint32Array]",
35
+ "[object Float32Array]",
36
+ "[object Float64Array]"
37
+ ];
38
+
39
+ var isArrayBufferView =
40
+ ArrayBuffer.isView ||
41
+ function (obj) {
42
+ return (
43
+ obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
44
+ );
45
+ };
34
46
  }
35
- if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {
36
- throw new TypeError('Invalid character in header field name: "' + name + '"');
47
+
48
+ function normalizeName(name) {
49
+ if (typeof name !== "string") {
50
+ name = String(name);
51
+ }
52
+ if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
53
+ throw new TypeError("Invalid character in header field name");
54
+ }
55
+ return name.toLowerCase();
37
56
  }
38
- return name.toLowerCase();
39
- }
40
- function normalizeValue(value) {
41
- if (typeof value !== 'string') {
42
- value = String(value);
57
+
58
+ function normalizeValue(value) {
59
+ if (typeof value !== "string") {
60
+ value = String(value);
61
+ }
62
+ return value;
43
63
  }
44
- return value;
45
- }
46
- // Build a destructive iterator for the value list
47
- function iteratorFor(items) {
48
- const iterator = {
49
- next: () => {
50
- const value = items.shift();
51
- return { done: value === undefined, value };
52
- },
53
- };
54
- if (support.iterable) {
55
- iterator[Symbol.iterator] = () => iterator;
64
+
65
+ // Build a destructive iterator for the value list
66
+ function iteratorFor(items) {
67
+ var iterator = {
68
+ next: function () {
69
+ var value = items.shift();
70
+ return { done: value === undefined, value: value };
71
+ }
72
+ };
73
+
74
+ if (support.iterable) {
75
+ iterator[Symbol.iterator] = function () {
76
+ return iterator;
77
+ };
78
+ }
79
+
80
+ return iterator;
56
81
  }
57
- return iterator;
58
- }
59
- export class Headers {
60
- constructor(headers) {
82
+
83
+ function Headers(headers) {
61
84
  this.map = {};
85
+
62
86
  if (headers instanceof Headers) {
63
- headers.forEach((value, name) => {
87
+ headers.forEach(function (value, name) {
64
88
  this.append(name, value);
65
- });
66
- }
67
- else if (Array.isArray(headers)) {
68
- headers.forEach((header) => {
69
- if (header.length !== 2) {
70
- throw new TypeError('Headers constructor: expected name/value pair to be length 2, found ' + header.length);
71
- }
89
+ }, this);
90
+ } else if (Array.isArray(headers)) {
91
+ headers.forEach(function (header) {
72
92
  this.append(header[0], header[1]);
73
- });
74
- }
75
- else if (headers) {
76
- Object.getOwnPropertyNames(headers).forEach((name) => {
93
+ }, this);
94
+ } else if (headers) {
95
+ Object.getOwnPropertyNames(headers).forEach(function (name) {
77
96
  this.append(name, headers[name]);
78
- });
97
+ }, this);
79
98
  }
80
99
  }
81
- append(name, value) {
100
+
101
+ Headers.prototype.append = function (name, value) {
82
102
  name = normalizeName(name);
83
103
  value = normalizeValue(value);
84
- const oldValue = this.map[name];
85
- this.map[name] = oldValue ? oldValue + ', ' + value : value;
86
- }
87
- delete(name) {
104
+ var oldValue = this.map[name];
105
+ this.map[name] = oldValue ? oldValue + ", " + value : value;
106
+ };
107
+
108
+ Headers.prototype["delete"] = function (name) {
88
109
  delete this.map[normalizeName(name)];
89
- }
90
- get(name) {
110
+ };
111
+
112
+ Headers.prototype.get = function (name) {
91
113
  name = normalizeName(name);
92
114
  return this.has(name) ? this.map[name] : null;
93
- }
94
- has(name) {
95
- return Object.prototype.hasOwnProperty.call(this.map, normalizeName(name));
96
- }
97
- set(name, value) {
115
+ };
116
+
117
+ Headers.prototype.has = function (name) {
118
+ return this.map.hasOwnProperty(normalizeName(name));
119
+ };
120
+
121
+ Headers.prototype.set = function (name, value) {
98
122
  this.map[normalizeName(name)] = normalizeValue(value);
99
- }
100
- forEach(callback, thisArg) {
101
- for (const name in this.map) {
102
- if (Object.prototype.hasOwnProperty.call(this.map, name)) {
123
+ };
124
+
125
+ Headers.prototype.forEach = function (callback, thisArg) {
126
+ for (var name in this.map) {
127
+ if (this.map.hasOwnProperty(name)) {
103
128
  callback.call(thisArg, this.map[name], name, this);
104
129
  }
105
130
  }
106
- }
107
- keys() {
108
- const items = [];
109
- this.forEach((_, name) => items.push(name));
131
+ };
132
+
133
+ Headers.prototype.keys = function () {
134
+ var items = [];
135
+ this.forEach(function (value, name) {
136
+ items.push(name);
137
+ });
110
138
  return iteratorFor(items);
111
- }
112
- values() {
113
- const items = [];
114
- this.forEach((value) => items.push(value));
139
+ };
140
+
141
+ Headers.prototype.values = function () {
142
+ var items = [];
143
+ this.forEach(function (value) {
144
+ items.push(value);
145
+ });
115
146
  return iteratorFor(items);
116
- }
117
- entries() {
118
- const items = [];
119
- this.forEach((value, name) => items.push([name, value]));
147
+ };
148
+
149
+ Headers.prototype.entries = function () {
150
+ var items = [];
151
+ this.forEach(function (value, name) {
152
+ items.push([name, value]);
153
+ });
120
154
  return iteratorFor(items);
155
+ };
156
+
157
+ if (support.iterable) {
158
+ Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
121
159
  }
122
- [Symbol.iterator]() {
123
- return this.entries();
160
+
161
+ function consumed(body) {
162
+ if (body.bodyUsed) {
163
+ return Promise.reject(new TypeError("Already read"));
164
+ }
165
+ body.bodyUsed = true;
124
166
  }
125
- }
126
- // Body mixin
127
- export class Body {
128
- constructor() {
129
- this.bodyUsed = false;
167
+
168
+ function fileReaderReady(reader) {
169
+ return new Promise(function (resolve, reject) {
170
+ reader.onload = function () {
171
+ resolve(reader.result);
172
+ };
173
+ reader.onerror = function () {
174
+ reject(reader.error);
175
+ };
176
+ });
130
177
  }
131
- _initBody(body) {
132
- // Ensure bodyUsed property exists
133
- this.bodyUsed = this.bodyUsed;
134
- this._bodyInit = body;
135
- if (!body) {
136
- this._noBody = true;
137
- this._bodyText = '';
138
- }
139
- else if (typeof body === 'string') {
140
- this._bodyText = body;
141
- }
142
- else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
143
- this._bodyBlob = body;
144
- }
145
- else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
146
- this._bodyFormData = body;
147
- }
148
- else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
149
- this._bodyText = body.toString();
150
- }
151
- else if (support.arrayBuffer && support.blob && isDataView(body)) {
152
- // @ts-ignore
153
- this._bodyArrayBuffer = bufferClone(body.buffer);
154
- this._bodyInit = new Blob([this._bodyArrayBuffer]);
155
- }
156
- else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
157
- this._bodyArrayBuffer = bufferClone(body);
158
- }
159
- else {
160
- this._bodyText = body = Object.prototype.toString.call(body);
161
- }
162
- // Set Content-Type header if not set
163
- if (!this.headers.get('content-type')) {
164
- if (typeof body === 'string') {
165
- this.headers.set('content-type', 'text/plain;charset=UTF-8');
166
- }
167
- else if (this._bodyBlob && this._bodyBlob.type) {
168
- this.headers.set('content-type', this._bodyBlob.type);
178
+
179
+ function readBlobAsArrayBuffer(blob) {
180
+ var reader = new FileReader();
181
+ var promise = fileReaderReady(reader);
182
+ reader.readAsArrayBuffer(blob);
183
+ return promise;
184
+ }
185
+
186
+ function readBlobAsText(blob) {
187
+ var reader = new FileReader();
188
+ var promise = fileReaderReady(reader);
189
+ reader.readAsText(blob);
190
+ return promise;
191
+ }
192
+
193
+ function readArrayBufferAsText(buf) {
194
+ var view = new Uint8Array(buf);
195
+ var chars = new Array(view.length);
196
+
197
+ for (var i = 0; i < view.length; i++) {
198
+ chars[i] = String.fromCharCode(view[i]);
199
+ }
200
+ return chars.join("");
201
+ }
202
+
203
+ function bufferClone(buf) {
204
+ if (buf.slice) {
205
+ return buf.slice(0);
206
+ } else {
207
+ var view = new Uint8Array(buf.byteLength);
208
+ view.set(new Uint8Array(buf));
209
+ return view.buffer;
210
+ }
211
+ }
212
+
213
+ function Body() {
214
+ this.bodyUsed = false;
215
+
216
+ this._initBody = function (body) {
217
+ this._bodyInit = body;
218
+ if (!body) {
219
+ this._bodyText = "";
220
+ } else if (typeof body === "string") {
221
+ this._bodyText = body;
222
+ } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
223
+ this._bodyBlob = body;
224
+ } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
225
+ this._bodyFormData = body;
226
+ } else if (
227
+ support.searchParams &&
228
+ URLSearchParams.prototype.isPrototypeOf(body)
229
+ ) {
230
+ this._bodyText = body.toString();
231
+ } else if (support.arrayBuffer && support.blob && isDataView(body)) {
232
+ this._bodyArrayBuffer = bufferClone(body.buffer);
233
+ // IE 10-11 can't handle a DataView body.
234
+ this._bodyInit = new Blob([this._bodyArrayBuffer]);
235
+ } else if (
236
+ support.arrayBuffer &&
237
+ (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))
238
+ ) {
239
+ this._bodyArrayBuffer = bufferClone(body);
240
+ } else {
241
+ this._bodyText = body = Object.prototype.toString.call(body);
169
242
  }
170
- else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
171
- this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
243
+
244
+ if (!this.headers.get("content-type")) {
245
+ if (typeof body === "string") {
246
+ this.headers.set("content-type", "text/plain;charset=UTF-8");
247
+ } else if (this._bodyBlob && this._bodyBlob.type) {
248
+ this.headers.set("content-type", this._bodyBlob.type);
249
+ } else if (
250
+ support.searchParams &&
251
+ URLSearchParams.prototype.isPrototypeOf(body)
252
+ ) {
253
+ this.headers.set(
254
+ "content-type",
255
+ "application/x-www-form-urlencoded;charset=UTF-8"
256
+ );
257
+ }
172
258
  }
259
+ };
260
+
261
+ if (support.blob) {
262
+ this.blob = function () {
263
+ var rejected = consumed(this);
264
+ if (rejected) {
265
+ return rejected;
266
+ }
267
+
268
+ if (this._bodyBlob) {
269
+ return Promise.resolve(this._bodyBlob);
270
+ } else if (this._bodyArrayBuffer) {
271
+ return Promise.resolve(new Blob([this._bodyArrayBuffer]));
272
+ } else if (this._bodyFormData) {
273
+ throw new Error("could not read FormData body as blob");
274
+ } else {
275
+ return Promise.resolve(new Blob([this._bodyText]));
276
+ }
277
+ };
278
+
279
+ this.arrayBuffer = function () {
280
+ if (this._bodyArrayBuffer) {
281
+ return consumed(this) || Promise.resolve(this._bodyArrayBuffer);
282
+ } else {
283
+ return this.blob().then(readBlobAsArrayBuffer);
284
+ }
285
+ };
173
286
  }
174
- }
175
- blob() {
176
- const rejected = consumed(this);
177
- if (rejected) {
178
- return rejected;
179
- }
180
- if (this._bodyBlob) {
181
- return Promise.resolve(this._bodyBlob);
182
- }
183
- else if (this._bodyArrayBuffer) {
184
- return Promise.resolve(new Blob([this._bodyArrayBuffer]));
185
- }
186
- else if (this._bodyFormData) {
187
- throw new Error('could not read FormData body as blob');
188
- }
189
- else {
190
- return Promise.resolve(new Blob([this._bodyText]));
191
- }
192
- }
193
- arrayBuffer() {
194
- if (this._bodyArrayBuffer) {
195
- const consumedResult = consumed(this);
196
- if (consumedResult) {
197
- return consumedResult;
198
- }
199
- else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
200
- return Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength));
287
+
288
+ this.text = function () {
289
+ var rejected = consumed(this);
290
+ if (rejected) {
291
+ return rejected;
201
292
  }
202
- else {
203
- return Promise.resolve(this._bodyArrayBuffer);
293
+
294
+ if (this._bodyBlob) {
295
+ return readBlobAsText(this._bodyBlob);
296
+ } else if (this._bodyArrayBuffer) {
297
+ return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
298
+ } else if (this._bodyFormData) {
299
+ throw new Error("could not read FormData body as text");
300
+ } else {
301
+ return Promise.resolve(this._bodyText);
204
302
  }
303
+ };
304
+
305
+ if (support.formData) {
306
+ this.formData = function () {
307
+ return this.text().then(decode);
308
+ };
205
309
  }
206
- else if (support.blob) {
207
- // @ts-ignore
208
- return this.blob().then(readBlobAsArrayBuffer);
209
- }
210
- else {
211
- throw new Error('could not read as ArrayBuffer');
212
- }
213
- }
214
- text() {
215
- const rejected = consumed(this);
216
- if (rejected) {
217
- return rejected;
218
- }
219
- if (this._bodyBlob) {
220
- return readBlobAsText(this._bodyBlob);
221
- }
222
- else if (this._bodyArrayBuffer) {
223
- return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
224
- }
225
- else if (this._bodyFormData) {
226
- throw new Error('could not read FormData body as text');
227
- }
228
- else {
229
- return Promise.resolve(this._bodyText);
230
- }
231
- }
232
- formData() {
233
- return this.text().then(decode);
234
- }
235
- json() {
236
- return this.text().then(JSON.parse);
237
- }
238
- }
239
- // Helper functions for Body
240
- function consumed(body) {
241
- if (body._noBody)
242
- return;
243
- if (body.bodyUsed) {
244
- return Promise.reject(new TypeError('Already read'));
245
- }
246
- body.bodyUsed = true;
247
- }
248
- function fileReaderReady(reader) {
249
- return new Promise((resolve, reject) => {
250
- reader.onload = () => resolve(reader.result);
251
- reader.onerror = () => reject(reader.error);
252
- });
253
- }
254
- function readBlobAsArrayBuffer(blob) {
255
- const reader = new FileReader();
256
- const promise = fileReaderReady(reader);
257
- reader.readAsArrayBuffer(blob);
258
- return promise;
259
- }
260
- function readBlobAsText(blob) {
261
- const reader = new FileReader();
262
- const promise = fileReaderReady(reader);
263
- const match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
264
- const encoding = match ? match[1] : 'utf-8';
265
- reader.readAsText(blob, encoding);
266
- return promise;
267
- }
268
- function readArrayBufferAsText(buf) {
269
- const view = new Uint8Array(buf);
270
- const chars = new Array(view.length);
271
- for (let i = 0; i < view.length; i++) {
272
- chars[i] = String.fromCharCode(view[i]);
273
- }
274
- return chars.join('');
275
- }
276
- function bufferClone(buf) {
277
- if (buf.slice) {
278
- return buf.slice(0);
279
- }
280
- else {
281
- const view = new Uint8Array(buf.byteLength);
282
- view.set(new Uint8Array(buf));
283
- return view.buffer;
284
- }
285
- }
286
- // HTTP methods whose capitalization should be normalized
287
- const methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'];
288
- function normalizeMethod(method) {
289
- const upcased = method.toUpperCase();
290
- return methods.indexOf(upcased) > -1 ? upcased : method;
291
- }
292
- export class Request extends Body {
293
- constructor(input, options = {}) {
294
- super();
295
- let body = options.body;
310
+
311
+ this.json = function () {
312
+ return this.text().then(JSON.parse);
313
+ };
314
+
315
+ return this;
316
+ }
317
+
318
+ // HTTP methods whose capitalization should be normalized
319
+ var methods = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
320
+
321
+ function normalizeMethod(method) {
322
+ var upcased = method.toUpperCase();
323
+ return methods.indexOf(upcased) > -1 ? upcased : method;
324
+ }
325
+
326
+ function Request(input, options) {
327
+ options = options || {};
328
+ var body = options.body;
329
+
296
330
  if (input instanceof Request) {
297
331
  if (input.bodyUsed) {
298
- throw new TypeError('Already read');
332
+ throw new TypeError("Already read");
299
333
  }
300
334
  this.url = input.url;
301
335
  this.credentials = input.credentials;
@@ -309,221 +343,197 @@ export class Request extends Body {
309
343
  body = input._bodyInit;
310
344
  input.bodyUsed = true;
311
345
  }
312
- }
313
- else {
346
+ } else {
314
347
  this.url = String(input);
315
348
  }
316
- this.credentials = options.credentials || this.credentials || 'same-origin';
349
+
350
+ this.credentials = options.credentials || this.credentials || "same-origin";
317
351
  if (options.headers || !this.headers) {
318
352
  this.headers = new Headers(options.headers);
319
353
  }
320
- this.method = normalizeMethod(options.method || this.method || 'GET');
354
+ this.method = normalizeMethod(options.method || this.method || "GET");
321
355
  this.mode = options.mode || this.mode || null;
322
- this.signal = options.signal || this.signal || ('AbortController' in g ? new AbortController().signal : undefined);
356
+ this.signal = options.signal || this.signal;
323
357
  this.referrer = null;
324
- if ((this.method === 'GET' || this.method === 'HEAD') && body) {
325
- throw new TypeError('Body not allowed for GET or HEAD requests');
358
+
359
+ if ((this.method === "GET" || this.method === "HEAD") && body) {
360
+ throw new TypeError("Body not allowed for GET or HEAD requests");
326
361
  }
327
362
  this._initBody(body);
328
- if (this.method === 'GET' || this.method === 'HEAD') {
329
- if (options.cache === 'no-store' || options.cache === 'no-cache') {
330
- const reParamSearch = /([?&])_=[^&]*/;
331
- if (reParamSearch.test(this.url)) {
332
- this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());
333
- }
334
- else {
335
- const reQueryString = /\?/;
336
- this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();
337
- }
338
- }
339
- }
340
363
  }
341
- clone() {
364
+
365
+ Request.prototype.clone = function () {
342
366
  return new Request(this, { body: this._bodyInit });
343
- }
344
- }
345
- // Decode URL-encoded form data
346
- function decode(body) {
347
- const form = new FormData();
348
- body
349
- .trim()
350
- .split('&')
351
- .forEach((bytes) => {
352
- if (bytes) {
353
- const split = bytes.split('=');
354
- const name = split.shift().replace(/\+/g, ' ');
355
- const value = split.join('=').replace(/\+/g, ' ');
356
- form.append(decodeURIComponent(name), decodeURIComponent(value));
357
- }
358
- });
359
- return form;
360
- }
361
- // Parse raw headers string into Headers
362
- function parseHeaders(rawHeaders) {
363
- const headers = new Headers();
364
- const preProcessed = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
365
- preProcessed
366
- .split('\r')
367
- .map((header) => (header.indexOf('\n') === 0 ? header.substr(1) : header))
368
- .forEach((line) => {
369
- const parts = line.split(':');
370
- const key = parts.shift().trim();
371
- if (key) {
372
- const value = parts.join(':').trim();
373
- try {
367
+ };
368
+
369
+ function decode(body) {
370
+ var form = new FormData();
371
+ body
372
+ .trim()
373
+ .split("&")
374
+ .forEach(function (bytes) {
375
+ if (bytes) {
376
+ var split = bytes.split("=");
377
+ var name = split.shift().replace(/\+/g, " ");
378
+ var value = split.join("=").replace(/\+/g, " ");
379
+ form.append(decodeURIComponent(name), decodeURIComponent(value));
380
+ }
381
+ });
382
+ return form;
383
+ }
384
+
385
+ function parseHeaders(rawHeaders) {
386
+ var headers = new Headers();
387
+ // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
388
+ // https://tools.ietf.org/html/rfc7230#section-3.2
389
+ var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, " ");
390
+ preProcessedHeaders.split(/\r?\n/).forEach(function (line) {
391
+ var parts = line.split(":");
392
+ var key = parts.shift().trim();
393
+ if (key) {
394
+ var value = parts.join(":").trim();
374
395
  headers.append(key, value);
375
396
  }
376
- catch (err) {
377
- console.warn('Response ' + err.message);
378
- }
397
+ });
398
+ return headers;
399
+ }
400
+
401
+ Body.call(Request.prototype);
402
+
403
+ function Response(bodyInit, options) {
404
+ if (!options) {
405
+ options = {};
379
406
  }
380
- });
381
- return headers;
382
- }
383
- const redirectStatuses = [301, 302, 303, 307, 308];
384
- export class Response extends Body {
385
- constructor(bodyInit, options = {}) {
386
- super();
387
- this.type = 'default';
407
+
408
+ this.type = "default";
388
409
  this.status = options.status === undefined ? 200 : options.status;
389
- if (this.status < 200 || this.status > 599) {
390
- throw new RangeError(`Failed to construct 'Response': The status provided (${this.status}) is outside the range [200, 599].`);
391
- }
392
410
  this.ok = this.status >= 200 && this.status < 300;
393
- this.statusText = options.statusText === undefined ? '' : String(options.statusText);
411
+ this.statusText = "statusText" in options ? options.statusText : "OK";
394
412
  this.headers = new Headers(options.headers);
395
- this.url = options.url || '';
413
+ this.url = options.url || "";
396
414
  this._initBody(bodyInit);
397
415
  }
398
- clone() {
416
+
417
+ Body.call(Response.prototype);
418
+
419
+ Response.prototype.clone = function () {
399
420
  return new Response(this._bodyInit, {
400
421
  status: this.status,
401
422
  statusText: this.statusText,
402
423
  headers: new Headers(this.headers),
403
- url: this.url,
424
+ url: this.url
404
425
  });
405
- }
406
- static error() {
407
- const response = new Response(null, { status: 200, statusText: '' });
408
- response.ok = false;
409
- response.status = 0;
410
- response.type = 'error';
426
+ };
427
+
428
+ Response.error = function () {
429
+ var response = new Response(null, { status: 0, statusText: "" });
430
+ response.type = "error";
411
431
  return response;
412
- }
413
- static redirect(url, status) {
414
- if (!redirectStatuses.includes(status)) {
415
- throw new RangeError('Invalid status code');
416
- }
417
- return new Response(null, { status, headers: { location: url } });
418
- }
419
- }
420
- // DOMException polyfill
421
- export let DOMException = g.DOMException;
422
- try {
423
- new g.DOMException();
424
- }
425
- catch (err) {
426
- DOMException = class {
427
- constructor(message, name) {
432
+ };
433
+
434
+ var redirectStatuses = [301, 302, 303, 307, 308];
435
+
436
+ Response.redirect = function (url, status) {
437
+ if (redirectStatuses.indexOf(status) === -1) {
438
+ throw new RangeError("Invalid status code");
439
+ }
440
+
441
+ return new Response(null, { status: status, headers: { location: url } });
442
+ };
443
+
444
+ exports.DOMException = global.DOMException;
445
+ try {
446
+ new exports.DOMException();
447
+ } catch (err) {
448
+ exports.DOMException = function (message, name) {
428
449
  this.message = message;
429
450
  this.name = name;
430
- const error = new Error(message);
451
+ var error = Error(message);
431
452
  this.stack = error.stack;
432
- }
433
- };
434
- }
435
- // fetch function
436
- export function fetch(input, init) {
437
- return new Promise((resolve, reject) => {
438
- const request = new Request(input, init);
439
- if (request.signal && request.signal.aborted) {
440
- return reject(new DOMException('Aborted', 'AbortError'));
441
- }
442
- const xhr = new XMLHttpRequest();
443
- function abortXhr() {
444
- xhr.abort();
445
- }
446
- xhr.onload = function () {
447
- const options = {
448
- statusText: xhr.statusText,
449
- headers: parseHeaders(xhr.getAllResponseHeaders() || ''),
450
- };
451
- // Local file handling
452
- if (request.url.startsWith('file://') && (xhr.status < 200 || xhr.status > 599)) {
453
- options.status = 200;
454
- }
455
- else {
456
- options.status = xhr.status;
457
- }
458
- options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
459
- // @ts-ignore
460
- const body = 'response' in xhr ? xhr.response : xhr.responseText;
461
- setTimeout(() => resolve(new Response(body, options)), 0);
462
453
  };
463
- xhr.onerror = function () {
464
- setTimeout(() => reject(new TypeError('Network request failed')), 0);
465
- };
466
- xhr.ontimeout = function () {
467
- setTimeout(() => reject(new TypeError('Network request timed out')), 0);
468
- };
469
- xhr.onabort = function () {
470
- setTimeout(() => reject(new DOMException('Aborted', 'AbortError')), 0);
471
- };
472
- function fixUrl(url) {
473
- try {
474
- return url === '' && g.location.href ? g.location.href : url;
454
+ exports.DOMException.prototype = Object.create(Error.prototype);
455
+ exports.DOMException.prototype.constructor = exports.DOMException;
456
+ }
457
+
458
+ function fetch(input, init) {
459
+ return new Promise(function (resolve, reject) {
460
+ var request = new Request(input, init);
461
+
462
+ if (request.signal && request.signal.aborted) {
463
+ return reject(new exports.DOMException("Aborted", "AbortError"));
475
464
  }
476
- catch (e) {
477
- return url;
465
+
466
+ var xhr = new XMLHttpRequest();
467
+
468
+ function abortXhr() {
469
+ xhr.abort();
478
470
  }
479
- }
480
- xhr.open(request.method, fixUrl(request.url), true);
481
- if (request.credentials === 'include') {
482
- xhr.withCredentials = true;
483
- }
484
- else if (request.credentials === 'omit') {
485
- xhr.withCredentials = false;
486
- }
487
- if ('responseType' in xhr) {
488
- if (support.blob) {
489
- xhr.responseType = 'blob';
471
+
472
+ xhr.onload = function () {
473
+ var options = {
474
+ status: xhr.status,
475
+ statusText: xhr.statusText,
476
+ headers: parseHeaders(xhr.getAllResponseHeaders() || "")
477
+ };
478
+ options.url =
479
+ "responseURL" in xhr
480
+ ? xhr.responseURL
481
+ : options.headers.get("X-Request-URL");
482
+ var body = "response" in xhr ? xhr.response : xhr.responseText;
483
+ resolve(new Response(body, options));
484
+ };
485
+
486
+ xhr.onerror = function () {
487
+ reject(new TypeError("Network request failed"));
488
+ };
489
+
490
+ xhr.ontimeout = function () {
491
+ reject(new TypeError("Network request failed"));
492
+ };
493
+
494
+ xhr.onabort = function () {
495
+ reject(new exports.DOMException("Aborted", "AbortError"));
496
+ };
497
+
498
+ xhr.open(request.method, request.url, true);
499
+
500
+ if (request.credentials === "include") {
501
+ xhr.withCredentials = true;
502
+ } else if (request.credentials === "omit") {
503
+ xhr.withCredentials = false;
490
504
  }
491
- else if (support.arrayBuffer) {
492
- xhr.responseType = 'arraybuffer';
505
+
506
+ if ("responseType" in xhr && support.blob) {
507
+ xhr.responseType = "blob";
493
508
  }
494
- }
495
- if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers) && !(g.Headers && init.headers instanceof g.Headers)) {
496
- const names = [];
497
- Object.getOwnPropertyNames(init.headers).forEach((name) => {
498
- names.push(normalizeName(name));
499
- xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
500
- });
501
- request.headers.forEach((value, name) => {
502
- if (!names.includes(name)) {
503
- xhr.setRequestHeader(name, value);
504
- }
509
+
510
+ request.headers.forEach(function (value, name) {
511
+ xhr.setRequestHeader(name, value);
505
512
  });
506
- }
507
- else {
508
- request.headers.forEach((value, name) => xhr.setRequestHeader(name, value));
509
- }
510
- if (request.signal) {
511
- request.signal.addEventListener('abort', abortXhr);
512
- xhr.onreadystatechange = function () {
513
- if (xhr.readyState === 4) {
514
- request.signal.removeEventListener('abort', abortXhr);
515
- }
516
- };
517
- }
518
- xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
519
- });
520
- }
521
- // Attach polyfill to globals
522
- fetch.polyfill = true;
523
- if (!g.fetch) {
524
- g.fetch = fetch;
525
- g.Headers = Headers;
526
- g.Request = Request;
527
- g.Response = Response;
528
- }
529
- //# sourceMappingURL=index.js.map
513
+
514
+ if (request.signal) {
515
+ request.signal.addEventListener("abort", abortXhr);
516
+
517
+ xhr.onreadystatechange = function () {
518
+ // DONE (success or failure)
519
+ if (xhr.readyState === 4) {
520
+ request.signal.removeEventListener("abort", abortXhr);
521
+ }
522
+ };
523
+ }
524
+
525
+ xhr.send(
526
+ typeof request._bodyInit === "undefined" ? null : request._bodyInit
527
+ );
528
+ });
529
+ }
530
+
531
+ fetch.polyfill = true;
532
+
533
+ exports.Headers = Headers;
534
+ exports.Request = Request;
535
+ exports.Response = Response;
536
+ exports.fetch = fetch;
537
+
538
+ Object.defineProperty(exports, "__esModule", { value: true });
539
+ })();