@nativescript/core 9.0.0-next-07-26-2025-16544379102 → 9.0.0-preview.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 (487) hide show
  1. package/accessibility/accessibility-common.d.ts +264 -0
  2. package/accessibility/accessibility-common.js +352 -0
  3. package/accessibility/accessibility-common.js.map +1 -1
  4. package/accessibility/accessibility-properties.d.ts +1 -1
  5. package/accessibility/accessibility-properties.js +2 -2
  6. package/accessibility/accessibility-properties.js.map +1 -1
  7. package/accessibility/index.d.ts +0 -36
  8. package/accessibility/index.js +2 -0
  9. package/accessibility/index.js.map +1 -0
  10. package/application/application-common.d.ts +6 -8
  11. package/application/application-common.js +21 -14
  12. package/application/application-common.js.map +1 -1
  13. package/application/application-interfaces.d.ts +2 -3
  14. package/application/application.android.d.ts +14 -7
  15. package/application/application.android.js +754 -75
  16. package/application/application.android.js.map +1 -1
  17. package/application/application.d.ts +25 -0
  18. package/application/application.ios.d.ts +16 -18
  19. package/application/application.ios.js +455 -45
  20. package/application/application.ios.js.map +1 -1
  21. package/application/helpers-common.d.ts +50 -0
  22. package/application/helpers-common.js +153 -0
  23. package/application/helpers-common.js.map +1 -0
  24. package/application/helpers.android.d.ts +17 -0
  25. package/application/helpers.android.js +173 -0
  26. package/application/helpers.android.js.map +1 -0
  27. package/application/helpers.d.ts +25 -0
  28. package/application/helpers.ios.d.ts +27 -0
  29. package/application/helpers.ios.js +62 -0
  30. package/application/helpers.ios.js.map +1 -0
  31. package/application-settings/index.android.js +2 -2
  32. package/application-settings/index.android.js.map +1 -1
  33. package/color/color-common.d.ts +18 -19
  34. package/color/color-common.js +13 -14
  35. package/color/color-common.js.map +1 -1
  36. package/color/color-types.d.ts +49 -0
  37. package/color/color-types.js +3 -0
  38. package/color/color-types.js.map +1 -0
  39. package/color/index.ios.d.ts +2 -1
  40. package/color/index.ios.js.map +1 -1
  41. package/connectivity/index.android.js +5 -4
  42. package/connectivity/index.android.js.map +1 -1
  43. package/core-types/animation-types.d.ts +11 -0
  44. package/{ui/animation/animation-interfaces.js → core-types/animation-types.js} +1 -1
  45. package/core-types/animation-types.js.map +1 -0
  46. package/core-types/index.d.ts +1 -1
  47. package/core-types/index.js +2 -2
  48. package/core-types/index.js.map +1 -1
  49. package/core-types/validators.d.ts +2 -0
  50. package/core-types/validators.js +18 -0
  51. package/core-types/validators.js.map +1 -0
  52. package/css/css-tree-parser.js +17 -21
  53. package/css/css-tree-parser.js.map +1 -1
  54. package/css/lib/parse/index.d.ts +1 -0
  55. package/css/lib/parse/index.js +475 -577
  56. package/css/lib/parse/index.js.map +1 -0
  57. package/css/reworkcss.d.ts +25 -28
  58. package/css/reworkcss.js +5 -1
  59. package/css/reworkcss.js.map +1 -0
  60. package/css-mediaquery/index.js +1 -1
  61. package/css-mediaquery/index.js.map +1 -1
  62. package/css-value/reworkcss-value.d.ts +31 -8
  63. package/css-value/reworkcss-value.js +89 -111
  64. package/css-value/reworkcss-value.js.map +1 -0
  65. package/debugger/devtools-elements-interfaces.d.ts +1 -1
  66. package/debugger/devtools-elements.common.js +17 -8
  67. package/debugger/devtools-elements.common.js.map +1 -1
  68. package/debugger/devtools-elements.js +1 -1
  69. package/debugger/devtools-elements.js.map +1 -1
  70. package/debugger/dom-types.d.ts +24 -0
  71. package/debugger/{dom-node.js → dom-types.js} +11 -9
  72. package/debugger/dom-types.js.map +1 -0
  73. package/debugger/webinspector-css.d.ts +18 -18
  74. package/debugger/webinspector-css.js +1 -1
  75. package/debugger/webinspector-css.js.map +1 -1
  76. package/debugger/webinspector-dom.d.ts +15 -15
  77. package/debugger/webinspector-dom.js +1 -1
  78. package/debugger/webinspector-dom.js.map +1 -1
  79. package/debugger/webinspector-network.android.d.ts +9 -9
  80. package/debugger/webinspector-network.android.js +3 -3
  81. package/debugger/webinspector-network.android.js.map +1 -1
  82. package/debugger/webinspector-network.ios.d.ts +9 -9
  83. package/debugger/webinspector-network.ios.js +1 -1
  84. package/debugger/webinspector-network.ios.js.map +1 -1
  85. package/fetch/index.d.ts +72 -0
  86. package/fetch/index.js +448 -458
  87. package/fetch/index.js.map +1 -0
  88. package/file-system/file-system-access.android.js +32 -39
  89. package/file-system/file-system-access.android.js.map +1 -1
  90. package/file-system/file-system-access.ios.js +2 -15
  91. package/file-system/file-system-access.ios.js.map +1 -1
  92. package/file-system/index.d.ts +2 -2
  93. package/file-system/index.js +4 -11
  94. package/file-system/index.js.map +1 -1
  95. package/fps-meter/fps-native.android.d.ts +1 -2
  96. package/fps-meter/fps-native.android.js.map +1 -1
  97. package/fps-meter/fps-native.ios.d.ts +1 -2
  98. package/fps-meter/fps-native.ios.js.map +1 -1
  99. package/global-types.d.ts +7 -8
  100. package/globals/global-utils.d.ts +27 -0
  101. package/globals/global-utils.js +67 -0
  102. package/globals/global-utils.js.map +1 -0
  103. package/globals/index.d.ts +3 -7
  104. package/globals/index.js +276 -281
  105. package/globals/index.js.map +1 -1
  106. package/http/http-interfaces.d.ts +84 -0
  107. package/http/http-interfaces.js +6 -0
  108. package/http/http-interfaces.js.map +1 -0
  109. package/http/http-request/http-request-common.js +2 -2
  110. package/http/http-request/http-request-common.js.map +1 -1
  111. package/http/http-request/index.android.d.ts +3 -7
  112. package/http/http-request/index.android.js +6 -22
  113. package/http/http-request/index.android.js.map +1 -1
  114. package/http/http-request/index.d.ts +5 -1
  115. package/http/http-request/index.ios.d.ts +3 -7
  116. package/http/http-request/index.ios.js +6 -22
  117. package/http/http-request/index.ios.js.map +1 -1
  118. package/http/http-shared.d.ts +5 -0
  119. package/http/http-shared.js +14 -0
  120. package/http/http-shared.js.map +1 -0
  121. package/http/index.d.ts +6 -105
  122. package/http/index.js +10 -12
  123. package/http/index.js.map +1 -1
  124. package/image-asset/index.android.js +3 -3
  125. package/image-asset/index.android.js.map +1 -1
  126. package/image-source/index.android.d.ts +1 -1
  127. package/image-source/index.android.js +5 -23
  128. package/image-source/index.android.js.map +1 -1
  129. package/image-source/index.ios.js +2 -9
  130. package/image-source/index.ios.js.map +1 -1
  131. package/index.d.ts +12 -8
  132. package/index.js +6 -3
  133. package/index.js.map +1 -1
  134. package/inspector_modules.d.ts +11 -0
  135. package/inspector_modules.js +111 -3
  136. package/inspector_modules.js.map +1 -1
  137. package/js-libs/easysax/easysax.js +5 -3
  138. package/media-query-list/index.js +7 -17
  139. package/media-query-list/index.js.map +1 -1
  140. package/module-name-resolver/helpers.d.ts +14 -0
  141. package/module-name-resolver/helpers.js +27 -0
  142. package/module-name-resolver/helpers.js.map +1 -0
  143. package/module-name-resolver/index.d.ts +12 -22
  144. package/module-name-resolver/index.js +6 -18
  145. package/module-name-resolver/index.js.map +1 -1
  146. package/module-name-resolver/non-bundle-workflow-compat.js +32 -23
  147. package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
  148. package/module-name-resolver/qualifier-matcher/index.d.ts +6 -12
  149. package/module-name-resolver/qualifier-matcher/index.js +5 -5
  150. package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
  151. package/package.json +5 -2
  152. package/platform/device/index.android.js +2 -2
  153. package/platform/device/index.android.js.map +1 -1
  154. package/platform/screen/index.android.js +2 -2
  155. package/platform/screen/index.android.js.map +1 -1
  156. package/platform/screen/index.ios.js +2 -2
  157. package/platform/screen/index.ios.js.map +1 -1
  158. package/profiling/index.js +2 -1
  159. package/profiling/index.js.map +1 -1
  160. package/ui/action-bar/action-bar-common.js +4 -2
  161. package/ui/action-bar/action-bar-common.js.map +1 -1
  162. package/ui/action-bar/index.android.js +7 -6
  163. package/ui/action-bar/index.android.js.map +1 -1
  164. package/ui/action-bar/index.ios.js +10 -11
  165. package/ui/action-bar/index.ios.js.map +1 -1
  166. package/ui/activity-indicator/index.ios.js +3 -4
  167. package/ui/activity-indicator/index.ios.js.map +1 -1
  168. package/ui/animation/animation-common.d.ts +4 -4
  169. package/ui/animation/animation-common.js +2 -3
  170. package/ui/animation/animation-common.js.map +1 -1
  171. package/ui/animation/{animation-interfaces.d.ts → animation-shared.d.ts} +39 -31
  172. package/ui/animation/animation-shared.js +4 -0
  173. package/ui/animation/animation-shared.js.map +1 -0
  174. package/ui/animation/animation-types.d.ts +1 -0
  175. package/ui/animation/animation-types.js +3 -0
  176. package/ui/animation/animation-types.js.map +1 -0
  177. package/ui/animation/index.android.d.ts +1 -2
  178. package/ui/animation/index.android.js +5 -5
  179. package/ui/animation/index.android.js.map +1 -1
  180. package/ui/animation/index.d.ts +2 -138
  181. package/ui/animation/index.ios.d.ts +1 -2
  182. package/ui/animation/index.ios.js +3 -3
  183. package/ui/animation/index.ios.js.map +1 -1
  184. package/ui/animation/keyframe-animation.d.ts +67 -118
  185. package/ui/animation/keyframe-animation.js +2 -2
  186. package/ui/animation/keyframe-animation.js.map +1 -1
  187. package/ui/builder/binding-builder.d.ts +12 -15
  188. package/ui/builder/component-builder/index.js +5 -5
  189. package/ui/builder/component-builder/index.js.map +1 -1
  190. package/ui/builder/index.d.ts +179 -59
  191. package/ui/builder/index.js +450 -10
  192. package/ui/builder/index.js.map +1 -1
  193. package/ui/button/index.android.js +2 -1
  194. package/ui/button/index.android.js.map +1 -1
  195. package/ui/core/bindable/bindable-types.d.ts +37 -0
  196. package/ui/core/bindable/bindable-types.js +3 -0
  197. package/ui/core/bindable/bindable-types.js.map +1 -0
  198. package/ui/core/bindable/index.d.ts +2 -38
  199. package/ui/core/bindable/index.js +1 -2
  200. package/ui/core/bindable/index.js.map +1 -1
  201. package/ui/core/properties/index.d.ts +4 -37
  202. package/ui/core/properties/index.js +6 -35
  203. package/ui/core/properties/index.js.map +1 -1
  204. package/ui/core/properties/property-shared.d.ts +35 -0
  205. package/ui/core/properties/property-shared.js +16 -0
  206. package/ui/core/properties/property-shared.js.map +1 -0
  207. package/ui/core/view/index.android.d.ts +2 -2
  208. package/ui/core/view/index.android.js +13 -10
  209. package/ui/core/view/index.android.js.map +1 -1
  210. package/ui/core/view/index.d.ts +1 -61
  211. package/ui/core/view/index.ios.d.ts +3 -3
  212. package/ui/core/view/index.ios.js +11 -11
  213. package/ui/core/view/index.ios.js.map +1 -1
  214. package/ui/core/view/view-common.d.ts +19 -16
  215. package/ui/core/view/view-common.js +12 -14
  216. package/ui/core/view/view-common.js.map +1 -1
  217. package/ui/core/view/view-helper/index.ios.d.ts +2 -1
  218. package/ui/core/view/view-helper/index.ios.js +3 -4
  219. package/ui/core/view/view-helper/index.ios.js.map +1 -1
  220. package/ui/core/view/view-helper/view-helper-common.js +1 -3
  221. package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
  222. package/ui/core/view/view-helper/view-helper-shared.d.ts +5 -0
  223. package/ui/core/view/view-helper/view-helper-shared.js +6 -0
  224. package/ui/core/view/view-helper/view-helper-shared.js.map +1 -0
  225. package/ui/core/view/view-interfaces.d.ts +54 -0
  226. package/ui/core/view/view-interfaces.js +2 -0
  227. package/ui/core/view/view-interfaces.js.map +1 -0
  228. package/ui/core/view-base/index.d.ts +22 -24
  229. package/ui/core/view-base/index.js +9 -30
  230. package/ui/core/view-base/index.js.map +1 -1
  231. package/ui/core/view-base/utils.d.ts +1 -0
  232. package/ui/core/view-base/utils.js +9 -0
  233. package/ui/core/view-base/utils.js.map +1 -0
  234. package/ui/dialogs/dialogs-common.js +3 -3
  235. package/ui/dialogs/dialogs-common.js.map +1 -1
  236. package/ui/dialogs/index.android.js +8 -7
  237. package/ui/dialogs/index.android.js.map +1 -1
  238. package/ui/dialogs/index.ios.js +2 -2
  239. package/ui/dialogs/index.ios.js.map +1 -1
  240. package/ui/embedding/index.android.d.ts +1 -1
  241. package/ui/embedding/index.d.ts +1 -1
  242. package/ui/frame/fragment.android.js +3 -2
  243. package/ui/frame/fragment.android.js.map +1 -1
  244. package/ui/frame/fragment.transitions.android.js.map +1 -1
  245. package/ui/frame/frame-common.d.ts +3 -3
  246. package/ui/frame/frame-common.js.map +1 -1
  247. package/ui/frame/{callbacks/fragment-callbacks.d.ts → frame-helper-for-android.d.ts} +20 -1
  248. package/ui/frame/{callbacks/fragment-callbacks.js → frame-helper-for-android.js} +52 -38
  249. package/ui/frame/frame-helper-for-android.js.map +1 -0
  250. package/ui/frame/frame-interfaces.d.ts +30 -4
  251. package/ui/frame/frame-interfaces.js.map +1 -1
  252. package/ui/frame/frame-stack.js.map +1 -1
  253. package/ui/frame/index.android.d.ts +21 -5
  254. package/ui/frame/index.android.js +296 -19
  255. package/ui/frame/index.android.js.map +1 -1
  256. package/ui/frame/index.d.ts +19 -60
  257. package/ui/frame/index.ios.d.ts +3 -2
  258. package/ui/frame/index.ios.js +5 -4
  259. package/ui/frame/index.ios.js.map +1 -1
  260. package/ui/gestures/gestures-common.d.ts +4 -273
  261. package/ui/gestures/gestures-common.js +3 -146
  262. package/ui/gestures/gestures-common.js.map +1 -1
  263. package/ui/gestures/gestures-types.d.ts +108 -0
  264. package/ui/gestures/gestures-types.js +40 -0
  265. package/ui/gestures/gestures-types.js.map +1 -0
  266. package/ui/gestures/index.android.d.ts +29 -1
  267. package/ui/gestures/index.android.js +4 -2
  268. package/ui/gestures/index.android.js.map +1 -1
  269. package/ui/gestures/index.d.ts +35 -0
  270. package/ui/gestures/index.ios.d.ts +35 -1
  271. package/ui/gestures/index.ios.js +3 -3
  272. package/ui/gestures/index.ios.js.map +1 -1
  273. package/ui/gestures/touch-manager.d.ts +1 -1
  274. package/ui/html-view/index.ios.js +3 -3
  275. package/ui/html-view/index.ios.js.map +1 -1
  276. package/ui/image/image-common.js +1 -1
  277. package/ui/image/image-common.js.map +1 -1
  278. package/ui/image/index.android.js +1 -1
  279. package/ui/image/index.android.js.map +1 -1
  280. package/ui/image-cache/index.ios.js +5 -11
  281. package/ui/image-cache/index.ios.js.map +1 -1
  282. package/ui/index.d.ts +10 -5
  283. package/ui/index.js +18 -3
  284. package/ui/index.js.map +1 -1
  285. package/ui/label/index.ios.js.map +1 -1
  286. package/ui/layouts/absolute-layout/absolute-layout-common.js +1 -1
  287. package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
  288. package/ui/layouts/absolute-layout/index.android.js +1 -1
  289. package/ui/layouts/absolute-layout/index.android.js.map +1 -1
  290. package/ui/layouts/absolute-layout/index.d.ts +1 -1
  291. package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
  292. package/ui/layouts/flexbox-layout/flexbox-layout-common.js +2 -1
  293. package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
  294. package/ui/layouts/flexbox-layout/index.android.js +1 -1
  295. package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
  296. package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
  297. package/ui/layouts/layout-base.android.js +2 -1
  298. package/ui/layouts/layout-base.android.js.map +1 -1
  299. package/ui/layouts/stack-layout/index.ios.js.map +1 -1
  300. package/ui/layouts/wrap-layout/index.android.js +1 -1
  301. package/ui/layouts/wrap-layout/index.android.js.map +1 -1
  302. package/ui/layouts/wrap-layout/index.d.ts +1 -1
  303. package/ui/layouts/wrap-layout/wrap-layout-common.js +1 -1
  304. package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
  305. package/ui/list-view/index.android.d.ts +17 -1
  306. package/ui/list-view/index.android.js +402 -32
  307. package/ui/list-view/index.android.js.map +1 -1
  308. package/ui/list-view/index.d.ts +66 -1
  309. package/ui/list-view/index.ios.d.ts +24 -2
  310. package/ui/list-view/index.ios.js +385 -10
  311. package/ui/list-view/index.ios.js.map +1 -1
  312. package/ui/list-view/list-view-common.d.ts +15 -0
  313. package/ui/list-view/list-view-common.js +73 -1
  314. package/ui/list-view/list-view-common.js.map +1 -1
  315. package/ui/page/events.d.ts +6 -0
  316. package/ui/page/events.js +7 -0
  317. package/ui/page/events.js.map +1 -0
  318. package/ui/page/index.android.js +2 -1
  319. package/ui/page/index.android.js.map +1 -1
  320. package/ui/page/index.d.ts +1 -1
  321. package/ui/page/index.ios.js +4 -5
  322. package/ui/page/index.ios.js.map +1 -1
  323. package/ui/page/page-common.d.ts +3 -2
  324. package/ui/page/page-common.js +5 -4
  325. package/ui/page/page-common.js.map +1 -1
  326. package/ui/scroll-view/index.ios.js +3 -3
  327. package/ui/scroll-view/index.ios.js.map +1 -1
  328. package/ui/styling/background-common.js +0 -1
  329. package/ui/styling/background-common.js.map +1 -1
  330. package/ui/styling/background.android.d.ts +0 -6
  331. package/ui/styling/background.android.js +1 -53
  332. package/ui/styling/background.android.js.map +1 -1
  333. package/ui/styling/background.ios.js +2 -1
  334. package/ui/styling/background.ios.js.map +1 -1
  335. package/ui/styling/converters.d.ts +2 -2
  336. package/ui/styling/css-shadow.js.map +1 -1
  337. package/ui/styling/css-stroke.js.map +1 -1
  338. package/ui/styling/css-transform.d.ts +1 -1
  339. package/ui/styling/css-utils.js +1 -1
  340. package/ui/styling/css-utils.js.map +1 -1
  341. package/ui/styling/font.android.js +2 -2
  342. package/ui/styling/font.android.js.map +1 -1
  343. package/ui/styling/font.ios.js +10 -10
  344. package/ui/styling/font.ios.js.map +1 -1
  345. package/ui/styling/length-shared.d.ts +52 -0
  346. package/ui/styling/length-shared.js +173 -0
  347. package/ui/styling/length-shared.js.map +1 -0
  348. package/ui/styling/style/index.d.ts +1 -1
  349. package/ui/styling/style-properties.d.ts +58 -112
  350. package/ui/styling/style-properties.js +7 -93
  351. package/ui/styling/style-properties.js.map +1 -1
  352. package/ui/styling/style-scope.d.ts +85 -48
  353. package/ui/styling/style-scope.js +30 -36
  354. package/ui/styling/style-scope.js.map +1 -1
  355. package/ui/styling/styling-profile.d.ts +1 -0
  356. package/ui/styling/styling-profile.js +4 -0
  357. package/ui/styling/styling-profile.js.map +1 -0
  358. package/ui/styling/styling-shared.d.ts +3 -0
  359. package/ui/styling/styling-shared.js +6 -0
  360. package/ui/styling/styling-shared.js.map +1 -0
  361. package/ui/switch/index.ios.js +5 -5
  362. package/ui/switch/index.ios.js.map +1 -1
  363. package/ui/tab-view/index.android.js +6 -6
  364. package/ui/tab-view/index.android.js.map +1 -1
  365. package/ui/text-base/index.android.d.ts +1 -1
  366. package/ui/text-base/index.android.js +4 -4
  367. package/ui/text-base/index.android.js.map +1 -1
  368. package/ui/text-base/index.d.ts +1 -1
  369. package/ui/text-base/index.ios.js +5 -4
  370. package/ui/text-base/index.ios.js.map +1 -1
  371. package/ui/text-view/index.ios.js.map +1 -1
  372. package/ui/transition/fade-transition.ios.js +1 -1
  373. package/ui/transition/fade-transition.ios.js.map +1 -1
  374. package/ui/transition/index.ios.js +1 -1
  375. package/ui/transition/index.ios.js.map +1 -1
  376. package/ui/transition/modal-transition.ios.js +1 -1
  377. package/ui/transition/modal-transition.ios.js.map +1 -1
  378. package/ui/transition/page-transition.android.d.ts +1 -1
  379. package/ui/transition/page-transition.android.js +4 -4
  380. package/ui/transition/page-transition.android.js.map +1 -1
  381. package/ui/transition/page-transition.ios.js +1 -1
  382. package/ui/transition/page-transition.ios.js.map +1 -1
  383. package/ui/transition/shared-transition-helper.ios.js +1 -1
  384. package/ui/transition/shared-transition-helper.ios.js.map +1 -1
  385. package/ui/transition/shared-transition.js +2 -1
  386. package/ui/transition/shared-transition.js.map +1 -1
  387. package/ui/transition/slide-transition.ios.js +2 -2
  388. package/ui/transition/slide-transition.ios.js.map +1 -1
  389. package/utils/animation-helpers.d.ts +27 -0
  390. package/utils/animation-helpers.js +48 -0
  391. package/utils/animation-helpers.js.map +1 -0
  392. package/utils/common.d.ts +1 -38
  393. package/utils/common.js +2 -112
  394. package/utils/common.js.map +1 -1
  395. package/utils/debug-source.d.ts +19 -0
  396. package/utils/debug-source.js +78 -0
  397. package/utils/debug-source.js.map +1 -0
  398. package/utils/debug.js +1 -59
  399. package/utils/debug.js.map +1 -1
  400. package/utils/index.android.d.ts +3 -1
  401. package/utils/index.android.js +37 -11
  402. package/utils/index.android.js.map +1 -1
  403. package/utils/index.d.ts +2 -14
  404. package/utils/index.ios.d.ts +4 -1
  405. package/utils/index.ios.js +32 -5
  406. package/utils/index.ios.js.map +1 -1
  407. package/utils/layout-helper/index.android.js +4 -4
  408. package/utils/layout-helper/index.android.js.map +1 -1
  409. package/utils/layout-helper/index.d.ts +6 -4
  410. package/utils/layout-helper/index.ios.js +5 -5
  411. package/utils/layout-helper/index.ios.js.map +1 -1
  412. package/utils/layout-helper/layout-helper-common.d.ts +0 -9
  413. package/utils/layout-helper/layout-helper-common.js +1 -9
  414. package/utils/layout-helper/layout-helper-common.js.map +1 -1
  415. package/utils/layout-helper/layout-helper-shared.d.ts +9 -0
  416. package/utils/layout-helper/layout-helper-shared.js +13 -0
  417. package/utils/layout-helper/layout-helper-shared.js.map +1 -0
  418. package/utils/{android/index.d.ts → native-helper-for-android.d.ts} +4 -2
  419. package/utils/native-helper-for-android.js +273 -0
  420. package/utils/native-helper-for-android.js.map +1 -0
  421. package/utils/native-helper.android.d.ts +29 -5
  422. package/utils/native-helper.android.js +18 -131
  423. package/utils/native-helper.android.js.map +1 -1
  424. package/utils/native-helper.d.ts +206 -258
  425. package/utils/native-helper.ios.d.ts +72 -3
  426. package/utils/native-helper.ios.js +250 -3
  427. package/utils/native-helper.ios.js.map +1 -1
  428. package/utils/shared.d.ts +17 -0
  429. package/utils/shared.js +40 -0
  430. package/utils/shared.js.map +1 -0
  431. package/utils/utils-shared.d.ts +1 -0
  432. package/utils/utils-shared.js +8 -0
  433. package/utils/utils-shared.js.map +1 -0
  434. package/xhr/index.js +12 -13
  435. package/xhr/index.js.map +1 -1
  436. package/xml/index.d.ts +94 -98
  437. package/xml/index.js +58 -2
  438. package/xml/index.js.map +1 -1
  439. package/accessibility/accessibility-css-helper.d.ts +0 -1
  440. package/accessibility/accessibility-css-helper.js +0 -101
  441. package/accessibility/accessibility-css-helper.js.map +0 -1
  442. package/accessibility/accessibility-service-common.d.ts +0 -8
  443. package/accessibility/accessibility-service-common.js +0 -26
  444. package/accessibility/accessibility-service-common.js.map +0 -1
  445. package/accessibility/accessibility-service.android.d.ts +0 -6
  446. package/accessibility/accessibility-service.android.js +0 -103
  447. package/accessibility/accessibility-service.android.js.map +0 -1
  448. package/accessibility/accessibility-service.d.ts +0 -10
  449. package/accessibility/accessibility-service.ios.d.ts +0 -6
  450. package/accessibility/accessibility-service.ios.js +0 -61
  451. package/accessibility/accessibility-service.ios.js.map +0 -1
  452. package/accessibility/accessibility-types.d.ts +0 -224
  453. package/accessibility/accessibility-types.js +0 -222
  454. package/accessibility/accessibility-types.js.map +0 -1
  455. package/accessibility/font-scale-common.d.ts +0 -7
  456. package/accessibility/font-scale-common.js +0 -14
  457. package/accessibility/font-scale-common.js.map +0 -1
  458. package/accessibility/font-scale.android.d.ts +0 -5
  459. package/accessibility/font-scale.android.js +0 -55
  460. package/accessibility/font-scale.android.js.map +0 -1
  461. package/accessibility/font-scale.d.ts +0 -9
  462. package/accessibility/font-scale.ios.d.ts +0 -5
  463. package/accessibility/font-scale.ios.js +0 -89
  464. package/accessibility/font-scale.ios.js.map +0 -1
  465. package/accessibility/index.android.d.ts +0 -10
  466. package/accessibility/index.android.js +0 -577
  467. package/accessibility/index.android.js.map +0 -1
  468. package/accessibility/index.ios.d.ts +0 -9
  469. package/accessibility/index.ios.js +0 -229
  470. package/accessibility/index.ios.js.map +0 -1
  471. package/css/package.json +0 -36
  472. package/css-value/package.json +0 -23
  473. package/debugger/dom-node.d.ts +0 -27
  474. package/debugger/dom-node.js.map +0 -1
  475. package/ui/animation/animation-interfaces.js.map +0 -1
  476. package/ui/builder/xml2ui.d.ts +0 -134
  477. package/ui/builder/xml2ui.js +0 -397
  478. package/ui/builder/xml2ui.js.map +0 -1
  479. package/ui/frame/callbacks/activity-callbacks.d.ts +0 -19
  480. package/ui/frame/callbacks/activity-callbacks.js +0 -301
  481. package/ui/frame/callbacks/activity-callbacks.js.map +0 -1
  482. package/ui/frame/callbacks/fragment-callbacks.js.map +0 -1
  483. package/utils/android/index.js +0 -160
  484. package/utils/android/index.js.map +0 -1
  485. package/utils/ios/index.d.ts +0 -39
  486. package/utils/ios/index.js +0 -229
  487. package/utils/ios/index.js.map +0 -1
package/fetch/index.js CHANGED
@@ -1,335 +1,301 @@
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
- };
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);
46
34
  }
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();
35
+ if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {
36
+ throw new TypeError('Invalid character in header field name: "' + name + '"');
56
37
  }
57
-
58
- function normalizeValue(value) {
59
- if (typeof value !== "string") {
60
- value = String(value);
61
- }
62
- return value;
38
+ return name.toLowerCase();
39
+ }
40
+ function normalizeValue(value) {
41
+ if (typeof value !== 'string') {
42
+ value = String(value);
63
43
  }
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;
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;
81
56
  }
82
-
83
- function Headers(headers) {
57
+ return iterator;
58
+ }
59
+ export class Headers {
60
+ constructor(headers) {
84
61
  this.map = {};
85
-
86
62
  if (headers instanceof Headers) {
87
- headers.forEach(function (value, name) {
63
+ headers.forEach((value, name) => {
88
64
  this.append(name, value);
89
- }, this);
90
- } else if (Array.isArray(headers)) {
91
- headers.forEach(function (header) {
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
+ }
92
72
  this.append(header[0], header[1]);
93
- }, this);
94
- } else if (headers) {
95
- Object.getOwnPropertyNames(headers).forEach(function (name) {
73
+ });
74
+ }
75
+ else if (headers) {
76
+ Object.getOwnPropertyNames(headers).forEach((name) => {
96
77
  this.append(name, headers[name]);
97
- }, this);
78
+ });
98
79
  }
99
80
  }
100
-
101
- Headers.prototype.append = function (name, value) {
81
+ append(name, value) {
102
82
  name = normalizeName(name);
103
83
  value = normalizeValue(value);
104
- var oldValue = this.map[name];
105
- this.map[name] = oldValue ? oldValue + ", " + value : value;
106
- };
107
-
108
- Headers.prototype["delete"] = function (name) {
84
+ const oldValue = this.map[name];
85
+ this.map[name] = oldValue ? oldValue + ', ' + value : value;
86
+ }
87
+ delete(name) {
109
88
  delete this.map[normalizeName(name)];
110
- };
111
-
112
- Headers.prototype.get = function (name) {
89
+ }
90
+ get(name) {
113
91
  name = normalizeName(name);
114
92
  return this.has(name) ? this.map[name] : null;
115
- };
116
-
117
- Headers.prototype.has = function (name) {
118
- return this.map.hasOwnProperty(normalizeName(name));
119
- };
120
-
121
- Headers.prototype.set = function (name, value) {
93
+ }
94
+ has(name) {
95
+ return Object.prototype.hasOwnProperty.call(this.map, normalizeName(name));
96
+ }
97
+ set(name, value) {
122
98
  this.map[normalizeName(name)] = normalizeValue(value);
123
- };
124
-
125
- Headers.prototype.forEach = function (callback, thisArg) {
126
- for (var name in this.map) {
127
- if (this.map.hasOwnProperty(name)) {
99
+ }
100
+ forEach(callback, thisArg) {
101
+ for (const name in this.map) {
102
+ if (Object.prototype.hasOwnProperty.call(this.map, name)) {
128
103
  callback.call(thisArg, this.map[name], name, this);
129
104
  }
130
105
  }
131
- };
132
-
133
- Headers.prototype.keys = function () {
134
- var items = [];
135
- this.forEach(function (value, name) {
136
- items.push(name);
137
- });
138
- return iteratorFor(items);
139
- };
140
-
141
- Headers.prototype.values = function () {
142
- var items = [];
143
- this.forEach(function (value) {
144
- items.push(value);
145
- });
106
+ }
107
+ keys() {
108
+ const items = [];
109
+ this.forEach((_, name) => items.push(name));
146
110
  return iteratorFor(items);
147
- };
148
-
149
- Headers.prototype.entries = function () {
150
- var items = [];
151
- this.forEach(function (value, name) {
152
- items.push([name, value]);
153
- });
111
+ }
112
+ values() {
113
+ const items = [];
114
+ this.forEach((value) => items.push(value));
154
115
  return iteratorFor(items);
155
- };
156
-
157
- if (support.iterable) {
158
- Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
159
116
  }
160
-
161
- function consumed(body) {
162
- if (body.bodyUsed) {
163
- return Promise.reject(new TypeError("Already read"));
164
- }
165
- body.bodyUsed = true;
117
+ entries() {
118
+ const items = [];
119
+ this.forEach((value, name) => items.push([name, value]));
120
+ return iteratorFor(items);
166
121
  }
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
- });
122
+ [Symbol.iterator]() {
123
+ return this.entries();
177
124
  }
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() {
125
+ }
126
+ // Body mixin
127
+ export class Body {
128
+ constructor() {
214
129
  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);
130
+ }
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');
242
166
  }
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
- }
167
+ else if (this._bodyBlob && this._bodyBlob.type) {
168
+ this.headers.set('content-type', this._bodyBlob.type);
258
169
  }
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
- };
170
+ else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
171
+ this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
172
+ }
173
+ }
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]));
286
191
  }
287
-
288
- this.text = function () {
289
- var rejected = consumed(this);
290
- if (rejected) {
291
- return rejected;
192
+ }
193
+ arrayBuffer() {
194
+ if (this._bodyArrayBuffer) {
195
+ const consumedResult = consumed(this);
196
+ if (consumedResult) {
197
+ return consumedResult;
292
198
  }
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);
199
+ else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
200
+ return Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength));
201
+ }
202
+ else {
203
+ return Promise.resolve(this._bodyArrayBuffer);
302
204
  }
303
- };
304
-
305
- if (support.formData) {
306
- this.formData = function () {
307
- return this.text().then(decode);
308
- };
309
205
  }
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
-
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;
330
296
  if (input instanceof Request) {
331
297
  if (input.bodyUsed) {
332
- throw new TypeError("Already read");
298
+ throw new TypeError('Already read');
333
299
  }
334
300
  this.url = input.url;
335
301
  this.credentials = input.credentials;
@@ -343,197 +309,221 @@
343
309
  body = input._bodyInit;
344
310
  input.bodyUsed = true;
345
311
  }
346
- } else {
312
+ }
313
+ else {
347
314
  this.url = String(input);
348
315
  }
349
-
350
- this.credentials = options.credentials || this.credentials || "same-origin";
316
+ this.credentials = options.credentials || this.credentials || 'same-origin';
351
317
  if (options.headers || !this.headers) {
352
318
  this.headers = new Headers(options.headers);
353
319
  }
354
- this.method = normalizeMethod(options.method || this.method || "GET");
320
+ this.method = normalizeMethod(options.method || this.method || 'GET');
355
321
  this.mode = options.mode || this.mode || null;
356
- this.signal = options.signal || this.signal;
322
+ this.signal = options.signal || this.signal || ('AbortController' in g ? new AbortController().signal : undefined);
357
323
  this.referrer = null;
358
-
359
- if ((this.method === "GET" || this.method === "HEAD") && body) {
360
- throw new TypeError("Body not allowed for GET or HEAD requests");
324
+ if ((this.method === 'GET' || this.method === 'HEAD') && body) {
325
+ throw new TypeError('Body not allowed for GET or HEAD requests');
361
326
  }
362
327
  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
+ }
363
340
  }
364
-
365
- Request.prototype.clone = function () {
341
+ clone() {
366
342
  return new Request(this, { body: this._bodyInit });
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();
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 {
395
374
  headers.append(key, value);
396
375
  }
397
- });
398
- return headers;
399
- }
400
-
401
- Body.call(Request.prototype);
402
-
403
- function Response(bodyInit, options) {
404
- if (!options) {
405
- options = {};
376
+ catch (err) {
377
+ console.warn('Response ' + err.message);
378
+ }
406
379
  }
407
-
408
- this.type = "default";
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';
409
388
  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
+ }
410
392
  this.ok = this.status >= 200 && this.status < 300;
411
- this.statusText = "statusText" in options ? options.statusText : "OK";
393
+ this.statusText = options.statusText === undefined ? '' : String(options.statusText);
412
394
  this.headers = new Headers(options.headers);
413
- this.url = options.url || "";
395
+ this.url = options.url || '';
414
396
  this._initBody(bodyInit);
415
397
  }
416
-
417
- Body.call(Response.prototype);
418
-
419
- Response.prototype.clone = function () {
398
+ clone() {
420
399
  return new Response(this._bodyInit, {
421
400
  status: this.status,
422
401
  statusText: this.statusText,
423
402
  headers: new Headers(this.headers),
424
- url: this.url
403
+ url: this.url,
425
404
  });
426
- };
427
-
428
- Response.error = function () {
429
- var response = new Response(null, { status: 0, statusText: "" });
430
- response.type = "error";
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';
431
411
  return response;
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) {
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) {
449
428
  this.message = message;
450
429
  this.name = name;
451
- var error = Error(message);
430
+ const error = new Error(message);
452
431
  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);
453
462
  };
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"));
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;
464
475
  }
465
-
466
- var xhr = new XMLHttpRequest();
467
-
468
- function abortXhr() {
469
- xhr.abort();
476
+ catch (e) {
477
+ return url;
470
478
  }
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;
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';
504
490
  }
505
-
506
- if ("responseType" in xhr && support.blob) {
507
- xhr.responseType = "blob";
491
+ else if (support.arrayBuffer) {
492
+ xhr.responseType = 'arraybuffer';
508
493
  }
509
-
510
- request.headers.forEach(function (value, name) {
511
- xhr.setRequestHeader(name, value);
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]));
512
500
  });
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
- })();
501
+ request.headers.forEach((value, name) => {
502
+ if (!names.includes(name)) {
503
+ xhr.setRequestHeader(name, value);
504
+ }
505
+ });
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