@nstudio/nativescript-compiler 0.0.0-stage → 9.2.0-alpha.10

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 (1610) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +72 -2
  3. package/bin/build-dist.mjs +145 -0
  4. package/bin/ns-compiled-adapter.js +46 -0
  5. package/bin/ns-compiled-doctor.js +15 -0
  6. package/bin/ns-compiled-retrace.js +16 -0
  7. package/bin/ns-compiled-verify.js +15 -0
  8. package/bin/ns-compiled.js +26 -0
  9. package/bin/strip-types.js +18 -0
  10. package/config.d.ts +41 -0
  11. package/dist/adapters/active.js +59 -0
  12. package/dist/adapters/first-party.js +12 -0
  13. package/dist/adapters/framework.js +135 -0
  14. package/dist/adapters/hooks.js +115 -0
  15. package/dist/adapters/load.js +188 -0
  16. package/dist/api/adapter-api.js +2 -0
  17. package/dist/api/binding-api.js +11 -0
  18. package/dist/api/elements.js +21 -0
  19. package/dist/api/ir.js +29 -0
  20. package/dist/api/listview.js +27 -0
  21. package/dist/api/rewrite.js +98 -0
  22. package/dist/api/typescript-internal.d.ts +35 -0
  23. package/dist/cli/commands/compile-android.cjs +79 -0
  24. package/dist/cli/commands/compile-doctor.cjs +45 -0
  25. package/dist/cli/commands/compile-ios.cjs +77 -0
  26. package/dist/cli/commands/compile-retrace.cjs +40 -0
  27. package/dist/cli/commands/compile-verify.cjs +73 -0
  28. package/dist/cli/contracts.cjs +36 -0
  29. package/dist/cli/runtime.cjs +166 -0
  30. package/dist/css/css.js +118 -0
  31. package/dist/css/worker.js +242 -0
  32. package/dist/driver/cli.js +95 -0
  33. package/dist/driver/compile.js +571 -0
  34. package/dist/driver/contract.js +136 -0
  35. package/dist/driver/mirror.js +71 -0
  36. package/dist/driver/paths.js +19 -0
  37. package/dist/driver/preflight.js +206 -0
  38. package/dist/driver/toolchain.js +46 -0
  39. package/dist/driver/unimplemented.js +326 -0
  40. package/dist/kit/core-source.js +107 -0
  41. package/dist/kit/kit-index.js +105 -0
  42. package/dist/kit/manifest.js +468 -0
  43. package/dist/kit/overlay.js +56 -0
  44. package/dist/kit/swift-declarations.js +643 -0
  45. package/dist/kotlin/access.js +635 -0
  46. package/dist/kotlin/app-modules.js +111 -0
  47. package/dist/kotlin/arguments.js +398 -0
  48. package/dist/kotlin/assignment.js +226 -0
  49. package/dist/kotlin/builtins.js +575 -0
  50. package/dist/kotlin/calls.js +519 -0
  51. package/dist/kotlin/checked.js +61 -0
  52. package/dist/kotlin/class-accessors.js +129 -0
  53. package/dist/kotlin/class-constructor.js +129 -0
  54. package/dist/kotlin/class-declaration.js +337 -0
  55. package/dist/kotlin/class-fields.js +362 -0
  56. package/dist/kotlin/class-methods.js +213 -0
  57. package/dist/kotlin/classes.js +333 -0
  58. package/dist/kotlin/components.js +450 -0
  59. package/dist/kotlin/construction.js +235 -0
  60. package/dist/kotlin/control-flow.js +188 -0
  61. package/dist/kotlin/conversion.js +513 -0
  62. package/dist/kotlin/core-api.js +762 -0
  63. package/dist/kotlin/core-index.js +228 -0
  64. package/dist/kotlin/declarations.js +461 -0
  65. package/dist/kotlin/diagnostics.js +28 -0
  66. package/dist/kotlin/expression-statements.js +227 -0
  67. package/dist/kotlin/expressions.js +468 -0
  68. package/dist/kotlin/functions.js +479 -0
  69. package/dist/kotlin/global-calls.js +307 -0
  70. package/dist/kotlin/install.js +89 -0
  71. package/dist/kotlin/key-plans.js +117 -0
  72. package/dist/kotlin/kit-gen.js +581 -0
  73. package/dist/kotlin/ktfmt.js +60 -0
  74. package/dist/kotlin/library.js +62 -0
  75. package/dist/kotlin/literals.js +593 -0
  76. package/dist/kotlin/loops.js +185 -0
  77. package/dist/kotlin/mixins.js +103 -0
  78. package/dist/kotlin/modules.js +769 -0
  79. package/dist/kotlin/names.js +273 -0
  80. package/dist/kotlin/narrowing.js +180 -0
  81. package/dist/kotlin/native/api.js +117 -0
  82. package/dist/kotlin/native/bridging.js +254 -0
  83. package/dist/kotlin/native/calls.js +408 -0
  84. package/dist/kotlin/native/classfiles.js +524 -0
  85. package/dist/kotlin/native/classpath.js +32 -0
  86. package/dist/kotlin/native/conversions.js +280 -0
  87. package/dist/kotlin/native/extend.js +302 -0
  88. package/dist/kotlin/native/members.js +240 -0
  89. package/dist/kotlin/native/overloads.js +253 -0
  90. package/dist/kotlin/native/subclasses.js +378 -0
  91. package/dist/kotlin/native/types.js +421 -0
  92. package/dist/kotlin/operators.js +449 -0
  93. package/dist/kotlin/optional-chains.js +279 -0
  94. package/dist/kotlin/overrides.js +835 -0
  95. package/dist/kotlin/placement.js +749 -0
  96. package/dist/kotlin/prototype-calls.js +154 -0
  97. package/dist/kotlin/render.js +363 -0
  98. package/dist/kotlin/state-backend.js +123 -0
  99. package/dist/kotlin/statements.js +426 -0
  100. package/dist/kotlin/static-calls.js +296 -0
  101. package/dist/kotlin/syntax.js +689 -0
  102. package/dist/kotlin/translator-types.js +1 -0
  103. package/dist/kotlin/translator.js +810 -0
  104. package/dist/kotlin/type-facts.js +414 -0
  105. package/dist/kotlin/type-tests.js +250 -0
  106. package/dist/kotlin/types.js +662 -0
  107. package/dist/kotlin/untyped-values.js +356 -0
  108. package/dist/plugins/bindings-android.js +69 -0
  109. package/dist/plugins/bindings.js +93 -0
  110. package/dist/plugins/native-android.js +582 -0
  111. package/dist/plugins/native-ios.js +632 -0
  112. package/dist/plugins/resolve.js +108 -0
  113. package/dist/plugins/source.js +1124 -0
  114. package/dist/program/app-modules.js +52 -0
  115. package/dist/program/app-paths.js +60 -0
  116. package/dist/program/build-caches.js +14 -0
  117. package/dist/program/build-context.js +48 -0
  118. package/dist/program/constructor-factories.js +134 -0
  119. package/dist/program/core-facts.js +151 -0
  120. package/dist/program/core-patches.js +59 -0
  121. package/dist/program/env.js +4 -0
  122. package/dist/program/module-order.js +123 -0
  123. package/dist/program/order.js +23 -0
  124. package/dist/program/patterns.js +99 -0
  125. package/dist/program/platform.js +401 -0
  126. package/dist/program/program.js +726 -0
  127. package/dist/program/properties.js +61 -0
  128. package/dist/program/reach.js +444 -0
  129. package/dist/program/source-lines.js +268 -0
  130. package/dist/program/stable-names.js +112 -0
  131. package/dist/semantics/apis/api.js +31 -0
  132. package/dist/semantics/apis/array.js +69 -0
  133. package/dist/semantics/apis/bigint.js +53 -0
  134. package/dist/semantics/apis/console.js +29 -0
  135. package/dist/semantics/apis/date.js +7 -0
  136. package/dist/semantics/apis/globals.js +40 -0
  137. package/dist/semantics/apis/json.js +6 -0
  138. package/dist/semantics/apis/mapset.js +21 -0
  139. package/dist/semantics/apis/math.js +48 -0
  140. package/dist/semantics/apis/number.js +33 -0
  141. package/dist/semantics/apis/object.js +25 -0
  142. package/dist/semantics/apis/operators.js +316 -0
  143. package/dist/semantics/apis/promise.js +22 -0
  144. package/dist/semantics/apis/regexp.js +15 -0
  145. package/dist/semantics/apis/statics.js +61 -0
  146. package/dist/semantics/apis/string.js +45 -0
  147. package/dist/semantics/ast.js +315 -0
  148. package/dist/semantics/async.js +582 -0
  149. package/dist/semantics/class-plan.js +168 -0
  150. package/dist/semantics/classes.js +562 -0
  151. package/dist/semantics/config.js +29 -0
  152. package/dist/semantics/constant-init.js +107 -0
  153. package/dist/semantics/conversion.js +255 -0
  154. package/dist/semantics/decision-trace.js +304 -0
  155. package/dist/semantics/facts.js +433 -0
  156. package/dist/semantics/forms/by-name.js +338 -0
  157. package/dist/semantics/forms/flow.js +336 -0
  158. package/dist/semantics/forms/forms.js +311 -0
  159. package/dist/semantics/forms/observers.js +513 -0
  160. package/dist/semantics/forms/open.js +218 -0
  161. package/dist/semantics/forms/place-calls.js +387 -0
  162. package/dist/semantics/forms/placements.js +296 -0
  163. package/dist/semantics/forms/results.js +307 -0
  164. package/dist/semantics/forms/union-find.js +157 -0
  165. package/dist/semantics/globals.js +46 -0
  166. package/dist/semantics/lang/arrays.js +238 -0
  167. package/dist/semantics/lang/fields.js +211 -0
  168. package/dist/semantics/lang/members.js +277 -0
  169. package/dist/semantics/lang/prototypes.js +262 -0
  170. package/dist/semantics/lang/this-args.js +189 -0
  171. package/dist/semantics/lang.js +232 -0
  172. package/dist/semantics/ledger.js +157 -0
  173. package/dist/semantics/limits.js +11 -0
  174. package/dist/semantics/losses.js +201 -0
  175. package/dist/semantics/lowering-methods.js +42 -0
  176. package/dist/semantics/marks.js +39 -0
  177. package/dist/semantics/nullish.js +918 -0
  178. package/dist/semantics/observers.js +1 -0
  179. package/dist/semantics/placement.js +698 -0
  180. package/dist/semantics/platform-globals.js +20 -0
  181. package/dist/semantics/read-sites.js +29 -0
  182. package/dist/semantics/refusals.js +206 -0
  183. package/dist/semantics/refuse-construction.js +64 -0
  184. package/dist/semantics/refuse-receivers.js +189 -0
  185. package/dist/semantics/refuse-scope.js +82 -0
  186. package/dist/semantics/regexp.js +219 -0
  187. package/dist/semantics/result-shapes.js +203 -0
  188. package/dist/semantics/runtime.js +482 -0
  189. package/dist/semantics/shape-defined-keys.js +146 -0
  190. package/dist/semantics/shape-instance-keys.js +230 -0
  191. package/dist/semantics/shape-map.js +72 -0
  192. package/dist/semantics/shapes.js +660 -0
  193. package/dist/semantics/sharing.js +406 -0
  194. package/dist/semantics/signals.js +166 -0
  195. package/dist/semantics/spelled.js +45 -0
  196. package/dist/semantics/states/by-name.js +46 -0
  197. package/dist/semantics/states/elements.js +310 -0
  198. package/dist/semantics/states/fields.js +308 -0
  199. package/dist/semantics/states/foreign.js +208 -0
  200. package/dist/semantics/states/lenient.js +246 -0
  201. package/dist/semantics/states/missing.js +289 -0
  202. package/dist/semantics/states/nil.js +223 -0
  203. package/dist/semantics/states/parameters.js +191 -0
  204. package/dist/semantics/states/predicates.js +232 -0
  205. package/dist/semantics/states/reads.js +247 -0
  206. package/dist/semantics/states/results.js +113 -0
  207. package/dist/semantics/states/untrusted.js +141 -0
  208. package/dist/semantics/states/untyped.js +194 -0
  209. package/dist/semantics/states/value-states.js +422 -0
  210. package/dist/semantics/tdz.js +106 -0
  211. package/dist/semantics/threading.js +77 -0
  212. package/dist/semantics/throws.js +880 -0
  213. package/dist/semantics/top-names.js +59 -0
  214. package/dist/semantics/translator-methods.js +602 -0
  215. package/dist/semantics/trust.js +321 -0
  216. package/dist/semantics/type-methods.js +168 -0
  217. package/dist/semantics/type-step.js +116 -0
  218. package/dist/semantics/types.js +458 -0
  219. package/dist/semantics/worker-state.js +198 -0
  220. package/dist/swift/access.js +754 -0
  221. package/dist/swift/app-modules.js +41 -0
  222. package/dist/swift/arguments.js +237 -0
  223. package/dist/swift/assignment.js +270 -0
  224. package/dist/swift/availability.js +146 -0
  225. package/dist/swift/builtins.js +822 -0
  226. package/dist/swift/calls.js +493 -0
  227. package/dist/swift/casts.js +218 -0
  228. package/dist/swift/checked.js +433 -0
  229. package/dist/swift/class-accessors.js +139 -0
  230. package/dist/swift/class-constructor.js +144 -0
  231. package/dist/swift/class-declaration.js +308 -0
  232. package/dist/swift/class-fields.js +361 -0
  233. package/dist/swift/class-methods.js +247 -0
  234. package/dist/swift/classes.js +524 -0
  235. package/dist/swift/components.js +386 -0
  236. package/dist/swift/construction.js +291 -0
  237. package/dist/swift/control-flow.js +210 -0
  238. package/dist/swift/conversion.js +425 -0
  239. package/dist/swift/core-api.js +1068 -0
  240. package/dist/swift/declarations.js +389 -0
  241. package/dist/swift/enums.js +58 -0
  242. package/dist/swift/expression-statements.js +312 -0
  243. package/dist/swift/expressions.js +575 -0
  244. package/dist/swift/from-any.js +316 -0
  245. package/dist/swift/functions.js +498 -0
  246. package/dist/swift/generics.js +124 -0
  247. package/dist/swift/global-calls.js +217 -0
  248. package/dist/swift/install.js +109 -0
  249. package/dist/swift/key-plans.js +136 -0
  250. package/dist/swift/kit-gen.js +605 -0
  251. package/dist/swift/lenient.js +468 -0
  252. package/dist/swift/library.js +109 -0
  253. package/dist/swift/literals.js +509 -0
  254. package/dist/swift/loops.js +245 -0
  255. package/dist/swift/marks.js +212 -0
  256. package/dist/swift/members.js +253 -0
  257. package/dist/swift/method-values.js +179 -0
  258. package/dist/swift/mixins.js +113 -0
  259. package/dist/swift/modules.js +969 -0
  260. package/dist/swift/names.js +370 -0
  261. package/dist/swift/narrowing.js +170 -0
  262. package/dist/swift/native/api.js +269 -0
  263. package/dist/swift/native/bridging.js +240 -0
  264. package/dist/swift/native/calls.js +586 -0
  265. package/dist/swift/native/conversions.js +532 -0
  266. package/dist/swift/native/dispatch.js +218 -0
  267. package/dist/swift/native/members.js +416 -0
  268. package/dist/swift/native/sdk-tables.js +772 -0
  269. package/dist/swift/native/sdk-types.js +1 -0
  270. package/dist/swift/native/sdk.js +409 -0
  271. package/dist/swift/native/subclasses.js +533 -0
  272. package/dist/swift/object-classes.js +396 -0
  273. package/dist/swift/operators.js +575 -0
  274. package/dist/swift/optional-chains.js +405 -0
  275. package/dist/swift/parameters.js +210 -0
  276. package/dist/swift/placement.js +900 -0
  277. package/dist/swift/protocols.js +164 -0
  278. package/dist/swift/prototype-calls.js +227 -0
  279. package/dist/swift/render.js +385 -0
  280. package/dist/swift/results.js +370 -0
  281. package/dist/swift/state-backend.js +243 -0
  282. package/dist/swift/statements.js +505 -0
  283. package/dist/swift/static-calls.js +320 -0
  284. package/dist/swift/syntax.js +916 -0
  285. package/dist/swift/translator-types.js +1 -0
  286. package/dist/swift/translator.js +890 -0
  287. package/dist/swift/type-facts.js +530 -0
  288. package/dist/swift/type-tests.js +211 -0
  289. package/dist/swift/types.js +665 -0
  290. package/dist/targets/android/build.js +598 -0
  291. package/dist/targets/android/compose-mapping.js +218 -0
  292. package/dist/targets/android/deprecations.js +81 -0
  293. package/dist/targets/android/resources.js +80 -0
  294. package/dist/targets/ios/build.js +583 -0
  295. package/dist/targets/ios/core-native.js +149 -0
  296. package/dist/targets/ios/dependencies.js +464 -0
  297. package/dist/targets/ios/plist.js +127 -0
  298. package/dist/targets/ios/resources.js +285 -0
  299. package/dist/targets/ios/retrace.js +196 -0
  300. package/dist/targets/ios/signing.js +84 -0
  301. package/dist/targets/ios/xcodegen.js +39 -0
  302. package/dist/targets/resources.js +180 -0
  303. package/dist/template/model.js +38 -0
  304. package/dist/template/plan.js +576 -0
  305. package/dist/tools/doctor.js +172 -0
  306. package/dist/tools/retrace.js +116 -0
  307. package/dist/tools/verify.js +330 -0
  308. package/dist/types/adapter-api.d.ts +683 -0
  309. package/dist/types/binding-api.d.ts +48 -0
  310. package/dist/types/elements.d.ts +10 -0
  311. package/dist/types/ir.d.ts +245 -0
  312. package/dist/types/listview.d.ts +15 -0
  313. package/dist/types/rewrite.d.ts +18 -0
  314. package/dist/types/typescript-internal.d.ts +35 -0
  315. package/dist/xml/app.js +65 -0
  316. package/dist/xml/bindings.js +308 -0
  317. package/dist/xml/contexts.js +296 -0
  318. package/dist/xml/fold.js +170 -0
  319. package/dist/xml/keys.js +146 -0
  320. package/dist/xml/pages.js +550 -0
  321. package/dist/xml/plan.js +650 -0
  322. package/docs/CLI.md +131 -0
  323. package/docs/cli/compile-android.md +30 -0
  324. package/docs/cli/compile-doctor.md +18 -0
  325. package/docs/cli/compile-ios.md +30 -0
  326. package/docs/cli/compile-retrace.md +18 -0
  327. package/docs/cli/compile-verify.md +18 -0
  328. package/docs/cli/compile.md +15 -0
  329. package/kit-android/build.gradle.kts +65 -0
  330. package/kit-android/consumer-rules.pro +7 -0
  331. package/kit-android/generated/kotlin/org/nativescript/kit/__Exports.kt +966 -0
  332. package/kit-android/generated/kotlin/org/nativescript/kit/__Modules.kt +125 -0
  333. package/kit-android/generated/kotlin/org/nativescript/kit/__Objects.kt +39497 -0
  334. package/kit-android/generated/kotlin/org/nativescript/kit/abortcontroller_abortsignal.kt +101 -0
  335. package/kit-android/generated/kotlin/org/nativescript/kit/abortcontroller_index.kt +109 -0
  336. package/kit-android/generated/kotlin/org/nativescript/kit/accessibility_accessibility_common.kt +547 -0
  337. package/kit-android/generated/kotlin/org/nativescript/kit/accessibility_accessibility_properties.kt +263 -0
  338. package/kit-android/generated/kotlin/org/nativescript/kit/accessibility_index.kt +6 -0
  339. package/kit-android/generated/kotlin/org/nativescript/kit/application_application.kt +2656 -0
  340. package/kit-android/generated/kotlin/org/nativescript/kit/application_application_common.kt +1932 -0
  341. package/kit-android/generated/kotlin/org/nativescript/kit/application_application_interfaces.kt +6 -0
  342. package/kit-android/generated/kotlin/org/nativescript/kit/application_application_shims.kt +111 -0
  343. package/kit-android/generated/kotlin/org/nativescript/kit/application_helpers.kt +198 -0
  344. package/kit-android/generated/kotlin/org/nativescript/kit/application_helpers_common.kt +270 -0
  345. package/kit-android/generated/kotlin/org/nativescript/kit/application_index.kt +6 -0
  346. package/kit-android/generated/kotlin/org/nativescript/kit/application_scene_delegate_bridge.kt +233 -0
  347. package/kit-android/generated/kotlin/org/nativescript/kit/application_settings_application_settings_common.kt +28 -0
  348. package/kit-android/generated/kotlin/org/nativescript/kit/application_settings_index.kt +188 -0
  349. package/kit-android/generated/kotlin/org/nativescript/kit/color_color_common.kt +707 -0
  350. package/kit-android/generated/kotlin/org/nativescript/kit/color_color_types.kt +6 -0
  351. package/kit-android/generated/kotlin/org/nativescript/kit/color_color_utils.kt +368 -0
  352. package/kit-android/generated/kotlin/org/nativescript/kit/color_index.kt +37 -0
  353. package/kit-android/generated/kotlin/org/nativescript/kit/color_known_colors.kt +418 -0
  354. package/kit-android/generated/kotlin/org/nativescript/kit/com.tns.FragmentClass.kt +287 -0
  355. package/kit-android/generated/kotlin/org/nativescript/kit/com.tns.NativeScriptActivity.kt +263 -0
  356. package/kit-android/generated/kotlin/org/nativescript/kit/com.tns.OnBackPressedCallback.kt +116 -0
  357. package/kit-android/generated/kotlin/org/nativescript/kit/connectivity_index.kt +289 -0
  358. package/kit-android/generated/kotlin/org/nativescript/kit/core_types_animation_types.kt +56 -0
  359. package/kit-android/generated/kotlin/org/nativescript/kit/core_types_index.kt +427 -0
  360. package/kit-android/generated/kotlin/org/nativescript/kit/core_types_validators.kt +34 -0
  361. package/kit-android/generated/kotlin/org/nativescript/kit/css_CSS3Parser.kt +954 -0
  362. package/kit-android/generated/kotlin/org/nativescript/kit/css_CSSNativeScript.kt +205 -0
  363. package/kit-android/generated/kotlin/org/nativescript/kit/css_mediaquery_index.kt +270 -0
  364. package/kit-android/generated/kotlin/org/nativescript/kit/css_parser.kt +885 -0
  365. package/kit-android/generated/kotlin/org/nativescript/kit/css_system_classes.kt +98 -0
  366. package/kit-android/generated/kotlin/org/nativescript/kit/css_value_reworkcss_value.kt +214 -0
  367. package/kit-android/generated/kotlin/org/nativescript/kit/data_observable_array_index.kt +798 -0
  368. package/kit-android/generated/kotlin/org/nativescript/kit/data_observable_index.kt +1175 -0
  369. package/kit-android/generated/kotlin/org/nativescript/kit/data_virtual_array_index.kt +271 -0
  370. package/kit-android/generated/kotlin/org/nativescript/kit/file_system_file_system_access.kt +3828 -0
  371. package/kit-android/generated/kotlin/org/nativescript/kit/file_system_index.kt +1669 -0
  372. package/kit-android/generated/kotlin/org/nativescript/kit/fps_meter_fps_native.kt +177 -0
  373. package/kit-android/generated/kotlin/org/nativescript/kit/fps_meter_index.kt +93 -0
  374. package/kit-android/generated/kotlin/org/nativescript/kit/globals_global_utils.kt +185 -0
  375. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_interfaces.kt +14 -0
  376. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_http_request_common.kt +41 -0
  377. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_index.kt +119 -0
  378. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_internal_http_request_internal_common.kt +61 -0
  379. package/kit-android/generated/kotlin/org/nativescript/kit/http_http_request_internal_index.kt +237 -0
  380. package/kit-android/generated/kotlin/org/nativescript/kit/http_index.kt +155 -0
  381. package/kit-android/generated/kotlin/org/nativescript/kit/image_asset_image_asset_common.kt +201 -0
  382. package/kit-android/generated/kotlin/org/nativescript/kit/image_asset_index.kt +119 -0
  383. package/kit-android/generated/kotlin/org/nativescript/kit/image_source_image_source_common.kt +26 -0
  384. package/kit-android/generated/kotlin/org/nativescript/kit/image_source_index.kt +846 -0
  385. package/kit-android/generated/kotlin/org/nativescript/kit/js_libs_easysax_easysax.kt +1045 -0
  386. package/kit-android/generated/kotlin/org/nativescript/kit/matrix_index.kt +166 -0
  387. package/kit-android/generated/kotlin/org/nativescript/kit/media_query_list_index.kt +391 -0
  388. package/kit-android/generated/kotlin/org/nativescript/kit/module_name_resolver_helpers.kt +45 -0
  389. package/kit-android/generated/kotlin/org/nativescript/kit/module_name_resolver_index.kt +185 -0
  390. package/kit-android/generated/kotlin/org/nativescript/kit/module_name_resolver_non_bundle_workflow_compat.kt +262 -0
  391. package/kit-android/generated/kotlin/org/nativescript/kit/module_name_resolver_qualifier_matcher_index.kt +305 -0
  392. package/kit-android/generated/kotlin/org/nativescript/kit/native_window_index.kt +6 -0
  393. package/kit-android/generated/kotlin/org/nativescript/kit/native_window_native_window.kt +397 -0
  394. package/kit-android/generated/kotlin/org/nativescript/kit/native_window_native_window_common.kt +685 -0
  395. package/kit-android/generated/kotlin/org/nativescript/kit/native_window_native_window_interfaces.kt +51 -0
  396. package/kit-android/generated/kotlin/org/nativescript/kit/native_window_window_base.kt +223 -0
  397. package/kit-android/generated/kotlin/org/nativescript/kit/npm_css_what_src_index.kt +4 -0
  398. package/kit-android/generated/kotlin/org/nativescript/kit/npm_css_what_src_parse.kt +755 -0
  399. package/kit-android/generated/kotlin/org/nativescript/kit/npm_css_what_src_stringify.kt +212 -0
  400. package/kit-android/generated/kotlin/org/nativescript/kit/npm_css_what_src_types.kt +65 -0
  401. package/kit-android/generated/kotlin/org/nativescript/kit/org.nativescript.NativeScriptComponentCallbacks.kt +57 -0
  402. package/kit-android/generated/kotlin/org/nativescript/kit/org.nativescript.NativeScriptLifecycleCallbacks.kt +579 -0
  403. package/kit-android/generated/kotlin/org/nativescript/kit/platform_common.kt +20 -0
  404. package/kit-android/generated/kotlin/org/nativescript/kit/platform_device_index.kt +251 -0
  405. package/kit-android/generated/kotlin/org/nativescript/kit/platform_index.kt +6 -0
  406. package/kit-android/generated/kotlin/org/nativescript/kit/platform_screen_index.kt +183 -0
  407. package/kit-android/generated/kotlin/org/nativescript/kit/profiling_index.kt +485 -0
  408. package/kit-android/generated/kotlin/org/nativescript/kit/text_formatted_string.kt +6 -0
  409. package/kit-android/generated/kotlin/org/nativescript/kit/text_index.kt +15 -0
  410. package/kit-android/generated/kotlin/org/nativescript/kit/text_span.kt +6 -0
  411. package/kit-android/generated/kotlin/org/nativescript/kit/text_text_common.kt +277 -0
  412. package/kit-android/generated/kotlin/org/nativescript/kit/trace_index.kt +480 -0
  413. package/kit-android/generated/kotlin/org/nativescript/kit/ui_action_bar_action_bar_common.kt +1081 -0
  414. package/kit-android/generated/kotlin/org/nativescript/kit/ui_action_bar_index.kt +1207 -0
  415. package/kit-android/generated/kotlin/org/nativescript/kit/ui_activity_indicator_activity_indicator_common.kt +89 -0
  416. package/kit-android/generated/kotlin/org/nativescript/kit/ui_activity_indicator_index.kt +171 -0
  417. package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_animation_common.kt +518 -0
  418. package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_animation_shared.kt +6 -0
  419. package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_animation_types.kt +6 -0
  420. package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_index.kt +1539 -0
  421. package/kit-android/generated/kotlin/org/nativescript/kit/ui_animation_keyframe_animation.kt +1081 -0
  422. package/kit-android/generated/kotlin/org/nativescript/kit/ui_builder_binding_builder.kt +369 -0
  423. package/kit-android/generated/kotlin/org/nativescript/kit/ui_builder_component_builder_index.kt +487 -0
  424. package/kit-android/generated/kotlin/org/nativescript/kit/ui_builder_index.kt +1938 -0
  425. package/kit-android/generated/kotlin/org/nativescript/kit/ui_button_button_common.kt +70 -0
  426. package/kit-android/generated/kotlin/org/nativescript/kit/ui_button_index.kt +367 -0
  427. package/kit-android/generated/kotlin/org/nativescript/kit/ui_content_view_index.kt +220 -0
  428. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_bindable_expressions.kt +735 -0
  429. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_bindable_resources.kt +17 -0
  430. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_bindable_types.kt +6 -0
  431. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_expression_parser.kt +4970 -0
  432. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_bindable_index.kt +1342 -0
  433. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_control_state_change_index.kt +52 -0
  434. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_properties_index.kt +3578 -0
  435. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_properties_property_shared.kt +44 -0
  436. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_base_index.kt +3261 -0
  437. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_base_utils.kt +16 -0
  438. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_index.kt +4716 -0
  439. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_overflow_edges.kt +82 -0
  440. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_view_common.kt +3597 -0
  441. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_view_helper_index.kt +134 -0
  442. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_view_helper_view_helper_common.kt +360 -0
  443. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_view_helper_view_helper_shared.kt +6 -0
  444. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_view_interfaces.kt +349 -0
  445. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_weak_event_listener_index.kt +266 -0
  446. package/kit-android/generated/kotlin/org/nativescript/kit/ui_date_picker_date_picker_common.kt +369 -0
  447. package/kit-android/generated/kotlin/org/nativescript/kit/ui_date_picker_index.kt +427 -0
  448. package/kit-android/generated/kotlin/org/nativescript/kit/ui_dialogs_dialogs_common.kt +428 -0
  449. package/kit-android/generated/kotlin/org/nativescript/kit/ui_dialogs_index.kt +689 -0
  450. package/kit-android/generated/kotlin/org/nativescript/kit/ui_editable_text_base_editable_text_base_common.kt +421 -0
  451. package/kit-android/generated/kotlin/org/nativescript/kit/ui_editable_text_base_index.kt +1140 -0
  452. package/kit-android/generated/kotlin/org/nativescript/kit/ui_embedding_index.kt +34 -0
  453. package/kit-android/generated/kotlin/org/nativescript/kit/ui_enums_enums.kt +6 -0
  454. package/kit-android/generated/kotlin/org/nativescript/kit/ui_enums_index.kt +6 -0
  455. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_activity.kt +210 -0
  456. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_fragment.kt +88 -0
  457. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_fragment_transitions.kt +1544 -0
  458. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_fragment_transitions_types.kt +25 -0
  459. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_common.kt +1350 -0
  460. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_constants.kt +10 -0
  461. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_helper_for_android.kt +615 -0
  462. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_helpers.kt +42 -0
  463. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_interfaces.kt +22 -0
  464. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_frame_stack.kt +112 -0
  465. package/kit-android/generated/kotlin/org/nativescript/kit/ui_frame_index.kt +1890 -0
  466. package/kit-android/generated/kotlin/org/nativescript/kit/ui_gestures_gestures_common.kt +208 -0
  467. package/kit-android/generated/kotlin/org/nativescript/kit/ui_gestures_gestures_types.kt +348 -0
  468. package/kit-android/generated/kotlin/org/nativescript/kit/ui_gestures_index.kt +1785 -0
  469. package/kit-android/generated/kotlin/org/nativescript/kit/ui_gestures_touch_manager.kt +288 -0
  470. package/kit-android/generated/kotlin/org/nativescript/kit/ui_html_view_html_view_common.kt +121 -0
  471. package/kit-android/generated/kotlin/org/nativescript/kit/ui_html_view_index.kt +283 -0
  472. package/kit-android/generated/kotlin/org/nativescript/kit/ui_image_cache_image_cache_common.kt +450 -0
  473. package/kit-android/generated/kotlin/org/nativescript/kit/ui_image_cache_index.kt +225 -0
  474. package/kit-android/generated/kotlin/org/nativescript/kit/ui_image_image_common.kt +574 -0
  475. package/kit-android/generated/kotlin/org/nativescript/kit/ui_image_index.kt +493 -0
  476. package/kit-android/generated/kotlin/org/nativescript/kit/ui_image_symbol_effects.kt +31 -0
  477. package/kit-android/generated/kotlin/org/nativescript/kit/ui_image_symbol_effects_common.kt +138 -0
  478. package/kit-android/generated/kotlin/org/nativescript/kit/ui_label_index.kt +108 -0
  479. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_absolute_layout_absolute_layout_common.kt +167 -0
  480. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_absolute_layout_index.kt +94 -0
  481. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_dock_layout_dock_layout_common.kt +157 -0
  482. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_dock_layout_index.kt +124 -0
  483. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_flexbox_layout_flexbox_layout_common.kt +1004 -0
  484. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_flexbox_layout_index.kt +675 -0
  485. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_grid_layout_grid_layout_common.kt +1011 -0
  486. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_grid_layout_index.kt +450 -0
  487. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_index.kt +6 -0
  488. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_layout_base.kt +123 -0
  489. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_layout_base_common.kt +442 -0
  490. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_liquid_glass_container_index.kt +25 -0
  491. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_liquid_glass_container_liquid_glass_container_common.kt +38 -0
  492. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_liquid_glass_index.kt +30 -0
  493. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_liquid_glass_liquid_glass_common.kt +25 -0
  494. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_root_layout_index.kt +556 -0
  495. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_root_layout_root_layout_common.kt +930 -0
  496. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_root_layout_root_layout_stack.kt +49 -0
  497. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_stack_layout_index.kt +63 -0
  498. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_stack_layout_stack_layout_common.kt +83 -0
  499. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_wrap_layout_index.kt +106 -0
  500. package/kit-android/generated/kotlin/org/nativescript/kit/ui_layouts_wrap_layout_wrap_layout_common.kt +185 -0
  501. package/kit-android/generated/kotlin/org/nativescript/kit/ui_list_picker_index.kt +400 -0
  502. package/kit-android/generated/kotlin/org/nativescript/kit/ui_list_picker_list_picker_common.kt +260 -0
  503. package/kit-android/generated/kotlin/org/nativescript/kit/ui_list_view_index.kt +2406 -0
  504. package/kit-android/generated/kotlin/org/nativescript/kit/ui_list_view_list_view_common.kt +912 -0
  505. package/kit-android/generated/kotlin/org/nativescript/kit/ui_page_events.kt +17 -0
  506. package/kit-android/generated/kotlin/org/nativescript/kit/ui_page_index.kt +241 -0
  507. package/kit-android/generated/kotlin/org/nativescript/kit/ui_page_page_common.kt +449 -0
  508. package/kit-android/generated/kotlin/org/nativescript/kit/ui_placeholder_index.kt +61 -0
  509. package/kit-android/generated/kotlin/org/nativescript/kit/ui_placeholder_placeholder_common.kt +6 -0
  510. package/kit-android/generated/kotlin/org/nativescript/kit/ui_progress_index.kt +204 -0
  511. package/kit-android/generated/kotlin/org/nativescript/kit/ui_progress_progress_common.kt +129 -0
  512. package/kit-android/generated/kotlin/org/nativescript/kit/ui_proxy_view_container_index.kt +457 -0
  513. package/kit-android/generated/kotlin/org/nativescript/kit/ui_repeater_index.kt +523 -0
  514. package/kit-android/generated/kotlin/org/nativescript/kit/ui_scroll_view_index.kt +400 -0
  515. package/kit-android/generated/kotlin/org/nativescript/kit/ui_scroll_view_scroll_view_common.kt +402 -0
  516. package/kit-android/generated/kotlin/org/nativescript/kit/ui_search_bar_index.kt +711 -0
  517. package/kit-android/generated/kotlin/org/nativescript/kit/ui_search_bar_search_bar_common.kt +186 -0
  518. package/kit-android/generated/kotlin/org/nativescript/kit/ui_segmented_bar_index.kt +774 -0
  519. package/kit-android/generated/kotlin/org/nativescript/kit/ui_segmented_bar_segmented_bar_common.kt +409 -0
  520. package/kit-android/generated/kotlin/org/nativescript/kit/ui_slider_index.kt +477 -0
  521. package/kit-android/generated/kotlin/org/nativescript/kit/ui_slider_slider_common.kt +234 -0
  522. package/kit-android/generated/kotlin/org/nativescript/kit/ui_split_view_index.kt +25 -0
  523. package/kit-android/generated/kotlin/org/nativescript/kit/ui_split_view_split_view_common.kt +446 -0
  524. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_background.kt +268 -0
  525. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_background_common.kt +771 -0
  526. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_box_shadow.kt +108 -0
  527. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_clip_path_function.kt +129 -0
  528. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_converters.kt +92 -0
  529. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_css_animation_parser.kt +416 -0
  530. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_css_selector.kt +3532 -0
  531. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_css_shadow.kt +38 -0
  532. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_css_stroke.kt +30 -0
  533. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_css_transform.kt +366 -0
  534. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_css_utils.kt +249 -0
  535. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_font.kt +488 -0
  536. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_font_common.kt +446 -0
  537. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_font_interfaces.kt +6 -0
  538. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_length_shared.kt +264 -0
  539. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_linear_gradient.kt +136 -0
  540. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_index.kt +1345 -0
  541. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_properties.kt +2907 -0
  542. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_style_scope.kt +3031 -0
  543. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_styling_profile.kt +6 -0
  544. package/kit-android/generated/kotlin/org/nativescript/kit/ui_styling_styling_shared.kt +6 -0
  545. package/kit-android/generated/kotlin/org/nativescript/kit/ui_switch_index.kt +295 -0
  546. package/kit-android/generated/kotlin/org/nativescript/kit/ui_switch_switch_common.kt +139 -0
  547. package/kit-android/generated/kotlin/org/nativescript/kit/ui_tab_view_index.kt +1977 -0
  548. package/kit-android/generated/kotlin/org/nativescript/kit/ui_tab_view_tab_view_common.kt +902 -0
  549. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_base_formatted_string.kt +471 -0
  550. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_base_index.kt +1662 -0
  551. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_base_span.kt +284 -0
  552. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_base_text_base_common.kt +792 -0
  553. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_field_index.kt +211 -0
  554. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_field_text_field_common.kt +115 -0
  555. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_view_index.kt +94 -0
  556. package/kit-android/generated/kotlin/org/nativescript/kit/ui_text_view_text_view_common.kt +140 -0
  557. package/kit-android/generated/kotlin/org/nativescript/kit/ui_time_picker_index.kt +225 -0
  558. package/kit-android/generated/kotlin/org/nativescript/kit/ui_time_picker_time_picker_common.kt +699 -0
  559. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_fade_transition.kt +68 -0
  560. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_flip_transition.kt +209 -0
  561. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_index.kt +160 -0
  562. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_modal_transition.kt +49 -0
  563. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_page_transition.kt +416 -0
  564. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_shared_transition.kt +457 -0
  565. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_shared_transition_helper.kt +46 -0
  566. package/kit-android/generated/kotlin/org/nativescript/kit/ui_transition_slide_transition.kt +294 -0
  567. package/kit-android/generated/kotlin/org/nativescript/kit/ui_utils.kt +20 -0
  568. package/kit-android/generated/kotlin/org/nativescript/kit/ui_web_view_index.kt +595 -0
  569. package/kit-android/generated/kotlin/org/nativescript/kit/ui_web_view_web_view_common.kt +209 -0
  570. package/kit-android/generated/kotlin/org/nativescript/kit/ui_web_view_web_view_interfaces.kt +6 -0
  571. package/kit-android/generated/kotlin/org/nativescript/kit/utils_animation_helpers.kt +76 -0
  572. package/kit-android/generated/kotlin/org/nativescript/kit/utils_common.kt +224 -0
  573. package/kit-android/generated/kotlin/org/nativescript/kit/utils_constants.kt +22 -0
  574. package/kit-android/generated/kotlin/org/nativescript/kit/utils_debug.kt +9 -0
  575. package/kit-android/generated/kotlin/org/nativescript/kit/utils_debug_source.kt +246 -0
  576. package/kit-android/generated/kotlin/org/nativescript/kit/utils_index.kt +296 -0
  577. package/kit-android/generated/kotlin/org/nativescript/kit/utils_layout_helper_index.kt +139 -0
  578. package/kit-android/generated/kotlin/org/nativescript/kit/utils_layout_helper_layout_helper_common.kt +61 -0
  579. package/kit-android/generated/kotlin/org/nativescript/kit/utils_layout_helper_layout_helper_shared.kt +23 -0
  580. package/kit-android/generated/kotlin/org/nativescript/kit/utils_lazy.kt +20 -0
  581. package/kit-android/generated/kotlin/org/nativescript/kit/utils_macrotask_scheduler.kt +45 -0
  582. package/kit-android/generated/kotlin/org/nativescript/kit/utils_mainthread_helper.kt +64 -0
  583. package/kit-android/generated/kotlin/org/nativescript/kit/utils_module_merge.kt +13 -0
  584. package/kit-android/generated/kotlin/org/nativescript/kit/utils_native_helper.kt +79 -0
  585. package/kit-android/generated/kotlin/org/nativescript/kit/utils_native_helper_for_android.kt +805 -0
  586. package/kit-android/generated/kotlin/org/nativescript/kit/utils_number_utils.kt +66 -0
  587. package/kit-android/generated/kotlin/org/nativescript/kit/utils_platform_check.kt +15 -0
  588. package/kit-android/generated/kotlin/org/nativescript/kit/utils_shared.kt +65 -0
  589. package/kit-android/generated/kotlin/org/nativescript/kit/utils_types.kt +229 -0
  590. package/kit-android/generated/kotlin/org/nativescript/kit/utils_utils_shared.kt +16 -0
  591. package/kit-android/generated/kotlin/org/nativescript/kit/xml_index.kt +869 -0
  592. package/kit-android/generated/manifest.json +860 -0
  593. package/kit-android/generated/source-lines.json +1 -0
  594. package/kit-android/gradle/wrapper/gradle-wrapper.jar +0 -0
  595. package/kit-android/gradle/wrapper/gradle-wrapper.properties +6 -0
  596. package/kit-android/gradlew +240 -0
  597. package/kit-android/overlays/xml-free/kotlin/org/nativescript/kit/ui_builder_index.kt +524 -0
  598. package/kit-android/overlays/xml-free/kotlin/org/nativescript/kit/ui_core_bindable_index.kt +1335 -0
  599. package/kit-android/overlays/xml-free/overlay.json +20 -0
  600. package/kit-android/src/fromcore/kotlin/org/nativescript/kit/AnimationFrame.kt +68 -0
  601. package/kit-android/src/fromcore/kotlin/org/nativescript/kit/CoreBridge.kt +302 -0
  602. package/kit-android/src/fromcore/kotlin/org/nativescript/kit/Modal.kt +61 -0
  603. package/kit-android/src/fromcore/kotlin/org/nativescript/kit/NativeScriptApplication.kt +230 -0
  604. package/kit-android/src/fromcore/kotlin/org/nativescript/kit/Regions.kt +289 -0
  605. package/kit-android/src/main/kotlin/org/nativescript/kit/ChangeDetection.kt +28 -0
  606. package/kit-android/src/main/kotlin/org/nativescript/kit/ColorMix.kt +643 -0
  607. package/kit-android/src/main/kotlin/org/nativescript/kit/JS.kt +10 -0
  608. package/kit-android/src/main/kotlin/org/nativescript/kit/MainThread.kt +10 -0
  609. package/kit-android/src/main/kotlin/org/nativescript/kit/Signals.kt +866 -0
  610. package/kit-android/src/main/kotlin/org/nativescript/kit/UncaughtErrors.kt +51 -0
  611. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Array.kt +731 -0
  612. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/ArrayLike.kt +781 -0
  613. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/BigInt.kt +136 -0
  614. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/CSSCalc.kt +109 -0
  615. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Collections.kt +426 -0
  616. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/CorePackages.kt +13 -0
  617. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Date.kt +573 -0
  618. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Dynamic.kt +689 -0
  619. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/ES2023.kt +93 -0
  620. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/ErrorOrigin.kt +17 -0
  621. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Errors.kt +270 -0
  622. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/HostObjects.kt +72 -0
  623. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Inspect.kt +814 -0
  624. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Intl.kt +702 -0
  625. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Iterators.kt +746 -0
  626. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/JSON.kt +587 -0
  627. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Language.kt +526 -0
  628. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Lowering.kt +70 -0
  629. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Number.kt +367 -0
  630. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Promise.kt +680 -0
  631. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Prototypes.kt +292 -0
  632. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Reactive.kt +36 -0
  633. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Realm.kt +85 -0
  634. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/RegExp.kt +2245 -0
  635. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/ShortestDouble.kt +157 -0
  636. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Strings.kt +398 -0
  637. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/ThrownValue.kt +34 -0
  638. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Timers.kt +182 -0
  639. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/TypedArrays.kt +993 -0
  640. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/URI.kt +74 -0
  641. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Values.kt +1263 -0
  642. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Views.kt +52 -0
  643. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Weak.kt +110 -0
  644. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/WinterTC.kt +356 -0
  645. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Workers.kt +312 -0
  646. package/kit-apple/Overlays/xml-free/Core/ui.builder.index.swift +536 -0
  647. package/kit-apple/Overlays/xml-free/Core/ui.core.bindable.index.swift +1375 -0
  648. package/kit-apple/Overlays/xml-free/overlay.json +34 -0
  649. package/kit-apple/Package.swift +17 -0
  650. package/kit-apple/Sources/NativeScriptKit/AnimationFrame.swift +41 -0
  651. package/kit-apple/Sources/NativeScriptKit/AppModules.swift +88 -0
  652. package/kit-apple/Sources/NativeScriptKit/ApplicationDelegateClass.swift +273 -0
  653. package/kit-apple/Sources/NativeScriptKit/CSSCalc.swift +111 -0
  654. package/kit-apple/Sources/NativeScriptKit/ChangeDetection.swift +31 -0
  655. package/kit-apple/Sources/NativeScriptKit/ColorMix.swift +577 -0
  656. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity0.swift +1413 -0
  657. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity1.swift +6525 -0
  658. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity2.swift +4713 -0
  659. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity3Plus.swift +5428 -0
  660. package/kit-apple/Sources/NativeScriptKit/Core/Object_Accuracy_AndroidActionBarIconVisibility_AndroidActionItemPosition_AnimationCurve_AutocapitalizationType_BackgroundRepeat_and_26_more_630c32.swift +472 -0
  661. package/kit-apple/Sources/NativeScriptKit/Core/Object_ArrayExpression_BinaryExpression_CallExpression_ChainExpression_ConditionalExpression_Identifier_and_10_more_f883bf.swift +359 -0
  662. package/kit-apple/Sources/NativeScriptKit/Core/Object_Tab_NewLine_excl_quot_QUOT_num_and_287_more_88aef2.swift +2190 -0
  663. package/kit-apple/Sources/NativeScriptKit/Core/Object_Unknown_QuirksMode_IgnoreCase_CaseSensitive.swift +122 -0
  664. package/kit-apple/Sources/NativeScriptKit/Core/Object_a_b_c_d_tx_ty.swift +123 -0
  665. package/kit-apple/Sources/NativeScriptKit/Core/Object_a_h_s_l.swift +85 -0
  666. package/kit-apple/Sources/NativeScriptKit/Core/Object_a_h_s_v.swift +85 -0
  667. package/kit-apple/Sources/NativeScriptKit/Core/Object_a_r_g_b.swift +85 -0
  668. package/kit-apple/Sources/NativeScriptKit/Core/Object_activate_deactivate_background_foreground_close_attached_and_26_more_127a37.swift +448 -0
  669. package/kit-apple/Sources/NativeScriptKit/Core/Object_activeType.swift +65 -0
  670. package/kit-apple/Sources/NativeScriptKit/Core/Object_alert_confirm_prompt_login_action.swift +118 -0
  671. package/kit-apple/Sources/NativeScriptKit/Core/Object_align_offset.swift +94 -0
  672. package/kit-apple/Sources/NativeScriptKit/Core/Object_android_ios_visionos_apple.swift +109 -0
  673. package/kit-apple/Sources/NativeScriptKit/Core/Object_angle_colors.swift +81 -0
  674. package/kit-apple/Sources/NativeScriptKit/Core/Object_animations.swift +66 -0
  675. package/kit-apple/Sources/NativeScriptKit/Core/Object_animations_completion.swift +73 -0
  676. package/kit-apple/Sources/NativeScriptKit/Core/Object_axis_value.swift +80 -0
  677. package/kit-apple/Sources/NativeScriptKit/Core/Object_backgroundColor_scale_translate_rotate_opacity_width_height_valueSource_duration_curve_forceLayer.swift +257 -0
  678. package/kit-apple/Sources/NativeScriptKit/Core/Object_body.swift +78 -0
  679. package/kit-apple/Sources/NativeScriptKit/Core/Object_boundsChanged_sizeChanged.swift +80 -0
  680. package/kit-apple/Sources/NativeScriptKit/Core/Object_callback_thisArg_once.swift +112 -0
  681. package/kit-apple/Sources/NativeScriptKit/Core/Object_collections_createUIDocumentInteractionControllerDelegate_getCurrentAppPath_getRootViewController_getVisibleViewController_getWindow_and_10_more_6713a9.swift +281 -0
  682. package/kit-apple/Sources/NativeScriptKit/Core/Object_color.swift +64 -0
  683. package/kit-apple/Sources/NativeScriptKit/Core/Object_color_backgroundColor.swift +81 -0
  684. package/kit-apple/Sources/NativeScriptKit/Core/Object_color_offset.swift +94 -0
  685. package/kit-apple/Sources/NativeScriptKit/Core/Object_component_exports.swift +95 -0
  686. package/kit-apple/Sources/NativeScriptKit/Core/Object_component_exports_.swift +94 -0
  687. package/kit-apple/Sources/NativeScriptKit/Core/Object_connectionOptions.swift +66 -0
  688. package/kit-apple/Sources/NativeScriptKit/Core/Object_constructor_hasOwnProperty_isPrototypeOf_propertyIsEnumerable_toLocaleString_toString_and_21_more_e9ed9b.swift +331 -0
  689. package/kit-apple/Sources/NativeScriptKit/Core/Object_content_statusCode_headers.swift +106 -0
  690. package/kit-apple/Sources/NativeScriptKit/Core/Object_context_closeCallback_fullscreen_animated_stretched.swift +149 -0
  691. package/kit-apple/Sources/NativeScriptKit/Core/Object_context_parent_name_elementName_templateItems_errorFormat_sourceTracker_xmlModule.swift +185 -0
  692. package/kit-apple/Sources/NativeScriptKit/Core/Object_counters_timeline.swift +95 -0
  693. package/kit-apple/Sources/NativeScriptKit/Core/Object_create.swift +78 -0
  694. package/kit-apple/Sources/NativeScriptKit/Core/Object_createSelector_SelectorCore_SimpleSelector_InvalidSelector_UniversalSelector_TypeSelector_and_12_more_71e044.swift +315 -0
  695. package/kit-apple/Sources/NativeScriptKit/Core/Object_curve.swift +78 -0
  696. package/kit-apple/Sources/NativeScriptKit/Core/Object_defaultValue_name_cssName_affectsLayout.swift +131 -0
  697. package/kit-apple/Sources/NativeScriptKit/Core/Object_defaultValue_name_cssName_valueConverter.swift +113 -0
  698. package/kit-apple/Sources/NativeScriptKit/Core/Object_defaultValue_name_cssName_valueConverter_.swift +113 -0
  699. package/kit-apple/Sources/NativeScriptKit/Core/Object_deg_rad_grad_turn.swift +105 -0
  700. package/kit-apple/Sources/NativeScriptKit/Core/Object_duration_damping.swift +80 -0
  701. package/kit-apple/Sources/NativeScriptKit/Core/Object_duration_repeatCount_delay_curve_propertyNameToAnimate_subPropertiesToAnimate_fromValue_toValue.swift +211 -0
  702. package/kit-apple/Sources/NativeScriptKit/Core/Object_duration_spring.swift +90 -0
  703. package/kit-apple/Sources/NativeScriptKit/Core/Object_edge_interaction.swift +94 -0
  704. package/kit-apple/Sources/NativeScriptKit/Core/Object_effectType_onCreate.swift +86 -0
  705. package/kit-apple/Sources/NativeScriptKit/Core/Object_effectType_targetView.swift +73 -0
  706. package/kit-apple/Sources/NativeScriptKit/Core/Object_effectType_targetView_toGlassStyleFn.swift +110 -0
  707. package/kit-apple/Sources/NativeScriptKit/Core/Object_empty_text_json_blob_arraybuffer.swift +108 -0
  708. package/kit-apple/Sources/NativeScriptKit/Core/Object_enterFrom_exitTo.swift +95 -0
  709. package/kit-apple/Sources/NativeScriptKit/Core/Object_entry_isBackNavigation_navigationType.swift +115 -0
  710. package/kit-apple/Sources/NativeScriptKit/Core/Object_entry_resolvedPage_navDepth_fragmentTag.swift +133 -0
  711. package/kit-apple/Sources/NativeScriptKit/Core/Object_entry_resolvedPage_navDepth_fragmentTag_frameId.swift +162 -0
  712. package/kit-apple/Sources/NativeScriptKit/Core/Object_enumerable_configurable_get_set.swift +123 -0
  713. package/kit-apple/Sources/NativeScriptKit/Core/Object_enumerable_configurable_get_set_.swift +122 -0
  714. package/kit-apple/Sources/NativeScriptKit/Core/Object_enumerable_configurable_get_set__.swift +122 -0
  715. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_android_ios_newValue_object.swift +147 -0
  716. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_data.swift +94 -0
  717. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_action_index_removed_addedCount.swift +153 -0
  718. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_action_index_removed_addedCount_.swift +154 -0
  719. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_action_index_removed_addedCount__.swift +152 -0
  720. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_android_ios_error.swift +148 -0
  721. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_context_closeCallback.swift +133 -0
  722. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_context_isBackNavigation.swift +132 -0
  723. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_cssFile.swift +110 -0
  724. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_cssFile_.swift +95 -0
  725. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_cssText.swift +110 -0
  726. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_data.swift +112 -0
  727. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_data_.swift +114 -0
  728. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_error.swift +111 -0
  729. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_index_count.swift +120 -0
  730. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_index_section_view_ios_android.swift +168 -0
  731. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_ios.swift +97 -0
  732. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_ios_.swift +111 -0
  733. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_ios_android.swift +129 -0
  734. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_ios_android_cssFile.swift +138 -0
  735. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_isBack_entry_fromEntry.swift +130 -0
  736. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_key_error.swift +128 -0
  737. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_key_image.swift +129 -0
  738. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_matches_media.swift +111 -0
  739. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_newValue.swift +95 -0
  740. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_oldIndex_newIndex.swift +104 -0
  741. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_oldIndex_newIndex_.swift +121 -0
  742. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_propertyName_value_oldValue.swift +147 -0
  743. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_text_ios.swift +113 -0
  744. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_type_view_ios.swift +117 -0
  745. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_url_navigationType_error.swift +158 -0
  746. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_url_navigationType_error_.swift +160 -0
  747. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_viewController.swift +114 -0
  748. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_view_context.swift +130 -0
  749. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window.swift +103 -0
  750. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_newValue.swift +123 -0
  751. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene.swift +105 -0
  752. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_.swift +105 -0
  753. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_shortcutItem_completionHandler.swift +157 -0
  754. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_shortcutItem_completionHandler_.swift +158 -0
  755. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_uiWindow_connectionOptions.swift +137 -0
  756. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_uiWindow_connectionOptions_.swift +137 -0
  757. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_urlContexts.swift +120 -0
  758. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_urlContexts_.swift +120 -0
  759. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_userActivity.swift +121 -0
  760. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_object_window_scene_userActivity_.swift +121 -0
  761. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_rootView.swift +80 -0
  762. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_type.swift +80 -0
  763. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_type_object.swift +111 -0
  764. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventName_window_object.swift +103 -0
  765. package/kit-apple/Sources/NativeScriptKit/Core/Object_eventType_position_prefix_namespace_elementName_attributes_data.swift +169 -0
  766. package/kit-apple/Sources/NativeScriptKit/Core/Object_exists_isDirectory.swift +80 -0
  767. package/kit-apple/Sources/NativeScriptKit/Core/Object_f_s_t_a.swift +85 -0
  768. package/kit-apple/Sources/NativeScriptKit/Core/Object_folder_path.swift +94 -0
  769. package/kit-apple/Sources/NativeScriptKit/Core/Object_fontFamily_fontSize_fontWeight_fontVariationSettings_isBold_isItalic.swift +130 -0
  770. package/kit-apple/Sources/NativeScriptKit/Core/Object_fontStyle_fontVariant_fontWeight.swift +95 -0
  771. package/kit-apple/Sources/NativeScriptKit/Core/Object_h_s_l.swift +78 -0
  772. package/kit-apple/Sources/NativeScriptKit/Core/Object_h_s_v.swift +78 -0
  773. package/kit-apple/Sources/NativeScriptKit/Core/Object_headers_timestamp_headersSize_method_postData_url.swift +173 -0
  774. package/kit-apple/Sources/NativeScriptKit/Core/Object_highlighted.swift +66 -0
  775. package/kit-apple/Sources/NativeScriptKit/Core/Object_horizontal_vertical.swift +80 -0
  776. package/kit-apple/Sources/NativeScriptKit/Core/Object_hour_minute.swift +80 -0
  777. package/kit-apple/Sources/NativeScriptKit/Core/Object_id_type.swift +94 -0
  778. package/kit-apple/Sources/NativeScriptKit/Core/Object_id_type_action.swift +108 -0
  779. package/kit-apple/Sources/NativeScriptKit/Core/Object_id_type_percent.swift +108 -0
  780. package/kit-apple/Sources/NativeScriptKit/Core/Object_import_type.swift +80 -0
  781. package/kit-apple/Sources/NativeScriptKit/Core/Object_inset_color_values.swift +87 -0
  782. package/kit-apple/Sources/NativeScriptKit/Core/Object_inset_offsetX_offsetY_blurRadius_spreadRadius_color.swift +147 -0
  783. package/kit-apple/Sources/NativeScriptKit/Core/Object_inset_offsetX_offsetY_blurRadius_spreadRadius_color_.swift +126 -0
  784. package/kit-apple/Sources/NativeScriptKit/Core/Object_instance.swift +64 -0
  785. package/kit-apple/Sources/NativeScriptKit/Core/Object_instance_instanceModule.swift +97 -0
  786. package/kit-apple/Sources/NativeScriptKit/Core/Object_instance_property.swift +86 -0
  787. package/kit-apple/Sources/NativeScriptKit/Core/Object_instance_property_.swift +72 -0
  788. package/kit-apple/Sources/NativeScriptKit/Core/Object_interactiveBegan.swift +66 -0
  789. package/kit-apple/Sources/NativeScriptKit/Core/Object_interactiveBegan_interactiveCancelled.swift +81 -0
  790. package/kit-apple/Sources/NativeScriptKit/Core/Object_interactiveCancelled.swift +66 -0
  791. package/kit-apple/Sources/NativeScriptKit/Core/Object_interactive_pageStart_pageEnd_pageOut_pageReturn_instance_activeType.swift +165 -0
  792. package/kit-apple/Sources/NativeScriptKit/Core/Object_inverse_type_features.swift +95 -0
  793. package/kit-apple/Sources/NativeScriptKit/Core/Object_ios.swift +78 -0
  794. package/kit-apple/Sources/NativeScriptKit/Core/Object_iosNotificationType.swift +66 -0
  795. package/kit-apple/Sources/NativeScriptKit/Core/Object_iosNotificationType_message.swift +80 -0
  796. package/kit-apple/Sources/NativeScriptKit/Core/Object_ios_.swift +64 -0
  797. package/kit-apple/Sources/NativeScriptKit/Core/Object_ios_scene.swift +80 -0
  798. package/kit-apple/Sources/NativeScriptKit/Core/Object_isMatch_getMatchOccurences_getMatchValue.swift +101 -0
  799. package/kit-apple/Sources/NativeScriptKit/Core/Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpreadable_and_19_more_91b5f3.swift +413 -0
  800. package/kit-apple/Sources/NativeScriptKit/Core/Object_keepAspectRatio_autoScaleFactor.swift +73 -0
  801. package/kit-apple/Sources/NativeScriptKit/Core/Object_key_createView.swift +95 -0
  802. package/kit-apple/Sources/NativeScriptKit/Core/Object_key_createView_.swift +97 -0
  803. package/kit-apple/Sources/NativeScriptKit/Core/Object_launchData.swift +68 -0
  804. package/kit-apple/Sources/NativeScriptKit/Core/Object_left_right.swift +95 -0
  805. package/kit-apple/Sources/NativeScriptKit/Core/Object_left_right_center_top_bottom.swift +115 -0
  806. package/kit-apple/Sources/NativeScriptKit/Core/Object_lifecycle_timeline.swift +80 -0
  807. package/kit-apple/Sources/NativeScriptKit/Core/Object_line_column.swift +80 -0
  808. package/kit-apple/Sources/NativeScriptKit/Core/Object_location.swift +64 -0
  809. package/kit-apple/Sources/NativeScriptKit/Core/Object_location_length.swift +80 -0
  810. package/kit-apple/Sources/NativeScriptKit/Core/Object_m.swift +64 -0
  811. package/kit-apple/Sources/NativeScriptKit/Core/Object_maskPath_shadowPath.swift +95 -0
  812. package/kit-apple/Sources/NativeScriptKit/Core/Object_matches_media.swift +80 -0
  813. package/kit-apple/Sources/NativeScriptKit/Core/Object_measuredWidth_measuredHeight.swift +81 -0
  814. package/kit-apple/Sources/NativeScriptKit/Core/Object_message.swift +64 -0
  815. package/kit-apple/Sources/NativeScriptKit/Core/Object_method.swift +64 -0
  816. package/kit-apple/Sources/NativeScriptKit/Core/Object_method_postData.swift +80 -0
  817. package/kit-apple/Sources/NativeScriptKit/Core/Object_modifier_property_value.swift +87 -0
  818. package/kit-apple/Sources/NativeScriptKit/Core/Object_moduleName.swift +65 -0
  819. package/kit-apple/Sources/NativeScriptKit/Core/Object_moduleName_.swift +78 -0
  820. package/kit-apple/Sources/NativeScriptKit/Core/Object_moduleName_create_transition.swift +93 -0
  821. package/kit-apple/Sources/NativeScriptKit/Core/Object_moduleName_transition.swift +76 -0
  822. package/kit-apple/Sources/NativeScriptKit/Core/Object_name.swift +64 -0
  823. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_affectsLayout_valueChanged.swift +103 -0
  824. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_affectsLayout_valueChanged_.swift +98 -0
  825. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_affectsLayout_valueChanged__.swift +100 -0
  826. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_affectsLayout_valueChanged___.swift +102 -0
  827. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_affectsLayout_valueConverter.swift +96 -0
  828. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_affectsLayout_valueConverter_valueChanged.swift +115 -0
  829. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName.swift +80 -0
  830. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_affectsLayout_defaultValue_valueConverter_valueChanged.swift +139 -0
  831. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_affectsLayout_defaultValue_valueConverter_valueChanged_.swift +159 -0
  832. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_affectsLayout_valueChanged.swift +114 -0
  833. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_affectsLayout_valueChanged_valueConverter.swift +130 -0
  834. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_affectsLayout_valueChanged_valueConverter_.swift +134 -0
  835. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_affectsLayout_valueConverter.swift +133 -0
  836. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_affectsLayout_valueConverter_.swift +113 -0
  837. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue.swift +94 -0
  838. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_equalityComparer_valueChanged_valueConverter.swift +183 -0
  839. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_equalityComparer_valueConverter.swift +168 -0
  840. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_equalityComparer_valueConverter_.swift +169 -0
  841. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_equalityComparer_valueConverter_valueChanged.swift +181 -0
  842. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_valueConverter.swift +128 -0
  843. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_valueConverter_.swift +128 -0
  844. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_valueConverter__.swift +128 -0
  845. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_affectsLayout_valueConverter_valueChanged.swift +139 -0
  846. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_equalityComparer_valueChanged_valueConverter.swift +162 -0
  847. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_equalityComparer_valueConverter.swift +150 -0
  848. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_valueConverter.swift +113 -0
  849. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_valueConverter_.swift +113 -0
  850. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_valueConverter__.swift +114 -0
  851. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_valueConverter___.swift +113 -0
  852. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_defaultValue_valueConverter_valueChanged.swift +121 -0
  853. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_equalityComparer_defaultValue_valueConverter.swift +129 -0
  854. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_equalityComparer_valueConverter.swift +114 -0
  855. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_getter_converter.swift +130 -0
  856. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_getter_converter_.swift +133 -0
  857. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_getter_converter__.swift +130 -0
  858. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_getter_converter___.swift +131 -0
  859. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_getter_converter____.swift +133 -0
  860. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_getter_converter_____.swift +131 -0
  861. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueChanged.swift +99 -0
  862. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueChanged_equalityComparer_valueConverter.swift +153 -0
  863. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueChanged_equalityComparer_valueConverter_.swift +132 -0
  864. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueChanged_valueConverter.swift +118 -0
  865. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueConverter.swift +95 -0
  866. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueConverter_.swift +95 -0
  867. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueConverter__.swift +95 -0
  868. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_cssName_valueConverter_valueChanged.swift +114 -0
  869. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue.swift +80 -0
  870. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_.swift +94 -0
  871. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue__.swift +80 -0
  872. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue___.swift +81 -0
  873. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout.swift +95 -0
  874. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_equalityComparer_valueConverter_valueChanged.swift +163 -0
  875. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueChanged_coerceValue_valueConverter.swift +144 -0
  876. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueChanged_valueConverter.swift +124 -0
  877. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueConverter.swift +135 -0
  878. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueConverter_.swift +114 -0
  879. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueConverter__.swift +114 -0
  880. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueConverter___.swift +135 -0
  881. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueConverter____.swift +114 -0
  882. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_affectsLayout_valueConverter_valueChanged.swift +122 -0
  883. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_coerceValue_valueChanged_valueConverter.swift +125 -0
  884. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_coerceValue_valueConverter.swift +116 -0
  885. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_coerceValue_valueConverter_.swift +115 -0
  886. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_equalityComparer_coerceValue_valueChanged_valueConverter.swift +170 -0
  887. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_equalityComparer_valueChanged.swift +111 -0
  888. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_equalityComparer_valueConverter.swift +116 -0
  889. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_equalityComparer_valueConverter_.swift +139 -0
  890. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_equalityComparer_valueConverter__.swift +136 -0
  891. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged.swift +92 -0
  892. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_.swift +92 -0
  893. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_coerceValue_valueConverter.swift +126 -0
  894. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_equalityComparer_valueConverter.swift +146 -0
  895. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_valueConverter.swift +107 -0
  896. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_valueConverter_.swift +107 -0
  897. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_valueConverter__.swift +108 -0
  898. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_valueConverter___.swift +108 -0
  899. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_valueConverter____.swift +128 -0
  900. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_valueConverter_____.swift +108 -0
  901. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueChanged_valueConverter______.swift +126 -0
  902. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter.swift +98 -0
  903. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter_.swift +96 -0
  904. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter__.swift +97 -0
  905. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter___.swift +98 -0
  906. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter____.swift +100 -0
  907. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter_coerceValue.swift +115 -0
  908. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter_valueChanged.swift +107 -0
  909. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_defaultValue_valueConverter_valueChanged_.swift +107 -0
  910. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_duration.swift +80 -0
  911. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_equalityComparer_valueConverter.swift +101 -0
  912. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_equalityComparer_valueConverter_.swift +100 -0
  913. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_equalityComparer_valueConverter__.swift +119 -0
  914. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_keyframes_mediaQueryString.swift +117 -0
  915. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged.swift +82 -0
  916. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged_.swift +82 -0
  917. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged__.swift +84 -0
  918. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged___.swift +84 -0
  919. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged____.swift +82 -0
  920. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged_____.swift +82 -0
  921. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged______.swift +82 -0
  922. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged_______.swift +81 -0
  923. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged________.swift +86 -0
  924. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged_________.swift +92 -0
  925. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged__________.swift +90 -0
  926. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged_valueConverter.swift +101 -0
  927. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged_valueConverter_.swift +119 -0
  928. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueChanged_valueConverter__.swift +101 -0
  929. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueConverter.swift +81 -0
  930. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueConverter_.swift +81 -0
  931. package/kit-apple/Sources/NativeScriptKit/Core/Object_name_valueConverter__.swift +82 -0
  932. package/kit-apple/Sources/NativeScriptKit/Core/Object_navigatingToEvent_navigatedToEvent_navigatingFromEvent_navigatedFromEvent.swift +116 -0
  933. package/kit-apple/Sources/NativeScriptKit/Core/Object_normalState_selectedState.swift +81 -0
  934. package/kit-apple/Sources/NativeScriptKit/Core/Object_num_regexp_string_name_privateId_eof_and_71_more_93cbae.swift +688 -0
  935. package/kit-apple/Sources/NativeScriptKit/Core/Object_object_eventName_propertyName_value_oldValue_origin.swift +154 -0
  936. package/kit-apple/Sources/NativeScriptKit/Core/Object_object_eventName_scrollX_scrollY.swift +105 -0
  937. package/kit-apple/Sources/NativeScriptKit/Core/Object_object_eventName_scrollX_scrollY_.swift +121 -0
  938. package/kit-apple/Sources/NativeScriptKit/Core/Object_opacity_color_tapToClose_animation_ignoreShadeRestore.swift +131 -0
  939. package/kit-apple/Sources/NativeScriptKit/Core/Object_orientation_systemAppearance.swift +100 -0
  940. package/kit-apple/Sources/NativeScriptKit/Core/Object_orientation_systemAppearance_.swift +81 -0
  941. package/kit-apple/Sources/NativeScriptKit/Core/Object_page_toPage.swift +94 -0
  942. package/kit-apple/Sources/NativeScriptKit/Core/Object_page_toPage_.swift +95 -0
  943. package/kit-apple/Sources/NativeScriptKit/Core/Object_parent_name_items.swift +111 -0
  944. package/kit-apple/Sources/NativeScriptKit/Core/Object_path_name.swift +72 -0
  945. package/kit-apple/Sources/NativeScriptKit/Core/Object_path_name_extension.swift +86 -0
  946. package/kit-apple/Sources/NativeScriptKit/Core/Object_pattern_flags.swift +80 -0
  947. package/kit-apple/Sources/NativeScriptKit/Core/Object_position_systemIcon.swift +94 -0
  948. package/kit-apple/Sources/NativeScriptKit/Core/Object_prefix_namespace_name.swift +113 -0
  949. package/kit-apple/Sources/NativeScriptKit/Core/Object_presented_presenting_independent.swift +98 -0
  950. package/kit-apple/Sources/NativeScriptKit/Core/Object_propName_propValue.swift +80 -0
  951. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value.swift +95 -0
  952. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value_.swift +95 -0
  953. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value__.swift +96 -0
  954. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value___.swift +94 -0
  955. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value____.swift +80 -0
  956. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value_____.swift +80 -0
  957. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value______.swift +80 -0
  958. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value_______.swift +83 -0
  959. package/kit-apple/Sources/NativeScriptKit/Core/Object_property_value________.swift +83 -0
  960. package/kit-apple/Sources/NativeScriptKit/Core/Object_r_g_b.swift +78 -0
  961. package/kit-apple/Sources/NativeScriptKit/Core/Object_raw_cooked.swift +94 -0
  962. package/kit-apple/Sources/NativeScriptKit/Core/Object_raw_cooked_.swift +80 -0
  963. package/kit-apple/Sources/NativeScriptKit/Core/Object_raw_requestURL_toNativeImage_toNativeString.swift +114 -0
  964. package/kit-apple/Sources/NativeScriptKit/Core/Object_raw_requestURL_toNativeImage_toNativeString_.swift +135 -0
  965. package/kit-apple/Sources/NativeScriptKit/Core/Object_recognizer_target.swift +96 -0
  966. package/kit-apple/Sources/NativeScriptKit/Core/Object_repeatX_repeatY_posX_posY.swift +93 -0
  967. package/kit-apple/Sources/NativeScriptKit/Core/Object_requestTime_proxyStart_proxyEnd_dnsStart_dnsEnd_connectStart_and_9_more_3e958e.swift +248 -0
  968. package/kit-apple/Sources/NativeScriptKit/Core/Object_result_text.swift +94 -0
  969. package/kit-apple/Sources/NativeScriptKit/Core/Object_result_userName_password.swift +102 -0
  970. package/kit-apple/Sources/NativeScriptKit/Core/Object_right_left.swift +80 -0
  971. package/kit-apple/Sources/NativeScriptKit/Core/Object_row_col.swift +72 -0
  972. package/kit-apple/Sources/NativeScriptKit/Core/Object_rules.swift +66 -0
  973. package/kit-apple/Sources/NativeScriptKit/Core/Object_rules_.swift +78 -0
  974. package/kit-apple/Sources/NativeScriptKit/Core/Object_safeArea_fullscreen_inWindow.swift +107 -0
  975. package/kit-apple/Sources/NativeScriptKit/Core/Object_scale_translate_rotate.swift +100 -0
  976. package/kit-apple/Sources/NativeScriptKit/Core/Object_scale_tx_ty.swift +86 -0
  977. package/kit-apple/Sources/NativeScriptKit/Core/Object_sceneWillConnect_sceneDidActivate_sceneWillResignActive_sceneWillEnterForeground_sceneDidEnterBackground_sceneDidDisconnect_and_1_more_1be9d4.swift +159 -0
  978. package/kit-apple/Sources/NativeScriptKit/Core/Object_scene_uiWindow.swift +80 -0
  979. package/kit-apple/Sources/NativeScriptKit/Core/Object_shape_rule.swift +80 -0
  980. package/kit-apple/Sources/NativeScriptKit/Core/Object_sharedElements_presented_presenting.swift +115 -0
  981. package/kit-apple/Sources/NativeScriptKit/Core/Object_sharedTransitionTag_zIndex.swift +100 -0
  982. package/kit-apple/Sources/NativeScriptKit/Core/Object_showing.swift +64 -0
  983. package/kit-apple/Sources/NativeScriptKit/Core/Object_snap_endFrame_endCornerRadius_srcSharedView.swift +112 -0
  984. package/kit-apple/Sources/NativeScriptKit/Core/Object_sourceProperty_expression_twoWay_source_defaultProperty.swift +120 -0
  985. package/kit-apple/Sources/NativeScriptKit/Core/Object_sourceProperty_targetProperty_expression.swift +111 -0
  986. package/kit-apple/Sources/NativeScriptKit/Core/Object_sourceProperty_targetProperty_expression_twoWay_compiled.swift +145 -0
  987. package/kit-apple/Sources/NativeScriptKit/Core/Object_spans.swift +66 -0
  988. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value.swift +86 -0
  989. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value_.swift +86 -0
  990. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value__.swift +89 -0
  991. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value___.swift +100 -0
  992. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value____.swift +86 -0
  993. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value_____.swift +88 -0
  994. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value______.swift +89 -0
  995. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value_______.swift +89 -0
  996. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value________.swift +89 -0
  997. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value_________.swift +89 -0
  998. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value__________.swift +89 -0
  999. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value___________.swift +87 -0
  1000. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value____________.swift +90 -0
  1001. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value_____________.swift +89 -0
  1002. package/kit-apple/Sources/NativeScriptKit/Core/Object_start_end_value______________.swift +90 -0
  1003. package/kit-apple/Sources/NativeScriptKit/Core/Object_status_headers.swift +83 -0
  1004. package/kit-apple/Sources/NativeScriptKit/Core/Object_status_statusText.swift +80 -0
  1005. package/kit-apple/Sources/NativeScriptKit/Core/Object_status_statusText_headers_url.swift +110 -0
  1006. package/kit-apple/Sources/NativeScriptKit/Core/Object_targetProperty.swift +66 -0
  1007. package/kit-apple/Sources/NativeScriptKit/Core/Object_targetProperty_sourceProperty.swift +73 -0
  1008. package/kit-apple/Sources/NativeScriptKit/Core/Object_target_backgroundColor_scale_translate_rotate_opacity_width_height_valueSource_duration_curve_forceLayer.swift +264 -0
  1009. package/kit-apple/Sources/NativeScriptKit/Core/Object_target_opacity_backgroundColor_translate_scale_height_width_rotate_duration_delay_iterations_curve.swift +252 -0
  1010. package/kit-apple/Sources/NativeScriptKit/Core/Object_target_property_value_duration_delay_iterations_curve.swift +152 -0
  1011. package/kit-apple/Sources/NativeScriptKit/Core/Object_target_property_value_duration_delay_iterations_curve_.swift +152 -0
  1012. package/kit-apple/Sources/NativeScriptKit/Core/Object_target_property_value_duration_delay_iterations_curve__.swift +153 -0
  1013. package/kit-apple/Sources/NativeScriptKit/Core/Object_target_property_value_duration_delay_iterations_curve___.swift +151 -0
  1014. package/kit-apple/Sources/NativeScriptKit/Core/Object_target_translate_scale_rotate_opacity_duration_curve.swift +165 -0
  1015. package/kit-apple/Sources/NativeScriptKit/Core/Object_tension_friction_mass_delay_velocity_animateOptions_animations_completion.swift +165 -0
  1016. package/kit-apple/Sources/NativeScriptKit/Core/Object_tension_friction_mass_velocity.swift +101 -0
  1017. package/kit-apple/Sources/NativeScriptKit/Core/Object_tension_friction_mass_velocity_delay.swift +118 -0
  1018. package/kit-apple/Sources/NativeScriptKit/Core/Object_tension_friction_mass_velocity_delay_animations_completion.swift +142 -0
  1019. package/kit-apple/Sources/NativeScriptKit/Core/Object_textColor_tintColor.swift +72 -0
  1020. package/kit-apple/Sources/NativeScriptKit/Core/Object_text_iosFont_color_backgroundColor_textDecoration_baselineOffset_index.swift +144 -0
  1021. package/kit-apple/Sources/NativeScriptKit/Core/Object_title_cancelButtonText.swift +94 -0
  1022. package/kit-apple/Sources/NativeScriptKit/Core/Object_title_okButtonText_cancelButtonText.swift +96 -0
  1023. package/kit-apple/Sources/NativeScriptKit/Core/Object_title_okButtonText_cancelButtonText_inputType.swift +112 -0
  1024. package/kit-apple/Sources/NativeScriptKit/Core/Object_title_okButtonText_cancelButtonText_message.swift +112 -0
  1025. package/kit-apple/Sources/NativeScriptKit/Core/Object_title_okButtonText_message.swift +95 -0
  1026. package/kit-apple/Sources/NativeScriptKit/Core/Object_title_section.swift +80 -0
  1027. package/kit-apple/Sources/NativeScriptKit/Core/Object_toArrayBuffer_toString_toJSON_toImage_toFile.swift +142 -0
  1028. package/kit-apple/Sources/NativeScriptKit/Core/Object_toString_charAt_charCodeAt_concat_indexOf_lastIndexOf_and_44_more_fc25df.swift +481 -0
  1029. package/kit-apple/Sources/NativeScriptKit/Core/Object_topLeft_topRight_bottomLeft_bottomRight.swift +110 -0
  1030. package/kit-apple/Sources/NativeScriptKit/Core/Object_top_bottom.swift +80 -0
  1031. package/kit-apple/Sources/NativeScriptKit/Core/Object_top_left_bottom_right.swift +109 -0
  1032. package/kit-apple/Sources/NativeScriptKit/Core/Object_top_right_bottom_left.swift +122 -0
  1033. package/kit-apple/Sources/NativeScriptKit/Core/Object_top_right_bottom_left_.swift +109 -0
  1034. package/kit-apple/Sources/NativeScriptKit/Core/Object_totalTime_count_currentStart_runCount.swift +110 -0
  1035. package/kit-apple/Sources/NativeScriptKit/Core/Object_touches_event.swift +80 -0
  1036. package/kit-apple/Sources/NativeScriptKit/Core/Object_transitionContext.swift +66 -0
  1037. package/kit-apple/Sources/NativeScriptKit/Core/Object_translateX_translateY_scaleX_scaleY_rotate_opacity.swift +118 -0
  1038. package/kit-apple/Sources/NativeScriptKit/Core/Object_translateX_translateY_scaleX_scaleY_rotate_opacity_duration_curve.swift +151 -0
  1039. package/kit-apple/Sources/NativeScriptKit/Core/Object_translate_rotate_scale.swift +102 -0
  1040. package/kit-apple/Sources/NativeScriptKit/Core/Object_type.swift +64 -0
  1041. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_action_value_namespace_ignoreCase.swift +152 -0
  1042. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_action_value_namespace_ignoreCase_.swift +133 -0
  1043. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_data.swift +78 -0
  1044. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_data_.swift +92 -0
  1045. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_namespace.swift +102 -0
  1046. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_prelude_block.swift +120 -0
  1047. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_text.swift +104 -0
  1048. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_name_text_components.swift +113 -0
  1049. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_namespace.swift +94 -0
  1050. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_path.swift +72 -0
  1051. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_prelude_block.swift +111 -0
  1052. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_property_value.swift +94 -0
  1053. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_quote_string_value.swift +101 -0
  1054. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_selectors_declarations.swift +96 -0
  1055. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_start_end.swift +94 -0
  1056. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_start_end_left_right.swift +127 -0
  1057. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_start_end_name.swift +118 -0
  1058. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_string.swift +80 -0
  1059. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_string_unit_value.swift +101 -0
  1060. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_stylesheet.swift +83 -0
  1061. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_text.swift +72 -0
  1062. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_text_.swift +97 -0
  1063. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_text__.swift +86 -0
  1064. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_text_associatedToken_values.swift +125 -0
  1065. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_view_ios_android_direction_object_eventName.swift +159 -0
  1066. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_view_ios_android_eventName_object_getPointerCount_getX_getY.swift +187 -0
  1067. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_view_ios_android_object_eventName.swift +152 -0
  1068. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_view_ios_android_object_eventName_state.swift +167 -0
  1069. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_view_ios_android_rotation_object_eventName_state.swift +182 -0
  1070. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_view_ios_android_scale_getFocusX_getFocusY_object_eventName_state.swift +194 -0
  1071. package/kit-apple/Sources/NativeScriptKit/Core/Object_type_view_ios_android_startX_startY_deltaX_deltaY_object_eventName_state.swift +201 -0
  1072. package/kit-apple/Sources/NativeScriptKit/Core/Object_uri_message_time.swift +108 -0
  1073. package/kit-apple/Sources/NativeScriptKit/Core/Object_url_method.swift +80 -0
  1074. package/kit-apple/Sources/NativeScriptKit/Core/Object_url_source.swift +95 -0
  1075. package/kit-apple/Sources/NativeScriptKit/Core/Object_url_source_.swift +94 -0
  1076. package/kit-apple/Sources/NativeScriptKit/Core/Object_url_status_statusText_headers_mimeType_fromDiskCache_timing_headersSize.swift +201 -0
  1077. package/kit-apple/Sources/NativeScriptKit/Core/Object_value_unit.swift +80 -0
  1078. package/kit-apple/Sources/NativeScriptKit/Core/Object_value_unit_.swift +94 -0
  1079. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_index.swift +95 -0
  1080. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_index_.swift +94 -0
  1081. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_isPresented_startFrame_snapshot_endFrame_startTransform_and_5_more_20e753.swift +234 -0
  1082. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_options.swift +94 -0
  1083. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_options_.swift +94 -0
  1084. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_startFrame_endFrame_snapshot_startOpacity_endOpacity_propertiesToMatch_zIndex.swift +186 -0
  1085. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_startFrame_endFrame_startOpacity_endOpacity_propertiesToMatch_imageSourceChangeListener.swift +181 -0
  1086. package/kit-apple/Sources/NativeScriptKit/Core/Object_view_type_animation.swift +86 -0
  1087. package/kit-apple/Sources/NativeScriptKit/Core/Object_width_color.swift +86 -0
  1088. package/kit-apple/Sources/NativeScriptKit/Core/Object_width_height.swift +80 -0
  1089. package/kit-apple/Sources/NativeScriptKit/Core/Object_width_height_.swift +95 -0
  1090. package/kit-apple/Sources/NativeScriptKit/Core/Object_width_height_os_deviceType.swift +109 -0
  1091. package/kit-apple/Sources/NativeScriptKit/Core/Object_windowOpen_windowClose_primaryWindowChanged.swift +96 -0
  1092. package/kit-apple/Sources/NativeScriptKit/Core/Object_window_isPrimary.swift +80 -0
  1093. package/kit-apple/Sources/NativeScriptKit/Core/Object_window_isPrimary_data_ios.swift +118 -0
  1094. package/kit-apple/Sources/NativeScriptKit/Core/Object_xRadius_yRadius_maxRadius.swift +87 -0
  1095. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y.swift +85 -0
  1096. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y_.swift +72 -0
  1097. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y__.swift +86 -0
  1098. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y___.swift +72 -0
  1099. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y____.swift +86 -0
  1100. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y_____.swift +77 -0
  1101. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y______.swift +74 -0
  1102. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y_______.swift +89 -0
  1103. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y________.swift +88 -0
  1104. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y_________.swift +77 -0
  1105. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y_width_height.swift +101 -0
  1106. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y_z.swift +94 -0
  1107. package/kit-apple/Sources/NativeScriptKit/Core/Object_x_y_z_.swift +78 -0
  1108. package/kit-apple/Sources/NativeScriptKit/Core/Object_xmlns.swift +64 -0
  1109. package/kit-apple/Sources/NativeScriptKit/Core/Object_xs_ys_xt_yt_rx_ry_rz.swift +106 -0
  1110. package/kit-apple/Sources/NativeScriptKit/Core/__Export.AndroidApplication.swift +18 -0
  1111. package/kit-apple/Sources/NativeScriptKit/Core/__Export.AndroidHelper.swift +18 -0
  1112. package/kit-apple/Sources/NativeScriptKit/Core/__Export.AnimationCurve.swift +18 -0
  1113. package/kit-apple/Sources/NativeScriptKit/Core/__Export.Application.swift +18 -0
  1114. package/kit-apple/Sources/NativeScriptKit/Core/__Export.CSSHelper.swift +20 -0
  1115. package/kit-apple/Sources/NativeScriptKit/Core/__Export.CSSType.swift +20 -0
  1116. package/kit-apple/Sources/NativeScriptKit/Core/__Export.Device.swift +18 -0
  1117. package/kit-apple/Sources/NativeScriptKit/Core/__Export.Dialogs.swift +18 -0
  1118. package/kit-apple/Sources/NativeScriptKit/Core/__Export.Enums.swift +20 -0
  1119. package/kit-apple/Sources/NativeScriptKit/Core/__Export.NativeWindowEvents.swift +20 -0
  1120. package/kit-apple/Sources/NativeScriptKit/Core/__Export.PseudoClassHandler.swift +20 -0
  1121. package/kit-apple/Sources/NativeScriptKit/Core/__Export.SceneEvents.swift +20 -0
  1122. package/kit-apple/Sources/NativeScriptKit/Core/__Export.WindowEvents.swift +20 -0
  1123. package/kit-apple/Sources/NativeScriptKit/Core/__Export._resetRootView.swift +18 -0
  1124. package/kit-apple/Sources/NativeScriptKit/Core/__Export._resolveAnimationCurve.swift +20 -0
  1125. package/kit-apple/Sources/NativeScriptKit/Core/__Export._setResolver.swift +20 -0
  1126. package/kit-apple/Sources/NativeScriptKit/Core/__Export._updateCharactersInRangeReplacementString.swift +23 -0
  1127. package/kit-apple/Sources/NativeScriptKit/Core/__Export.action.swift +20 -0
  1128. package/kit-apple/Sources/NativeScriptKit/Core/__Export.addCss.swift +18 -0
  1129. package/kit-apple/Sources/NativeScriptKit/Core/__Export.addTaggedAdditionalCSS.swift +20 -0
  1130. package/kit-apple/Sources/NativeScriptKit/Core/__Export.addWeakEventListener.swift +22 -0
  1131. package/kit-apple/Sources/NativeScriptKit/Core/__Export.alert.swift +20 -0
  1132. package/kit-apple/Sources/NativeScriptKit/Core/__Export.android.swift +18 -0
  1133. package/kit-apple/Sources/NativeScriptKit/Core/__Export.androidDynamicElevationOffsetProperty.swift +20 -0
  1134. package/kit-apple/Sources/NativeScriptKit/Core/__Export.androidElevationProperty.swift +18 -0
  1135. package/kit-apple/Sources/NativeScriptKit/Core/__Export.animationTimingFunctionConverter.swift +20 -0
  1136. package/kit-apple/Sources/NativeScriptKit/Core/__Export.autocapitalizationTypeProperty.swift +20 -0
  1137. package/kit-apple/Sources/NativeScriptKit/Core/__Export.autocorrectProperty.swift +18 -0
  1138. package/kit-apple/Sources/NativeScriptKit/Core/__Export.backgroundColorProperty.swift +18 -0
  1139. package/kit-apple/Sources/NativeScriptKit/Core/__Export.backgroundEvent.swift +18 -0
  1140. package/kit-apple/Sources/NativeScriptKit/Core/__Export.backgroundImageProperty.swift +18 -0
  1141. package/kit-apple/Sources/NativeScriptKit/Core/__Export.backgroundInternalProperty.swift +18 -0
  1142. package/kit-apple/Sources/NativeScriptKit/Core/__Export.backgroundPositionProperty.swift +18 -0
  1143. package/kit-apple/Sources/NativeScriptKit/Core/__Export.backgroundRepeatProperty.swift +18 -0
  1144. package/kit-apple/Sources/NativeScriptKit/Core/__Export.backgroundSizeProperty.swift +18 -0
  1145. package/kit-apple/Sources/NativeScriptKit/Core/__Export.booleanConverter.swift +20 -0
  1146. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderBottomColorProperty.swift +18 -0
  1147. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderBottomLeftRadiusProperty.swift +20 -0
  1148. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderBottomRightRadiusProperty.swift +20 -0
  1149. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderBottomWidthProperty.swift +18 -0
  1150. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderLeftColorProperty.swift +18 -0
  1151. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderLeftWidthProperty.swift +18 -0
  1152. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderRightColorProperty.swift +18 -0
  1153. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderRightWidthProperty.swift +18 -0
  1154. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderTopColorProperty.swift +18 -0
  1155. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderTopLeftRadiusProperty.swift +18 -0
  1156. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderTopRightRadiusProperty.swift +18 -0
  1157. package/kit-apple/Sources/NativeScriptKit/Core/__Export.borderTopWidthProperty.swift +18 -0
  1158. package/kit-apple/Sources/NativeScriptKit/Core/__Export.clipPathProperty.swift +18 -0
  1159. package/kit-apple/Sources/NativeScriptKit/Core/__Export.colorProperty.swift +18 -0
  1160. package/kit-apple/Sources/NativeScriptKit/Core/__Export.columnGapProperty.swift +18 -0
  1161. package/kit-apple/Sources/NativeScriptKit/Core/__Export.confirm.swift +20 -0
  1162. package/kit-apple/Sources/NativeScriptKit/Core/__Export.cornerShapeProperty.swift +18 -0
  1163. package/kit-apple/Sources/NativeScriptKit/Core/__Export.directionProperty.swift +18 -0
  1164. package/kit-apple/Sources/NativeScriptKit/Core/__Export.discardedErrorEvent.swift +18 -0
  1165. package/kit-apple/Sources/NativeScriptKit/Core/__Export.displayedEvent.swift +18 -0
  1166. package/kit-apple/Sources/NativeScriptKit/Core/__Export.eachDescendant.swift +20 -0
  1167. package/kit-apple/Sources/NativeScriptKit/Core/__Export.editableProperty.swift +18 -0
  1168. package/kit-apple/Sources/NativeScriptKit/Core/__Export.ensureA11yClasses.swift +20 -0
  1169. package/kit-apple/Sources/NativeScriptKit/Core/__Export.exitEvent.swift +18 -0
  1170. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontFamilyProperty.swift +18 -0
  1171. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontInternalProperty.swift +18 -0
  1172. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontScaleChangedEvent.swift +18 -0
  1173. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontScaleInternalProperty.swift +20 -0
  1174. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontSizeProperty.swift +18 -0
  1175. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontStyleProperty.swift +18 -0
  1176. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontVariationSettingsProperty.swift +20 -0
  1177. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fontWeightProperty.swift +18 -0
  1178. package/kit-apple/Sources/NativeScriptKit/Core/__Export.foregroundEvent.swift +18 -0
  1179. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fromObject.swift +20 -0
  1180. package/kit-apple/Sources/NativeScriptKit/Core/__Export.fromObjectRecursive.swift +20 -0
  1181. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getAncestor.swift +20 -0
  1182. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getAndroidAccessibilityManager.swift +20 -0
  1183. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getCssFileName.swift +18 -0
  1184. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getCurrentFontScale.swift +20 -0
  1185. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getCurrentPage.swift +20 -0
  1186. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getFileAccess.swift +20 -0
  1187. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getMainEntry.swift +18 -0
  1188. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getNativeApp.swift +20 -0
  1189. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getNativeApplication.swift +18 -0
  1190. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getResources.swift +18 -0
  1191. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getRootLayout.swift +20 -0
  1192. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getRootLayoutById.swift +20 -0
  1193. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getRootView.swift +18 -0
  1194. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getTransformedText.swift +20 -0
  1195. package/kit-apple/Sources/NativeScriptKit/Core/__Export.getViewById.swift +20 -0
  1196. package/kit-apple/Sources/NativeScriptKit/Core/__Export.hasLaunched.swift +18 -0
  1197. package/kit-apple/Sources/NativeScriptKit/Core/__Export.hasListeners.swift +18 -0
  1198. package/kit-apple/Sources/NativeScriptKit/Core/__Export.heightProperty.swift +18 -0
  1199. package/kit-apple/Sources/NativeScriptKit/Core/__Export.hintProperty.swift +18 -0
  1200. package/kit-apple/Sources/NativeScriptKit/Core/__Export.horizontalAlignmentProperty.swift +18 -0
  1201. package/kit-apple/Sources/NativeScriptKit/Core/__Export.inBackground.swift +18 -0
  1202. package/kit-apple/Sources/NativeScriptKit/Core/__Export.initAccessibilityCssHelper.swift +20 -0
  1203. package/kit-apple/Sources/NativeScriptKit/Core/__Export.isAccessibilityServiceEnabled.swift +20 -0
  1204. package/kit-apple/Sources/NativeScriptKit/Core/__Export.isAndroid.swift +18 -0
  1205. package/kit-apple/Sources/NativeScriptKit/Core/__Export.isApple.swift +18 -0
  1206. package/kit-apple/Sources/NativeScriptKit/Core/__Export.isEmbedded.swift +20 -0
  1207. package/kit-apple/Sources/NativeScriptKit/Core/__Export.isIOS.swift +18 -0
  1208. package/kit-apple/Sources/NativeScriptKit/Core/__Export.isUserInteractionEnabledProperty.swift +20 -0
  1209. package/kit-apple/Sources/NativeScriptKit/Core/__Export.isVisionOS.swift +18 -0
  1210. package/kit-apple/Sources/NativeScriptKit/Core/__Export.keyboardTypeProperty.swift +18 -0
  1211. package/kit-apple/Sources/NativeScriptKit/Core/__Export.launchEvent.swift +18 -0
  1212. package/kit-apple/Sources/NativeScriptKit/Core/__Export.layoutDirection.swift +18 -0
  1213. package/kit-apple/Sources/NativeScriptKit/Core/__Export.layoutDirectionChanged.swift +18 -0
  1214. package/kit-apple/Sources/NativeScriptKit/Core/__Export.layoutDirectionChangedEvent.swift +18 -0
  1215. package/kit-apple/Sources/NativeScriptKit/Core/__Export.letterSpacingProperty.swift +18 -0
  1216. package/kit-apple/Sources/NativeScriptKit/Core/__Export.lineHeightProperty.swift +18 -0
  1217. package/kit-apple/Sources/NativeScriptKit/Core/__Export.loadAppCss.swift +18 -0
  1218. package/kit-apple/Sources/NativeScriptKit/Core/__Export.login.swift +20 -0
  1219. package/kit-apple/Sources/NativeScriptKit/Core/__Export.lowMemoryEvent.swift +18 -0
  1220. package/kit-apple/Sources/NativeScriptKit/Core/__Export.makeParser.swift +22 -0
  1221. package/kit-apple/Sources/NativeScriptKit/Core/__Export.makeValidator.swift +20 -0
  1222. package/kit-apple/Sources/NativeScriptKit/Core/__Export.marginBottomProperty.swift +18 -0
  1223. package/kit-apple/Sources/NativeScriptKit/Core/__Export.marginLeftProperty.swift +18 -0
  1224. package/kit-apple/Sources/NativeScriptKit/Core/__Export.marginRightProperty.swift +18 -0
  1225. package/kit-apple/Sources/NativeScriptKit/Core/__Export.marginTopProperty.swift +18 -0
  1226. package/kit-apple/Sources/NativeScriptKit/Core/__Export.maxHeightProperty.swift +18 -0
  1227. package/kit-apple/Sources/NativeScriptKit/Core/__Export.maxLengthProperty.swift +18 -0
  1228. package/kit-apple/Sources/NativeScriptKit/Core/__Export.maxWidthProperty.swift +18 -0
  1229. package/kit-apple/Sources/NativeScriptKit/Core/__Export.minHeightProperty.swift +18 -0
  1230. package/kit-apple/Sources/NativeScriptKit/Core/__Export.minWidthProperty.swift +18 -0
  1231. package/kit-apple/Sources/NativeScriptKit/Core/__Export.notify.swift +18 -0
  1232. package/kit-apple/Sources/NativeScriptKit/Core/__Export.off.swift +18 -0
  1233. package/kit-apple/Sources/NativeScriptKit/Core/__Export.on.swift +18 -0
  1234. package/kit-apple/Sources/NativeScriptKit/Core/__Export.opacityProperty.swift +18 -0
  1235. package/kit-apple/Sources/NativeScriptKit/Core/__Export.orientation.swift +18 -0
  1236. package/kit-apple/Sources/NativeScriptKit/Core/__Export.orientationChangedEvent.swift +18 -0
  1237. package/kit-apple/Sources/NativeScriptKit/Core/__Export.paddingBottomProperty.swift +18 -0
  1238. package/kit-apple/Sources/NativeScriptKit/Core/__Export.paddingInternalProperty.swift +18 -0
  1239. package/kit-apple/Sources/NativeScriptKit/Core/__Export.paddingLeftProperty.swift +18 -0
  1240. package/kit-apple/Sources/NativeScriptKit/Core/__Export.paddingRightProperty.swift +18 -0
  1241. package/kit-apple/Sources/NativeScriptKit/Core/__Export.paddingTopProperty.swift +18 -0
  1242. package/kit-apple/Sources/NativeScriptKit/Core/__Export.parseCSSShadow.swift +20 -0
  1243. package/kit-apple/Sources/NativeScriptKit/Core/__Export.parseCSSStroke.swift +20 -0
  1244. package/kit-apple/Sources/NativeScriptKit/Core/__Export.parseKeyframeDeclarations.swift +22 -0
  1245. package/kit-apple/Sources/NativeScriptKit/Core/__Export.perspectiveProperty.swift +18 -0
  1246. package/kit-apple/Sources/NativeScriptKit/Core/__Export.placeholderColorProperty.swift +20 -0
  1247. package/kit-apple/Sources/NativeScriptKit/Core/__Export.platformNames.swift +18 -0
  1248. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profile.swift +22 -0
  1249. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingDisable.swift +20 -0
  1250. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingDumpProfiles.swift +20 -0
  1251. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingEnable.swift +20 -0
  1252. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingIsRunning.swift +20 -0
  1253. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingResetProfiles.swift +20 -0
  1254. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingStart.swift +20 -0
  1255. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingStartCPU.swift +20 -0
  1256. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingStop.swift +20 -0
  1257. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingStopCPU.swift +20 -0
  1258. package/kit-apple/Sources/NativeScriptKit/Core/__Export.profilingUptime.swift +20 -0
  1259. package/kit-apple/Sources/NativeScriptKit/Core/__Export.prompt.swift +20 -0
  1260. package/kit-apple/Sources/NativeScriptKit/Core/__Export.querySelectorAll.swift +20 -0
  1261. package/kit-apple/Sources/NativeScriptKit/Core/__Export.removeTaggedAdditionalCSS.swift +20 -0
  1262. package/kit-apple/Sources/NativeScriptKit/Core/__Export.removeWeakEventListener.swift +22 -0
  1263. package/kit-apple/Sources/NativeScriptKit/Core/__Export.resetRootView.swift +18 -0
  1264. package/kit-apple/Sources/NativeScriptKit/Core/__Export.resolveFileNameFromUrl.swift +23 -0
  1265. package/kit-apple/Sources/NativeScriptKit/Core/__Export.resumeEvent.swift +18 -0
  1266. package/kit-apple/Sources/NativeScriptKit/Core/__Export.returnKeyTypeProperty.swift +20 -0
  1267. package/kit-apple/Sources/NativeScriptKit/Core/__Export.rotateProperty.swift +18 -0
  1268. package/kit-apple/Sources/NativeScriptKit/Core/__Export.rotateXProperty.swift +18 -0
  1269. package/kit-apple/Sources/NativeScriptKit/Core/__Export.rotateYProperty.swift +18 -0
  1270. package/kit-apple/Sources/NativeScriptKit/Core/__Export.rowGapProperty.swift +18 -0
  1271. package/kit-apple/Sources/NativeScriptKit/Core/__Export.run.swift +18 -0
  1272. package/kit-apple/Sources/NativeScriptKit/Core/__Export.sanitizeModuleName.swift +20 -0
  1273. package/kit-apple/Sources/NativeScriptKit/Core/__Export.scaleXProperty.swift +18 -0
  1274. package/kit-apple/Sources/NativeScriptKit/Core/__Export.scaleYProperty.swift +18 -0
  1275. package/kit-apple/Sources/NativeScriptKit/Core/__Export.sendAccessibilityEvent.swift +18 -0
  1276. package/kit-apple/Sources/NativeScriptKit/Core/__Export.setActivityCallbacks.swift +20 -0
  1277. package/kit-apple/Sources/NativeScriptKit/Core/__Export.setAutoSystemAppearanceChanged.swift +18 -0
  1278. package/kit-apple/Sources/NativeScriptKit/Core/__Export.setCssFileName.swift +18 -0
  1279. package/kit-apple/Sources/NativeScriptKit/Core/__Export.setMaxRefreshRate.swift +18 -0
  1280. package/kit-apple/Sources/NativeScriptKit/Core/__Export.setNativeApp.swift +20 -0
  1281. package/kit-apple/Sources/NativeScriptKit/Core/__Export.setResources.swift +18 -0
  1282. package/kit-apple/Sources/NativeScriptKit/Core/__Export.suspendEvent.swift +18 -0
  1283. package/kit-apple/Sources/NativeScriptKit/Core/__Export.suspended.swift +18 -0
  1284. package/kit-apple/Sources/NativeScriptKit/Core/__Export.systemAppearance.swift +18 -0
  1285. package/kit-apple/Sources/NativeScriptKit/Core/__Export.systemAppearanceChanged.swift +18 -0
  1286. package/kit-apple/Sources/NativeScriptKit/Core/__Export.systemAppearanceChangedEvent.swift +18 -0
  1287. package/kit-apple/Sources/NativeScriptKit/Core/__Export.textAlignmentProperty.swift +18 -0
  1288. package/kit-apple/Sources/NativeScriptKit/Core/__Export.textDecorationProperty.swift +18 -0
  1289. package/kit-apple/Sources/NativeScriptKit/Core/__Export.textOverflowProperty.swift +18 -0
  1290. package/kit-apple/Sources/NativeScriptKit/Core/__Export.textShadowProperty.swift +18 -0
  1291. package/kit-apple/Sources/NativeScriptKit/Core/__Export.textStrokeProperty.swift +18 -0
  1292. package/kit-apple/Sources/NativeScriptKit/Core/__Export.textTransformProperty.swift +18 -0
  1293. package/kit-apple/Sources/NativeScriptKit/Core/__Export.timeConverter.swift +20 -0
  1294. package/kit-apple/Sources/NativeScriptKit/Core/__Export.translateXProperty.swift +18 -0
  1295. package/kit-apple/Sources/NativeScriptKit/Core/__Export.translateYProperty.swift +18 -0
  1296. package/kit-apple/Sources/NativeScriptKit/Core/__Export.uncaughtErrorEvent.swift +18 -0
  1297. package/kit-apple/Sources/NativeScriptKit/Core/__Export.unsetValue.swift +18 -0
  1298. package/kit-apple/Sources/NativeScriptKit/Core/__Export.updateAccessibilityProperties.swift +20 -0
  1299. package/kit-apple/Sources/NativeScriptKit/Core/__Export.updateCurrentHelperClasses.swift +21 -0
  1300. package/kit-apple/Sources/NativeScriptKit/Core/__Export.updateTextTriggerProperty.swift +20 -0
  1301. package/kit-apple/Sources/NativeScriptKit/Core/__Export.verticalAlignmentProperty.swift +18 -0
  1302. package/kit-apple/Sources/NativeScriptKit/Core/__Export.visibilityProperty.swift +18 -0
  1303. package/kit-apple/Sources/NativeScriptKit/Core/__Export.whiteSpaceProperty.swift +18 -0
  1304. package/kit-apple/Sources/NativeScriptKit/Core/__Export.widthProperty.swift +18 -0
  1305. package/kit-apple/Sources/NativeScriptKit/Core/__Export.zIndexProperty.swift +18 -0
  1306. package/kit-apple/Sources/NativeScriptKit/Core/__Modules.swift +17 -0
  1307. package/kit-apple/Sources/NativeScriptKit/Core/__Namespace.Http.swift +23 -0
  1308. package/kit-apple/Sources/NativeScriptKit/Core/__Namespace.Utils.swift +201 -0
  1309. package/kit-apple/Sources/NativeScriptKit/Core/abortcontroller.abortsignal.swift +109 -0
  1310. package/kit-apple/Sources/NativeScriptKit/Core/abortcontroller.index.swift +118 -0
  1311. package/kit-apple/Sources/NativeScriptKit/Core/accessibility.accessibility-common.swift +572 -0
  1312. package/kit-apple/Sources/NativeScriptKit/Core/accessibility.accessibility-properties.swift +258 -0
  1313. package/kit-apple/Sources/NativeScriptKit/Core/accessibility.index.swift +16 -0
  1314. package/kit-apple/Sources/NativeScriptKit/Core/application-settings.application-settings-common.swift +36 -0
  1315. package/kit-apple/Sources/NativeScriptKit/Core/application-settings.index.ios.swift +157 -0
  1316. package/kit-apple/Sources/NativeScriptKit/Core/application.application-common.swift +2095 -0
  1317. package/kit-apple/Sources/NativeScriptKit/Core/application.application-interfaces.swift +16 -0
  1318. package/kit-apple/Sources/NativeScriptKit/Core/application.application-shims.swift +212 -0
  1319. package/kit-apple/Sources/NativeScriptKit/Core/application.application.ios.swift +3854 -0
  1320. package/kit-apple/Sources/NativeScriptKit/Core/application.helpers-common.swift +224 -0
  1321. package/kit-apple/Sources/NativeScriptKit/Core/application.helpers.ios.swift +57 -0
  1322. package/kit-apple/Sources/NativeScriptKit/Core/application.index.ios.swift +16 -0
  1323. package/kit-apple/Sources/NativeScriptKit/Core/application.scene-delegate-bridge.swift +234 -0
  1324. package/kit-apple/Sources/NativeScriptKit/Core/color.color-common.swift +756 -0
  1325. package/kit-apple/Sources/NativeScriptKit/Core/color.color-types.swift +16 -0
  1326. package/kit-apple/Sources/NativeScriptKit/Core/color.color-utils.swift +388 -0
  1327. package/kit-apple/Sources/NativeScriptKit/Core/color.index.ios.swift +100 -0
  1328. package/kit-apple/Sources/NativeScriptKit/Core/color.known-colors.swift +520 -0
  1329. package/kit-apple/Sources/NativeScriptKit/Core/connectivity.index.ios.swift +190 -0
  1330. package/kit-apple/Sources/NativeScriptKit/Core/core-types.animation-types.swift +87 -0
  1331. package/kit-apple/Sources/NativeScriptKit/Core/core-types.index.swift +361 -0
  1332. package/kit-apple/Sources/NativeScriptKit/Core/core-types.validators.swift +62 -0
  1333. package/kit-apple/Sources/NativeScriptKit/Core/css-mediaquery.index.swift +220 -0
  1334. package/kit-apple/Sources/NativeScriptKit/Core/css-value.reworkcss-value.swift +280 -0
  1335. package/kit-apple/Sources/NativeScriptKit/Core/css.CSS3Parser.swift +1012 -0
  1336. package/kit-apple/Sources/NativeScriptKit/Core/css.CSSNativeScript.swift +264 -0
  1337. package/kit-apple/Sources/NativeScriptKit/Core/css.parser.swift +971 -0
  1338. package/kit-apple/Sources/NativeScriptKit/Core/css.system-classes.swift +120 -0
  1339. package/kit-apple/Sources/NativeScriptKit/Core/data.observable-array.index.swift +699 -0
  1340. package/kit-apple/Sources/NativeScriptKit/Core/data.observable.index.swift +1166 -0
  1341. package/kit-apple/Sources/NativeScriptKit/Core/data.virtual-array.index.swift +325 -0
  1342. package/kit-apple/Sources/NativeScriptKit/Core/fetch.index.swift +1201 -0
  1343. package/kit-apple/Sources/NativeScriptKit/Core/file-system.file-system-access.ios.swift +1450 -0
  1344. package/kit-apple/Sources/NativeScriptKit/Core/file-system.index.swift +1756 -0
  1345. package/kit-apple/Sources/NativeScriptKit/Core/fps-meter.fps-native.ios.swift +227 -0
  1346. package/kit-apple/Sources/NativeScriptKit/Core/fps-meter.index.swift +141 -0
  1347. package/kit-apple/Sources/NativeScriptKit/Core/globals.global-utils.swift +252 -0
  1348. package/kit-apple/Sources/NativeScriptKit/Core/http.http-interfaces.swift +24 -0
  1349. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.http-request-internal-common.swift +59 -0
  1350. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.index.ios.swift +413 -0
  1351. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request.http-request-common.swift +57 -0
  1352. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request.index.ios.swift +101 -0
  1353. package/kit-apple/Sources/NativeScriptKit/Core/http.index.swift +175 -0
  1354. package/kit-apple/Sources/NativeScriptKit/Core/image-asset.image-asset-common.swift +285 -0
  1355. package/kit-apple/Sources/NativeScriptKit/Core/image-asset.index.ios.swift +205 -0
  1356. package/kit-apple/Sources/NativeScriptKit/Core/image-source.image-source-common.swift +40 -0
  1357. package/kit-apple/Sources/NativeScriptKit/Core/image-source.index.ios.swift +1130 -0
  1358. package/kit-apple/Sources/NativeScriptKit/Core/js-libs.easysax.easysax.swift +1388 -0
  1359. package/kit-apple/Sources/NativeScriptKit/Core/kit-index.json +30808 -0
  1360. package/kit-apple/Sources/NativeScriptKit/Core/manifest.json +3383 -0
  1361. package/kit-apple/Sources/NativeScriptKit/Core/matrix.index.swift +151 -0
  1362. package/kit-apple/Sources/NativeScriptKit/Core/media-query-list.index.swift +468 -0
  1363. package/kit-apple/Sources/NativeScriptKit/Core/module-name-resolver.helpers.swift +57 -0
  1364. package/kit-apple/Sources/NativeScriptKit/Core/module-name-resolver.index.swift +220 -0
  1365. package/kit-apple/Sources/NativeScriptKit/Core/module-name-resolver.non-bundle-workflow-compat.swift +262 -0
  1366. package/kit-apple/Sources/NativeScriptKit/Core/module-name-resolver.qualifier-matcher.index.swift +330 -0
  1367. package/kit-apple/Sources/NativeScriptKit/Core/native-window.index.swift +16 -0
  1368. package/kit-apple/Sources/NativeScriptKit/Core/native-window.native-window-common.swift +730 -0
  1369. package/kit-apple/Sources/NativeScriptKit/Core/native-window.native-window-interfaces.swift +46 -0
  1370. package/kit-apple/Sources/NativeScriptKit/Core/native-window.native-window.ios.swift +521 -0
  1371. package/kit-apple/Sources/NativeScriptKit/Core/native-window.window-base.swift +298 -0
  1372. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.index.swift +16 -0
  1373. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.parse.swift +668 -0
  1374. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.stringify.swift +221 -0
  1375. package/kit-apple/Sources/NativeScriptKit/Core/npm.css-what.src.types.swift +62 -0
  1376. package/kit-apple/Sources/NativeScriptKit/Core/platform.common.swift +25 -0
  1377. package/kit-apple/Sources/NativeScriptKit/Core/platform.device.index.ios.swift +289 -0
  1378. package/kit-apple/Sources/NativeScriptKit/Core/platform.index.swift +16 -0
  1379. package/kit-apple/Sources/NativeScriptKit/Core/platform.screen.index.ios.swift +217 -0
  1380. package/kit-apple/Sources/NativeScriptKit/Core/profiling.index.swift +528 -0
  1381. package/kit-apple/Sources/NativeScriptKit/Core/text.formatted-string.swift +16 -0
  1382. package/kit-apple/Sources/NativeScriptKit/Core/text.index.ios.swift +25 -0
  1383. package/kit-apple/Sources/NativeScriptKit/Core/text.span.swift +16 -0
  1384. package/kit-apple/Sources/NativeScriptKit/Core/text.text-common.swift +309 -0
  1385. package/kit-apple/Sources/NativeScriptKit/Core/trace.index.swift +513 -0
  1386. package/kit-apple/Sources/NativeScriptKit/Core/ui.action-bar.action-bar-common.swift +1270 -0
  1387. package/kit-apple/Sources/NativeScriptKit/Core/ui.action-bar.index.ios.swift +1480 -0
  1388. package/kit-apple/Sources/NativeScriptKit/Core/ui.activity-indicator.activity-indicator-common.swift +81 -0
  1389. package/kit-apple/Sources/NativeScriptKit/Core/ui.activity-indicator.index.ios.swift +175 -0
  1390. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.animation-common.swift +581 -0
  1391. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.animation-shared.swift +16 -0
  1392. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.animation-types.swift +16 -0
  1393. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.index.ios.swift +2204 -0
  1394. package/kit-apple/Sources/NativeScriptKit/Core/ui.animation.keyframe-animation.swift +1213 -0
  1395. package/kit-apple/Sources/NativeScriptKit/Core/ui.builder.binding-builder.swift +318 -0
  1396. package/kit-apple/Sources/NativeScriptKit/Core/ui.builder.component-builder.index.swift +387 -0
  1397. package/kit-apple/Sources/NativeScriptKit/Core/ui.builder.index.swift +2026 -0
  1398. package/kit-apple/Sources/NativeScriptKit/Core/ui.button.button-common.swift +75 -0
  1399. package/kit-apple/Sources/NativeScriptKit/Core/ui.button.index.ios.swift +614 -0
  1400. package/kit-apple/Sources/NativeScriptKit/Core/ui.content-view.index.swift +291 -0
  1401. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.bindable.bindable-expressions.swift +770 -0
  1402. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.bindable.bindable-resources.swift +30 -0
  1403. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.bindable.bindable-types.swift +16 -0
  1404. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.bindable.expression-parser.swift +5297 -0
  1405. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.bindable.index.swift +1376 -0
  1406. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.control-state-change.index.ios.swift +197 -0
  1407. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.properties.index.swift +3899 -0
  1408. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.properties.property-shared.swift +53 -0
  1409. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view-base.index.swift +3522 -0
  1410. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view-base.utils.swift +32 -0
  1411. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.index.ios.swift +3318 -0
  1412. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-common.swift +4347 -0
  1413. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-helper.index.ios.swift +1417 -0
  1414. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-helper.view-helper-common.swift +337 -0
  1415. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-helper.view-helper-shared.swift +16 -0
  1416. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-interfaces.swift +272 -0
  1417. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.weak-event-listener.index.swift +323 -0
  1418. package/kit-apple/Sources/NativeScriptKit/Core/ui.date-picker.date-picker-common.swift +335 -0
  1419. package/kit-apple/Sources/NativeScriptKit/Core/ui.date-picker.index.ios.swift +609 -0
  1420. package/kit-apple/Sources/NativeScriptKit/Core/ui.dialogs.dialogs-common.swift +486 -0
  1421. package/kit-apple/Sources/NativeScriptKit/Core/ui.dialogs.index.ios.swift +677 -0
  1422. package/kit-apple/Sources/NativeScriptKit/Core/ui.editable-text-base.editable-text-base-common.swift +378 -0
  1423. package/kit-apple/Sources/NativeScriptKit/Core/ui.editable-text-base.index.ios.swift +512 -0
  1424. package/kit-apple/Sources/NativeScriptKit/Core/ui.embedding.index.ios.swift +25 -0
  1425. package/kit-apple/Sources/NativeScriptKit/Core/ui.enums.enums.swift +16 -0
  1426. package/kit-apple/Sources/NativeScriptKit/Core/ui.enums.index.swift +16 -0
  1427. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.fragment.ios.swift +26 -0
  1428. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.fragment.transitions.types.swift +23 -0
  1429. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-common.swift +1526 -0
  1430. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-constants.swift +21 -0
  1431. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-helpers.swift +40 -0
  1432. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-interfaces.swift +26 -0
  1433. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.frame-stack.swift +138 -0
  1434. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.index.ios.swift +1794 -0
  1435. package/kit-apple/Sources/NativeScriptKit/Core/ui.gestures.gestures-common.swift +269 -0
  1436. package/kit-apple/Sources/NativeScriptKit/Core/ui.gestures.gestures-types.swift +77 -0
  1437. package/kit-apple/Sources/NativeScriptKit/Core/ui.gestures.index.ios.swift +1453 -0
  1438. package/kit-apple/Sources/NativeScriptKit/Core/ui.gestures.touch-manager.swift +451 -0
  1439. package/kit-apple/Sources/NativeScriptKit/Core/ui.html-view.html-view-common.swift +106 -0
  1440. package/kit-apple/Sources/NativeScriptKit/Core/ui.html-view.index.ios.swift +301 -0
  1441. package/kit-apple/Sources/NativeScriptKit/Core/ui.image-cache.image-cache-common.swift +479 -0
  1442. package/kit-apple/Sources/NativeScriptKit/Core/ui.image-cache.index.ios.swift +232 -0
  1443. package/kit-apple/Sources/NativeScriptKit/Core/ui.image.image-common.swift +399 -0
  1444. package/kit-apple/Sources/NativeScriptKit/Core/ui.image.index.ios.swift +499 -0
  1445. package/kit-apple/Sources/NativeScriptKit/Core/ui.image.symbol-effects-common.swift +150 -0
  1446. package/kit-apple/Sources/NativeScriptKit/Core/ui.image.symbol-effects.ios.swift +148 -0
  1447. package/kit-apple/Sources/NativeScriptKit/Core/ui.label.index.ios.swift +483 -0
  1448. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.absolute-layout.absolute-layout-common.swift +172 -0
  1449. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.absolute-layout.index.ios.swift +189 -0
  1450. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.dock-layout.dock-layout-common.swift +157 -0
  1451. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.dock-layout.index.ios.swift +264 -0
  1452. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.flexbox-layout.flexbox-layout-common.swift +1028 -0
  1453. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.flexbox-layout.index.ios.swift +3235 -0
  1454. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.grid-layout.grid-layout-common.swift +1014 -0
  1455. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.grid-layout.index.ios.swift +2435 -0
  1456. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.index.swift +16 -0
  1457. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.layout-base-common.swift +591 -0
  1458. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.layout-base.ios.swift +135 -0
  1459. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass-container.index.ios.swift +364 -0
  1460. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass-container.liquid-glass-container-common.swift +49 -0
  1461. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass.index.ios.swift +238 -0
  1462. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.liquid-glass.liquid-glass-common.swift +34 -0
  1463. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.root-layout.index.ios.swift +347 -0
  1464. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.root-layout.root-layout-common.swift +964 -0
  1465. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.root-layout.root-layout-stack.swift +59 -0
  1466. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.stack-layout.index.ios.swift +350 -0
  1467. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.stack-layout.stack-layout-common.swift +72 -0
  1468. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.wrap-layout.index.ios.swift +357 -0
  1469. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.wrap-layout.wrap-layout-common.swift +188 -0
  1470. package/kit-apple/Sources/NativeScriptKit/Core/ui.list-picker.index.ios.swift +374 -0
  1471. package/kit-apple/Sources/NativeScriptKit/Core/ui.list-picker.list-picker-common.swift +252 -0
  1472. package/kit-apple/Sources/NativeScriptKit/Core/ui.list-view.index.ios.swift +2611 -0
  1473. package/kit-apple/Sources/NativeScriptKit/Core/ui.list-view.list-view-common.swift +950 -0
  1474. package/kit-apple/Sources/NativeScriptKit/Core/ui.page.events.swift +23 -0
  1475. package/kit-apple/Sources/NativeScriptKit/Core/ui.page.index.ios.swift +1340 -0
  1476. package/kit-apple/Sources/NativeScriptKit/Core/ui.page.page-common.swift +520 -0
  1477. package/kit-apple/Sources/NativeScriptKit/Core/ui.placeholder.index.swift +63 -0
  1478. package/kit-apple/Sources/NativeScriptKit/Core/ui.placeholder.placeholder-common.swift +16 -0
  1479. package/kit-apple/Sources/NativeScriptKit/Core/ui.progress.index.ios.swift +173 -0
  1480. package/kit-apple/Sources/NativeScriptKit/Core/ui.progress.progress-common.swift +111 -0
  1481. package/kit-apple/Sources/NativeScriptKit/Core/ui.proxy-view-container.index.swift +497 -0
  1482. package/kit-apple/Sources/NativeScriptKit/Core/ui.repeater.index.swift +535 -0
  1483. package/kit-apple/Sources/NativeScriptKit/Core/ui.scroll-view.index.ios.swift +699 -0
  1484. package/kit-apple/Sources/NativeScriptKit/Core/ui.scroll-view.scroll-view-common.swift +414 -0
  1485. package/kit-apple/Sources/NativeScriptKit/Core/ui.search-bar.index.ios.swift +609 -0
  1486. package/kit-apple/Sources/NativeScriptKit/Core/ui.search-bar.search-bar-common.swift +162 -0
  1487. package/kit-apple/Sources/NativeScriptKit/Core/ui.segmented-bar.index.ios.swift +470 -0
  1488. package/kit-apple/Sources/NativeScriptKit/Core/ui.segmented-bar.segmented-bar-common.swift +448 -0
  1489. package/kit-apple/Sources/NativeScriptKit/Core/ui.slider.index.ios.swift +593 -0
  1490. package/kit-apple/Sources/NativeScriptKit/Core/ui.slider.slider-common.swift +211 -0
  1491. package/kit-apple/Sources/NativeScriptKit/Core/ui.split-view.index.ios.swift +1459 -0
  1492. package/kit-apple/Sources/NativeScriptKit/Core/ui.split-view.split-view-common.swift +410 -0
  1493. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.background-common.swift +809 -0
  1494. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.background.ios.swift +2290 -0
  1495. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.box-shadow.swift +138 -0
  1496. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.clip-path-function.swift +198 -0
  1497. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.converters.swift +105 -0
  1498. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-animation-parser.swift +493 -0
  1499. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-selector.swift +4016 -0
  1500. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-shadow.swift +48 -0
  1501. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-stroke.swift +41 -0
  1502. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-transform.swift +406 -0
  1503. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.css-utils.swift +297 -0
  1504. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.font-common.swift +477 -0
  1505. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.font-interfaces.swift +16 -0
  1506. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.font.ios.swift +416 -0
  1507. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.length-shared.swift +343 -0
  1508. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.linear-gradient.swift +162 -0
  1509. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style-properties.swift +2524 -0
  1510. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style-scope.swift +3330 -0
  1511. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.style.index.swift +905 -0
  1512. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.styling-profile.swift +16 -0
  1513. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.styling-shared.swift +16 -0
  1514. package/kit-apple/Sources/NativeScriptKit/Core/ui.switch.index.ios.swift +508 -0
  1515. package/kit-apple/Sources/NativeScriptKit/Core/ui.switch.switch-common.swift +143 -0
  1516. package/kit-apple/Sources/NativeScriptKit/Core/ui.tab-view.index.ios.swift +2284 -0
  1517. package/kit-apple/Sources/NativeScriptKit/Core/ui.tab-view.tab-view-common.swift +985 -0
  1518. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.formatted-string.swift +801 -0
  1519. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.index.ios.swift +1264 -0
  1520. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.span.swift +476 -0
  1521. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-base.text-base-common.swift +1047 -0
  1522. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-field.index.ios.swift +912 -0
  1523. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-field.text-field-common.swift +121 -0
  1524. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.index.ios.swift +1030 -0
  1525. package/kit-apple/Sources/NativeScriptKit/Core/ui.text-view.text-view-common.swift +138 -0
  1526. package/kit-apple/Sources/NativeScriptKit/Core/ui.time-picker.index.ios.swift +473 -0
  1527. package/kit-apple/Sources/NativeScriptKit/Core/ui.time-picker.time-picker-common.swift +536 -0
  1528. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.fade-transition.ios.swift +265 -0
  1529. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.index.ios.swift +159 -0
  1530. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.modal-transition.ios.swift +635 -0
  1531. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.page-transition.ios.swift +1167 -0
  1532. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.shared-transition-helper.ios.swift +3673 -0
  1533. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.shared-transition.swift +492 -0
  1534. package/kit-apple/Sources/NativeScriptKit/Core/ui.transition.slide-transition.ios.swift +328 -0
  1535. package/kit-apple/Sources/NativeScriptKit/Core/ui.utils.ios.swift +132 -0
  1536. package/kit-apple/Sources/NativeScriptKit/Core/ui.web-view.index.ios.swift +827 -0
  1537. package/kit-apple/Sources/NativeScriptKit/Core/ui.web-view.web-view-common.swift +206 -0
  1538. package/kit-apple/Sources/NativeScriptKit/Core/ui.web-view.web-view-interfaces.swift +16 -0
  1539. package/kit-apple/Sources/NativeScriptKit/Core/utils.animation-helpers.swift +84 -0
  1540. package/kit-apple/Sources/NativeScriptKit/Core/utils.common.swift +278 -0
  1541. package/kit-apple/Sources/NativeScriptKit/Core/utils.constants.ios.swift +33 -0
  1542. package/kit-apple/Sources/NativeScriptKit/Core/utils.debug-source.swift +271 -0
  1543. package/kit-apple/Sources/NativeScriptKit/Core/utils.debug.swift +20 -0
  1544. package/kit-apple/Sources/NativeScriptKit/Core/utils.index.ios.swift +205 -0
  1545. package/kit-apple/Sources/NativeScriptKit/Core/utils.layout-helper.index.ios.swift +131 -0
  1546. package/kit-apple/Sources/NativeScriptKit/Core/utils.layout-helper.layout-helper-common.swift +87 -0
  1547. package/kit-apple/Sources/NativeScriptKit/Core/utils.layout-helper.layout-helper-shared.swift +28 -0
  1548. package/kit-apple/Sources/NativeScriptKit/Core/utils.lazy.swift +39 -0
  1549. package/kit-apple/Sources/NativeScriptKit/Core/utils.macrotask-scheduler.swift +71 -0
  1550. package/kit-apple/Sources/NativeScriptKit/Core/utils.mainthread-helper.ios.swift +52 -0
  1551. package/kit-apple/Sources/NativeScriptKit/Core/utils.module-merge.swift +27 -0
  1552. package/kit-apple/Sources/NativeScriptKit/Core/utils.native-helper.ios.swift +734 -0
  1553. package/kit-apple/Sources/NativeScriptKit/Core/utils.number-utils.swift +79 -0
  1554. package/kit-apple/Sources/NativeScriptKit/Core/utils.platform-check.swift +25 -0
  1555. package/kit-apple/Sources/NativeScriptKit/Core/utils.shared.swift +84 -0
  1556. package/kit-apple/Sources/NativeScriptKit/Core/utils.types.swift +308 -0
  1557. package/kit-apple/Sources/NativeScriptKit/Core/utils.utils-shared.swift +31 -0
  1558. package/kit-apple/Sources/NativeScriptKit/Core/xhr.index.swift +1726 -0
  1559. package/kit-apple/Sources/NativeScriptKit/Core/xml.index.swift +775 -0
  1560. package/kit-apple/Sources/NativeScriptKit/CoreBridge.swift +388 -0
  1561. package/kit-apple/Sources/NativeScriptKit/CoreConnectivity.swift +46 -0
  1562. package/kit-apple/Sources/NativeScriptKit/CoreLifetimes.swift +15 -0
  1563. package/kit-apple/Sources/NativeScriptKit/CorePackages.swift +59 -0
  1564. package/kit-apple/Sources/NativeScriptKit/JS.swift +94 -0
  1565. package/kit-apple/Sources/NativeScriptKit/Modal.swift +65 -0
  1566. package/kit-apple/Sources/NativeScriptKit/Probe.swift +97 -0
  1567. package/kit-apple/Sources/NativeScriptKit/Regions.swift +291 -0
  1568. package/kit-apple/Sources/NativeScriptKit/Runtime/AbsentModules.swift +78 -0
  1569. package/kit-apple/Sources/NativeScriptKit/Runtime/Array.swift +1693 -0
  1570. package/kit-apple/Sources/NativeScriptKit/Runtime/ArrayLike.swift +859 -0
  1571. package/kit-apple/Sources/NativeScriptKit/Runtime/BigInt.swift +338 -0
  1572. package/kit-apple/Sources/NativeScriptKit/Runtime/BuiltinValues.swift +45 -0
  1573. package/kit-apple/Sources/NativeScriptKit/Runtime/Collections.swift +609 -0
  1574. package/kit-apple/Sources/NativeScriptKit/Runtime/Date.swift +269 -0
  1575. package/kit-apple/Sources/NativeScriptKit/Runtime/Dynamic.swift +474 -0
  1576. package/kit-apple/Sources/NativeScriptKit/Runtime/ES2023.swift +105 -0
  1577. package/kit-apple/Sources/NativeScriptKit/Runtime/Errors.swift +402 -0
  1578. package/kit-apple/Sources/NativeScriptKit/Runtime/Functions.swift +372 -0
  1579. package/kit-apple/Sources/NativeScriptKit/Runtime/Inspect.swift +762 -0
  1580. package/kit-apple/Sources/NativeScriptKit/Runtime/Interop.swift +42 -0
  1581. package/kit-apple/Sources/NativeScriptKit/Runtime/Intl.swift +799 -0
  1582. package/kit-apple/Sources/NativeScriptKit/Runtime/Iterators.swift +898 -0
  1583. package/kit-apple/Sources/NativeScriptKit/Runtime/JSON.swift +874 -0
  1584. package/kit-apple/Sources/NativeScriptKit/Runtime/Lowering.swift +593 -0
  1585. package/kit-apple/Sources/NativeScriptKit/Runtime/Native.swift +819 -0
  1586. package/kit-apple/Sources/NativeScriptKit/Runtime/NativeStack.swift +66 -0
  1587. package/kit-apple/Sources/NativeScriptKit/Runtime/Number.swift +599 -0
  1588. package/kit-apple/Sources/NativeScriptKit/Runtime/Promise.swift +810 -0
  1589. package/kit-apple/Sources/NativeScriptKit/Runtime/Prototypes.swift +471 -0
  1590. package/kit-apple/Sources/NativeScriptKit/Runtime/Reactive.swift +34 -0
  1591. package/kit-apple/Sources/NativeScriptKit/Runtime/Record.swift +59 -0
  1592. package/kit-apple/Sources/NativeScriptKit/Runtime/RegExp.swift +576 -0
  1593. package/kit-apple/Sources/NativeScriptKit/Runtime/RegExpEngine.swift +1918 -0
  1594. package/kit-apple/Sources/NativeScriptKit/Runtime/Stack.swift +20 -0
  1595. package/kit-apple/Sources/NativeScriptKit/Runtime/StringUTF16.swift +179 -0
  1596. package/kit-apple/Sources/NativeScriptKit/Runtime/Symbol.swift +142 -0
  1597. package/kit-apple/Sources/NativeScriptKit/Runtime/Threads.swift +275 -0
  1598. package/kit-apple/Sources/NativeScriptKit/Runtime/Timers.swift +240 -0
  1599. package/kit-apple/Sources/NativeScriptKit/Runtime/TypedArrays.swift +996 -0
  1600. package/kit-apple/Sources/NativeScriptKit/Runtime/URI.swift +94 -0
  1601. package/kit-apple/Sources/NativeScriptKit/Runtime/Values.swift +2069 -0
  1602. package/kit-apple/Sources/NativeScriptKit/Runtime/Views.swift +97 -0
  1603. package/kit-apple/Sources/NativeScriptKit/Runtime/Weak.swift +135 -0
  1604. package/kit-apple/Sources/NativeScriptKit/Runtime/WinterTC.swift +484 -0
  1605. package/kit-apple/Sources/NativeScriptKit/Signals.swift +952 -0
  1606. package/kit-apple/Sources/NativeScriptKit/UncaughtErrors.swift +37 -0
  1607. package/package.json +94 -4
  1608. package/verify/ui-driver/Host/App.swift +7 -0
  1609. package/verify/ui-driver/Tests/Driver.swift +54 -0
  1610. package/verify/ui-driver/project.yml +35 -0
@@ -0,0 +1,2069 @@
1
+ import Foundation
2
+ #if canImport(UIKit)
3
+ import UIKit
4
+ #endif
5
+
6
+ // Values as translated TypeScript holds them: `any`/`unknown` is `Any?`, an empty
7
+ // `Any?` is `undefined`, `jsNull` is `null`, numbers are `Double`, objects are
8
+ // classes compared by identity.
9
+
10
+ /// JavaScript `null`.
11
+ public final class JSNull: Sendable, CustomStringConvertible {
12
+ nonisolated deinit {}
13
+ fileprivate init() {}
14
+ public var description: String { "null" }
15
+ }
16
+
17
+ /// The JavaScript `null` value. `undefined` is `nil`.
18
+ public let jsNull = JSNull()
19
+
20
+ /// A JavaScript function value as dynamic code stores and calls it.
21
+ public typealias JSFunction = ([Any?]) throws -> Any?
22
+
23
+ /// An object whose properties dynamic code reaches by name (`o[key]`, JSON, `console.log`):
24
+ /// plain objects (`JSObject`) and the classes generated for TypeScript classes and interfaces.
25
+ /// A nil `jsClassName` prints as a plain object (`{ a: 1 }`), otherwise as `Name { a: 1 }`.
26
+ public protocol JSDynamic: AnyObject {
27
+ subscript(jsKey key: String) -> Any? { get set }
28
+ var jsKeys: [String] { get }
29
+ var jsClassName: String? { get }
30
+ }
31
+
32
+ /// An optional field read untyped: null where the object holds the key as set to null (`jsNulls`), else its value.
33
+ @inline(__always)
34
+ public func jsNullable(_ value: Any?, _ nulls: Set<String>?, _ key: String) -> Any? {
35
+ if value == nil, let nulls, nulls.contains(key) { return jsNull }
36
+ return value
37
+ }
38
+
39
+ /// A value typed `T | null`, held as an optional, read untyped: nil is null.
40
+ @inline(__always)
41
+ public func jsNulled(_ value: Any?) -> Any? { value ?? jsNull }
42
+
43
+ /// An element or map entry of `T | null` values read untyped: a missing one is undefined, a present nil null.
44
+ @inline(__always)
45
+ public func jsNulledEntry<V>(_ entry: V??) -> Any? {
46
+ guard let value = entry else { return nil }
47
+ return jsNulled(value)
48
+ }
49
+
50
+ /// A class's instance whose keys a write can make out of its fields' declared order (assign mode's fields without an
51
+ /// initializer, a field deleted and written again): `jsOrder` is nil while the keys run in `jsFieldKeys`' order.
52
+ public protocol JSKeyOrdered: AnyObject {
53
+ var jsOrder: [String]? { get set }
54
+ var jsFieldKeys: [String] { get }
55
+ /// The keys script gave the object (its expando's), which `jsFieldKeys`' order puts after the fields.
56
+ var jsAddedKeys: [String] { get }
57
+ }
58
+
59
+ extension JSKeyOrdered {
60
+ public var jsAddedKeys: [String] { [] }
61
+
62
+ /// Whether a key made now needs noting: the fields' order alone no longer places it last.
63
+ public var jsKeysNoted: Bool { jsOrder != nil || !jsAddedKeys.isEmpty }
64
+
65
+ /// `key` made just now: last among the keys. `early`: made before its class's level of the constructor started, so
66
+ /// before keys its static place is after.
67
+ public func jsKeyMade(_ key: String, early: Bool = false) {
68
+ let keys = jsOrderedKeys(jsOrder, jsFieldKeys + jsAddedKeys)
69
+ if jsOrder == nil && !early && keys.last == key { return }
70
+ jsOrder = keys.filter { $0 != key } + [key]
71
+ }
72
+ }
73
+
74
+ /// A library class's instance whose fields declared without a value are keys from their first write: a bit each tells
75
+ /// which are, and `jsMade` is nil until one is written, then lists every key made since, in the order made (such a field,
76
+ /// a later constructor level's keys, a key script adds).
77
+ public protocol JSKeysMade: AnyObject {
78
+ var jsMade: [String]? { get set }
79
+ }
80
+
81
+ /// A field declared without a value written for the first time (its `bit` unset): its key is made.
82
+ public func jsMadeNote(_ bits: inout UInt64, _ made: inout [String]?, _ bit: UInt64, _ key: String) {
83
+ bits |= bit
84
+ if made == nil {
85
+ var keys: [String] = []
86
+ keys.reserveCapacity(4)
87
+ made = keys
88
+ }
89
+ made?.append(key)
90
+ }
91
+
92
+ /// A key made anew once the record began (a key script adds, maybe again after a delete): last.
93
+ public func jsMadeAgain(_ made: inout [String]?, _ key: String) {
94
+ guard made != nil else { return }
95
+ made?.removeAll { $0 == key }
96
+ made?.append(key)
97
+ }
98
+
99
+ /// A constructor level's keys, made as it starts: last, where a base level began the record; a key made already keeps its place.
100
+ public func jsMadeLevel(_ made: inout [String]?, _ keys: [String]) {
101
+ guard made != nil else { return }
102
+ for k in keys where !made!.contains(k) { made!.append(k) }
103
+ }
104
+
105
+ /// An object's present keys `keys` (in their static order) with those its record `made` notes last, in the record's order.
106
+ public func jsMadeKeys(_ made: [String]?, _ keys: [String]) -> [String] {
107
+ guard let made else { return keys }
108
+ return keys.filter { !made.contains($0) } + made.filter(keys.contains)
109
+ }
110
+
111
+ /// An object's present field keys `keys` in the order `order` notes, any it lacks after.
112
+ public func jsOrderedKeys(_ order: [String]?, _ keys: [String]) -> [String] {
113
+ guard let order else { return keys }
114
+ return order.filter(keys.contains) + keys.filter { !order.contains($0) }
115
+ }
116
+
117
+ /// An optional field written untyped: whether it now holds null rather than undefined.
118
+ @inline(__always)
119
+ public func jsNoteNull(_ nulls: inout Set<String>?, _ key: String, _ value: Any?) {
120
+ if value is JSNull { nulls = (nulls ?? []).union([key]) } else if nulls != nil { nulls!.remove(key) }
121
+ }
122
+
123
+ /// A string, number or boolean field written untyped, whose storage can only hold its zero: whether it now holds null
124
+ /// (`jsNulls`) or undefined (`jsUnset`).
125
+ @inline(__always)
126
+ public func jsNoteNullish(_ nulls: inout Set<String>?, _ unset: inout Set<String>?, _ key: String, _ value: Any?) {
127
+ jsNoteNull(&nulls, key, value)
128
+ if jsIsNullish(value) && !(value is JSNull) { unset = (unset ?? []).union([key]) } else if unset != nil { unset!.remove(key) }
129
+ }
130
+
131
+ /// Such a field read untyped: the null or undefined it notes, else its value.
132
+ @inline(__always)
133
+ public func jsNotedNullish(_ value: Any?, _ nulls: Set<String>?, _ unset: Set<String>?, _ key: String) -> Any? {
134
+ if let nulls, nulls.contains(key) { return jsNull }
135
+ if let unset, unset.contains(key) { return nil }
136
+ return value
137
+ }
138
+
139
+ /// The keys of `object` among `keys` that hold null, for a typed object read from it.
140
+ public func jsNullKeys(_ object: Any?, _ keys: [String]) -> Set<String>? {
141
+ guard let dynamic = jsFlat(object) as? JSDynamic else { return nil }
142
+ let nulls = keys.filter { dynamic[jsKey: $0] is JSNull }
143
+ return nulls.isEmpty ? nil : Set(nulls)
144
+ }
145
+
146
+ /// The keys of `object` among `keys` that it holds as undefined, for a typed object read from it.
147
+ public func jsUnsetKeys(_ object: Any?, _ keys: [String]) -> Set<String>? {
148
+ guard let dynamic = jsFlat(object) as? JSDynamic else { return nil }
149
+ let own = dynamic.jsKeys
150
+ let unset = keys.filter { own.contains($0) && dynamic[jsKey: $0] == nil }
151
+ return unset.isEmpty ? nil : Set(unset)
152
+ }
153
+
154
+ /// An object literal's keys that hold null: `known` ones, and those of `values` (untyped values it was given) that are null.
155
+ public func jsNullKeysOf(_ known: [String], _ values: [(String, Any?)]) -> Set<String>? {
156
+ let nulls = known + values.filter { $0.1 is JSNull }.map { $0.0 }
157
+ return nulls.isEmpty ? nil : Set(nulls)
158
+ }
159
+
160
+ /// An object literal's optional fields given null or undefined, as its values run: the keys its shape notes (`jsNulls`, `jsUnset`).
161
+ public struct JSLiteralKeys {
162
+ public private(set) var nulls: Set<String>?
163
+ public private(set) var unset: Set<String>?
164
+
165
+ public init(nulls: Set<String>? = nil, unset: Set<String>? = nil) {
166
+ self.nulls = nulls
167
+ self.unset = unset
168
+ }
169
+
170
+ /// An untyped value, before it is converted to the field's type, which holds null and undefined both as nil.
171
+ @discardableResult
172
+ public mutating func untyped(_ key: String, _ value: Any?) -> Any? {
173
+ if value == nil { unset = (unset ?? []).union([key]) } else if value is JSNull { nulls = (nulls ?? []).union([key]) }
174
+ return value
175
+ }
176
+
177
+ /// A typed value, whose nil is undefined.
178
+ @discardableResult
179
+ public mutating func typed<V>(_ key: String, _ value: V?) -> V? {
180
+ if value == nil { unset = (unset ?? []).union([key]) }
181
+ return value
182
+ }
183
+
184
+ /// A typed value, whose nil is null.
185
+ public mutating func nulled<V>(_ key: String, _ value: V?) -> V? {
186
+ if value == nil { nulls = (nulls ?? []).union([key]) }
187
+ return value
188
+ }
189
+ }
190
+
191
+ /// A class with its own `toString()`, which JavaScript's string conversion calls.
192
+ public protocol JSStringConvertible {
193
+ func toString() throws -> String
194
+ }
195
+
196
+ /// A class with its own `valueOf()`, which ToPrimitive calls first unless a string is wanted.
197
+ public protocol JSValueOfConvertible: AnyObject {
198
+ func jsValueOf() throws -> Any?
199
+ }
200
+
201
+ // MARK: - Null and undefined told apart
202
+
203
+ /// A typed slot that may hold undefined, null or a `Wrapped`, where the program tells null from undefined (a
204
+ /// `T | null | undefined` whose code compares it with either). Its nil literal is undefined.
205
+ public enum JSNullish<Wrapped>: ExpressibleByNilLiteral {
206
+ case undefined
207
+ case null
208
+ case value(Wrapped)
209
+
210
+ public init(nilLiteral: ()) { self = .undefined }
211
+
212
+ /// A typed value whose nil is undefined.
213
+ public init(_ value: Wrapped?) { self = value.map { .value($0) } ?? .undefined }
214
+
215
+ /// A typed value whose nil is null.
216
+ public init(null value: Wrapped?) { self = value.map { .value($0) } ?? .null }
217
+
218
+ /// An untyped value: `jsNull` is null and nil undefined; another value not a `Wrapped` throws the TypeError.
219
+ public init(any value: Any?) throws {
220
+ guard let value = jsFlat(value) else { self = .undefined; return }
221
+ self = value is JSNull ? .null : .value(try jsCastPresent(value, Wrapped.self))
222
+ }
223
+
224
+ /// Its value, with null and undefined both nil.
225
+ @inline(__always)
226
+ public var optional: Wrapped? {
227
+ if case .value(let v) = self { return v }
228
+ return nil
229
+ }
230
+
231
+ /// Its value where a member of it is set: JavaScript's TypeError setting `key` when it is null or undefined.
232
+ @inline(__always)
233
+ public func present(setting key: String) throws -> Wrapped {
234
+ switch self {
235
+ case .value(let v): return v
236
+ case .null: throw JSException(JSTypeError("Cannot set properties of null (setting '\(key)')"))
237
+ case .undefined: throw jsCannotSet(key)
238
+ }
239
+ }
240
+
241
+ /// Its value where a typed use needs one: JavaScript's TypeError reading `key` when it is null or undefined.
242
+ @inline(__always)
243
+ public func present(_ key: String) throws -> Wrapped {
244
+ switch self {
245
+ case .value(let v): return v
246
+ case .null: throw jsCannotRead(key, true)
247
+ case .undefined: throw jsCannotRead(key, false)
248
+ }
249
+ }
250
+
251
+ /// As script holds it: null is `jsNull`, undefined nil.
252
+ public var jsAny: Any? {
253
+ switch self {
254
+ case .undefined: return nil
255
+ case .null: return jsNull
256
+ case .value(let v): return v
257
+ }
258
+ }
259
+ }
260
+
261
+ /// Strict equality, as `indexOf`, `includes` and a Set's or Map's keys compare: null is only null, undefined only undefined.
262
+ extension JSNullish: Equatable where Wrapped: Equatable {}
263
+ extension JSNullish: Hashable where Wrapped: Hashable {}
264
+
265
+ /// A `JSNullish` of any `Wrapped`, as code reading values dynamically (JSON, console, an untyped read) sees it.
266
+ public protocol JSNullishValue {
267
+ var jsAny: Any? { get }
268
+ /// An untyped value as this type; nil where a present value isn't a `Wrapped`.
269
+ static func jsNullish(_ value: Any?) -> Self?
270
+ }
271
+
272
+ extension JSNullish: JSNullishValue {
273
+ public static func jsNullish(_ value: Any?) -> JSNullish? {
274
+ guard let value = jsFlat(value) else { return .undefined }
275
+ if value is JSNull { return .null }
276
+ return jsConverted(value, to: Wrapped.self).map { .value($0) }
277
+ }
278
+ }
279
+
280
+ // MARK: - Optionals inside Any
281
+
282
+ protocol JSOptionalProtocol {
283
+ static var jsNone: Any { get }
284
+ }
285
+
286
+ extension Optional: JSOptionalProtocol {
287
+ static var jsNone: Any { Optional<Wrapped>.none as Any }
288
+ }
289
+
290
+ /// `value` with nested optionals collapsed: a generic `T?` holding nil, boxed in `Any?`, is undefined.
291
+ @inline(__always)
292
+ public func jsFlat(_ value: Any?) -> Any? {
293
+ guard let value else { return nil }
294
+ switch jsTypeKind(value) {
295
+ case .optional:
296
+ // A cast to `Any?` unwraps one level of any optional without looking up its type's conformance to a protocol.
297
+ if let unwrapped = jsDynamicCast(value, to: Any?.self) { return jsFlat(unwrapped) }
298
+ return value
299
+ case .enum:
300
+ // A `JSNullish<Any>` may hold its value as an optional.
301
+ if let nullish = value as? JSNullishValue { return jsFlat(nullish.jsAny) }
302
+ return value
303
+ default:
304
+ return value
305
+ }
306
+ }
307
+
308
+ /// `value as? T` decided at run time, where `T` (`Any?`) makes the cast one the compiler would call trivial.
309
+ @inline(__always)
310
+ func jsDynamicCast<T>(_ value: Any, to _: T.Type) -> T? { value as? T }
311
+
312
+ // MARK: - What a value is, read from its type's metadata
313
+
314
+ /// The kind word that starts every type's metadata (the Swift ABI's `MetadataKind`). Hot paths read it
315
+ /// before casting: a cast to a protocol or a bridged type looks up conformances, slowly for each new type.
316
+ enum JSTypeKind: UInt {
317
+ case swiftClass = 0
318
+ case `struct` = 0x200
319
+ case `enum` = 0x201
320
+ case optional = 0x202
321
+ case tuple = 0x301
322
+ case function = 0x302
323
+ case metatype = 0x304
324
+ case objCClass = 0x305
325
+ case existentialMetatype = 0x306
326
+ case other = 0xFFFF
327
+ }
328
+
329
+ @inline(__always)
330
+ func jsTypeKind(_ value: Any) -> JSTypeKind {
331
+ let word = unsafeBitCast(type(of: value), to: UnsafePointer<UInt>.self).pointee
332
+ // A class's metadata starts with its isa pointer, never a small kind number.
333
+ if word > 0x7FF { return .swiftClass }
334
+ return JSTypeKind(rawValue: word) ?? .other
335
+ }
336
+
337
+ /// A class (or other type) held as a value. Swift casts a class object to a protocol its instances
338
+ /// take, so it must be told apart before such a cast calls an instance member on the class itself.
339
+ @inline(__always)
340
+ func jsIsClassObject(_ value: Any) -> Bool {
341
+ let kind = jsTypeKind(value)
342
+ return kind == .metatype || kind == .existentialMetatype
343
+ }
344
+
345
+ /// An object no cast to a Swift number, string or boolean unwraps: a Swift object, or an
346
+ /// Objective-C one that is not an NSNumber, an NSString or a boxed Swift value.
347
+ func jsIsOpaqueObject(_ value: Any) -> Bool {
348
+ switch jsTypeKind(value) {
349
+ case .swiftClass: return jsClassShape(of: value)?.opaque ?? false
350
+ case .objCClass: return jsClassShape(value as AnyObject).opaque
351
+ default: return false
352
+ }
353
+ }
354
+
355
+ /// `jsIsOpaqueObject` of an instance of a class, which its class alone decides.
356
+ private func jsInstanceIsOpaque(_ value: Any) -> Bool {
357
+ switch jsTypeKind(value) {
358
+ case .swiftClass: if jsAsNSObject(value) == nil { return true }
359
+ case .objCClass: if !(value is NSObject) { return false }
360
+ default: return false
361
+ }
362
+ if value is NSNumber || value is NSString { return false }
363
+ return jsSwiftValueClass.map { object_getClass(value as AnyObject) !== $0 } ?? true
364
+ }
365
+
366
+ private let jsSwiftValueClass: AnyClass? = NSClassFromString("__SwiftValue")
367
+
368
+ /// `value as? NSObject`, which for an instance of a Swift class first looks for a bridging conformance, slowly for each new class.
369
+ func jsAsNSObject(_ value: Any) -> NSObject? {
370
+ guard jsTypeKind(value) == .swiftClass else { return value as? NSObject }
371
+ let object = value as AnyObject
372
+ var cls: AnyClass? = object_getClass(object)
373
+ while let current = cls {
374
+ if current === NSObject.self { return unsafeDowncast(object, to: NSObject.self) }
375
+ cls = class_getSuperclass(current)
376
+ }
377
+ return nil
378
+ }
379
+
380
+ /// Whether an Objective-C object's class takes none of the runtime's protocols `jsGet` tries, once per class.
381
+ func jsIsNativeOnly(_ object: NSObject) -> Bool {
382
+ let cls: AnyClass = type(of: object)
383
+ let id = ObjectIdentifier(cls)
384
+ jsNativeOnlyLock.lock()
385
+ defer { jsNativeOnlyLock.unlock() }
386
+ if let known = jsNativeOnlyClasses[id] { return known }
387
+ let only = !(cls is JSDynamic.Type || cls is JSArrayProtocol.Type || cls is JSMapProtocol.Type || cls is JSSetProtocol.Type || cls is JSThenable.Type)
388
+ jsNativeOnlyClasses[id] = only
389
+ return only
390
+ }
391
+
392
+ private var jsNativeOnlyClasses: [ObjectIdentifier: Bool] = [:]
393
+ private let jsNativeOnlyLock = NSLock()
394
+
395
+ /// The casts `jsGet`, `jsHasKey` and the conversions would make on an instance of a class, answered once per
396
+ /// class: each cast to a protocol costs a conformance lookup on every read.
397
+ struct JSClassShape {
398
+ /// `jsIsOpaqueObject`.
399
+ var opaque = false
400
+ var null = false
401
+ /// A JSDynamic that is no NSObject and no JSMootValue: what script holds as an object.
402
+ var script = false
403
+ var plainObject = false
404
+ var function = false
405
+ var hostObject = false
406
+ /// A JSExpando that is no JSError.
407
+ var expando = false
408
+ var valueOf = false
409
+ var toPrimitive = false
410
+ /// The class as the protocol type, cast once: `jsDynamic(_:as:)` reaches an instance through it without a cast per access.
411
+ var dynamicType: JSDynamic.Type?
412
+ var expandoType: JSExpando.Type?
413
+ /// An expando whose class is `jsSymbolPlain`: a symbol key it reads is its own property or its prototype chain's.
414
+ var symbolPlain = false
415
+ /// An expando whose class is `jsSymbolFieldsPlain`: no declared symbol-keyed fields match `subscript(jsKey:)` or `jsSymbolKeys`.
416
+ var symbolFieldsPlain = false
417
+ }
418
+
419
+ func jsClassShape(_ object: AnyObject) -> JSClassShape {
420
+ let cls: AnyClass = type(of: object)
421
+ if let known = jsKnownShape(ObjectIdentifier(cls)) { return known }
422
+ return jsMakeShape(object, cls)
423
+ }
424
+
425
+ /// The shapes of the classes read last, by their metadata's address: most reads repeat a few classes.
426
+ private struct JSRecentShape {
427
+ var id: ObjectIdentifier?
428
+ var shape: JSClassShape
429
+ }
430
+
431
+ private let jsRecentShapes: UnsafeMutablePointer<JSRecentShape> = {
432
+ let recent = UnsafeMutablePointer<JSRecentShape>.allocate(capacity: 32)
433
+ recent.initialize(repeating: JSRecentShape(id: nil, shape: JSClassShape()), count: 32)
434
+ return recent
435
+ }()
436
+
437
+ @inline(__always)
438
+ private func jsKnownShape(_ id: ObjectIdentifier) -> JSClassShape? {
439
+ let bits = UInt(bitPattern: id)
440
+ let slot = jsRecentShapes + Int((bits >> 4 ^ bits >> 9) & 31)
441
+ jsShapeLock.lock()
442
+ defer { jsShapeLock.unlock() }
443
+ if slot.pointee.id == id { return slot.pointee.shape }
444
+ guard let known = jsShapes[id] else { return nil }
445
+ slot.pointee = JSRecentShape(id: id, shape: known)
446
+ return known
447
+ }
448
+
449
+ @inline(never)
450
+ private func jsMakeShape(_ object: AnyObject, _ cls: AnyClass) -> JSClassShape {
451
+ let id = ObjectIdentifier(cls)
452
+ var shape = JSClassShape()
453
+ shape.opaque = jsInstanceIsOpaque(object)
454
+ shape.null = cls is JSNull.Type
455
+ if jsAsNSObject(object) == nil && !(cls is JSMootValue.Type) && cls is JSDynamic.Type {
456
+ shape.script = true
457
+ shape.plainObject = cls is JSObject.Type
458
+ shape.function = cls is JSFunctionObject.Type
459
+ shape.hostObject = cls is JSHostObject.Type
460
+ shape.expando = cls is JSExpando.Type && !(cls is JSError.Type)
461
+ shape.valueOf = cls is JSValueOfConvertible.Type
462
+ shape.toPrimitive = cls is JSToPrimitive.Type
463
+ shape.dynamicType = cls as? JSDynamic.Type
464
+ if shape.expando, let expando = cls as? JSExpando.Type {
465
+ shape.expandoType = expando
466
+ shape.symbolPlain = expando.jsSymbolPlain
467
+ shape.symbolFieldsPlain = expando.jsSymbolFieldsPlain
468
+ }
469
+ }
470
+ jsShapeLock.lock()
471
+ jsShapes[id] = shape
472
+ jsShapeLock.unlock()
473
+ return shape
474
+ }
475
+
476
+ /// The shape of a value's class where the value is an instance of a Swift class (an NSObject subclass included).
477
+ @inline(__always)
478
+ func jsClassShape(of value: Any) -> JSClassShape? {
479
+ let cls = type(of: value)
480
+ // A class's metadata starts with its isa pointer, never a small kind number.
481
+ guard unsafeBitCast(cls, to: UnsafePointer<UInt>.self).pointee > 0x7FF else { return nil }
482
+ if let known = jsKnownShape(ObjectIdentifier(cls)) { return known }
483
+ let object = jsClassInstance(value)
484
+ return jsMakeShape(object, type(of: object))
485
+ }
486
+
487
+ /// The instance an `Any` holds where its type is a Swift class (`jsClassShape(of:)` gave a shape), without the
488
+ /// bridging `as AnyObject` runs. The container's fourth word is the type it stores: a class's metadata means the first
489
+ /// word is the reference; any other (an existential of another protocol the class instance was held as, which can be
490
+ /// boxed out of line) is left to the bridging.
491
+ @inline(__always)
492
+ func jsClassInstance(_ value: Any) -> AnyObject {
493
+ withUnsafePointer(to: value) {
494
+ let container = UnsafeRawPointer($0)
495
+ let stored = container.load(fromByteOffset: 3 * MemoryLayout<UnsafeRawPointer>.size, as: UnsafePointer<UInt>.self)
496
+ return stored.pointee > 0x7FF ? container.load(as: AnyObject.self) : value as AnyObject
497
+ }
498
+ }
499
+
500
+ /// An instance as the protocol type its class's shape holds, without a dynamic cast.
501
+ @inline(__always)
502
+ func jsDynamic(_ object: AnyObject, as type: JSDynamic.Type) -> JSDynamic {
503
+ func open<T: JSDynamic>(_: T.Type) -> JSDynamic { unsafeDowncast(object, to: T.self) }
504
+ return open(type)
505
+ }
506
+
507
+ @inline(__always)
508
+ func jsExpando(_ object: AnyObject, as type: JSExpando.Type) -> JSExpando {
509
+ func open<T: JSExpando>(_: T.Type) -> JSExpando { unsafeDowncast(object, to: T.self) }
510
+ return open(type)
511
+ }
512
+
513
+ private var jsShapes: [ObjectIdentifier: JSClassShape] = [:]
514
+ private let jsShapeLock = JSUnfairLock()
515
+
516
+ /// An `os_unfair_lock` at a fixed address, for a cache read on every property access.
517
+ final class JSUnfairLock: @unchecked Sendable {
518
+ nonisolated(unsafe) private let lockPointer: UnsafeMutablePointer<os_unfair_lock>
519
+ nonisolated init() {
520
+ lockPointer = .allocate(capacity: 1)
521
+ lockPointer.initialize(to: os_unfair_lock())
522
+ }
523
+ nonisolated deinit { lockPointer.deallocate() }
524
+ @inline(__always) nonisolated func lock() { os_unfair_lock_lock(lockPointer) }
525
+ @inline(__always) nonisolated func unlock() { os_unfair_lock_unlock(lockPointer) }
526
+ }
527
+
528
+ /// `value` as `T`: undefined becomes nil for an optional `T`, and any value is `()` for `Void`.
529
+ public func jsConverted<T>(_ value: Any?, to type: T.Type = T.self) -> T? {
530
+ if T.self == Void.self { return (() as Any) as? T }
531
+ guard let value = jsFlat(value) else {
532
+ return (T.self as? JSOptionalProtocol.Type)?.jsNone as? T ?? (T.self as? JSNullishValue.Type)?.jsNullish(nil) as? T
533
+ }
534
+ if let same = value as? T { return same }
535
+ // An array's view where the array's own type is expected: that array.
536
+ if let view = value as? JSArrayProtocol, let source = view.jsViewSource as? T { return source }
537
+ // An untyped object where a typed one is expected (a generic `T` an interface stands for): read into it.
538
+ if let convertible = T.self as? JSObjectConvertible.Type { return convertible.init(jsObject: value) as? T }
539
+ if let nullish = T.self as? JSNullishValue.Type { return nullish.jsNullish(value) as? T }
540
+ return nil
541
+ }
542
+
543
+ /// A class for an object shape that reads an untyped object (`JSON.parse` output) into itself.
544
+ public protocol JSObjectConvertible: AnyObject {
545
+ init(jsObject: Any?)
546
+ }
547
+
548
+ func jsIsUndefined<T>(_ value: T) -> Bool {
549
+ guard T.self is JSOptionalProtocol.Type || T.self == Any.self else { return false }
550
+ return jsFlat(value) == nil
551
+ }
552
+
553
+ func jsIsObject(_ value: Any) -> Bool { type(of: value) is AnyClass }
554
+
555
+ /// A typed tuple (`[number, number, number]`), an array to script.
556
+ func jsIsTuple(_ value: Any) -> Bool { jsTypeKind(value) == .tuple }
557
+
558
+ /// Whether `value` is a Swift closure (a JavaScript function).
559
+ func jsIsFunction(_ value: Any) -> Bool {
560
+ if value is JSFunctionObject { return true }
561
+ guard jsTypeKind(value) == .function else { return false }
562
+ if value is JSFunction { return true }
563
+ let name = String(describing: type(of: value))
564
+ guard name.first == "(" else { return false }
565
+ var depth = 0
566
+ var index = name.startIndex
567
+ while index < name.endIndex {
568
+ let c = name[index]
569
+ if c == "(" || c == "<" || c == "[" { depth += 1 }
570
+ if c == ")" || c == ">" || c == "]" {
571
+ depth -= 1
572
+ if depth == 0 { break }
573
+ }
574
+ index = name.index(after: index)
575
+ }
576
+ guard index < name.endIndex else { return false }
577
+ let rest = name[name.index(after: index)...]
578
+ return rest.hasPrefix(" -> ") || rest.hasPrefix(" throws") || rest.hasPrefix(" async")
579
+ }
580
+
581
+ @inline(__always)
582
+ func jsNumeric(_ value: Any) -> Double? {
583
+ switch value {
584
+ case let d as Double: return d
585
+ case let i as Int: return Double(i)
586
+ case let f as Float: return Double(f)
587
+ case let i as Int32: return Double(i)
588
+ case let i as UInt32: return Double(i)
589
+ case let i as Int64: return Double(i)
590
+ default: return jsOtherNumeric(value)
591
+ }
592
+ }
593
+
594
+ /// The number representations native APIs give besides the common ones above. Read by kind first: casting a string
595
+ /// to an Objective-C class bridges it, and a protocol cast looks up conformances.
596
+ private func jsOtherNumeric(_ value: Any) -> Double? {
597
+ switch jsTypeKind(value) {
598
+ case .struct, .enum:
599
+ switch value {
600
+ case is String, is Bool: return nil
601
+ case let f as CGFloat: return Double(f)
602
+ case let i as UInt: return Double(i)
603
+ case let i as UInt64: return Double(i)
604
+ case let i as Int16: return Double(i)
605
+ case let i as UInt16: return Double(i)
606
+ case let i as Int8: return Double(i)
607
+ case let i as UInt8: return Double(i)
608
+ case let d as Decimal: return NSDecimalNumber(decimal: d).doubleValue
609
+ default:
610
+ // A native enum or option set: script sees its raw number.
611
+ if let raw = value as? any RawRepresentable, let n = raw.rawValue as? any BinaryInteger { return Double(n) }
612
+ return nil
613
+ }
614
+ case .objCClass:
615
+ guard let n = value as? NSNumber, CFGetTypeID(n) != CFBooleanGetTypeID() else { return nil }
616
+ return n.doubleValue
617
+ default:
618
+ return nil
619
+ }
620
+ }
621
+
622
+ // MARK: - Strings compared as JavaScript compares them
623
+
624
+ /// `a === b` for strings: equal code units (Swift's `==` also equates canonically equivalent strings).
625
+ @inlinable public func jsStringEquals(_ a: String, _ b: String) -> Bool {
626
+ let x = a.utf8, y = b.utf8
627
+ let count = x.count
628
+ guard count == y.count else { return false }
629
+ if let same = x.withContiguousStorageIfAvailable({ p in y.withContiguousStorageIfAvailable { q in count == 0 || memcmp(p.baseAddress!, q.baseAddress!, count) == 0 } }), let same { return same }
630
+ return x.elementsEqual(y)
631
+ }
632
+
633
+ public func jsStringEquals(_ a: String?, _ b: String?) -> Bool {
634
+ guard let a, let b else { return a == nil && b == nil }
635
+ return jsStringEquals(a, b)
636
+ }
637
+
638
+ /// A `case "literal":` of a string `switch` matches as `===` does.
639
+ @inlinable public func ~= (pattern: String, value: String) -> Bool { jsStringEquals(pattern, value) }
640
+
641
+ /// `a < b` for strings: UTF-16 code unit order.
642
+ public func jsStringLess(_ a: String, _ b: String) -> Bool { jsCompareUnits(a, b) < 0 }
643
+
644
+ /// A property or collection key hashed and compared by code units.
645
+ struct JSPropertyKey: Hashable {
646
+ let string: String
647
+ init(_ string: String) { self.string = string }
648
+
649
+ static func == (a: JSPropertyKey, b: JSPropertyKey) -> Bool { jsStringEquals(a.string, b.string) }
650
+
651
+ /// The bytes folded into one word first (FNV-1a), which the seeded Hasher then mixes once: hashing every
652
+ /// byte through Hasher made each property lookup on a JavaScript object about twice as slow.
653
+ func hash(into hasher: inout Hasher) {
654
+ var folded: UInt64 = 0xcbf2_9ce4_8422_2325
655
+ let utf8 = string.utf8
656
+ let hashed: Void? = utf8.withContiguousStorageIfAvailable { for byte in $0 { folded = (folded ^ UInt64(byte)) &* 0x100_0000_01b3 } }
657
+ if hashed == nil { for byte in utf8 { folded = (folded ^ UInt64(byte)) &* 0x100_0000_01b3 } }
658
+ hasher.combine(folded)
659
+ }
660
+ }
661
+
662
+ /// The array index a property key names (`"0"`…`"4294967294"`), if it names one.
663
+ func jsArrayIndex(_ key: String) -> UInt32? {
664
+ let utf8 = key.utf8
665
+ guard let first = utf8.first, utf8.count <= 10, first >= 0x30, first <= 0x39 else { return nil }
666
+ if first == 0x30 { return utf8.count == 1 ? 0 : nil }
667
+ var n: UInt64 = 0
668
+ for c in utf8 {
669
+ guard c >= 0x30 && c <= 0x39 else { return nil }
670
+ n = n * 10 + UInt64(c - 0x30)
671
+ }
672
+ return n < 4_294_967_295 ? UInt32(n) : nil
673
+ }
674
+
675
+ // MARK: - Plain objects
676
+
677
+ /// A plain JavaScript object. Own keys enumerate in JavaScript order: array-index keys
678
+ /// ascending, then the other keys in insertion order.
679
+ public final class JSObject: JSDynamic, JSSymbolKeyed, JSAccessorKeyed, JSReactiveConvertible, ExpressibleByDictionaryLiteral, CustomStringConvertible {
680
+ nonisolated deinit {}
681
+ private var storage: [JSPropertyKey: Any?] = [:]
682
+ private var indexKeys: [UInt32] = []
683
+ private var namedKeys: [String] = []
684
+ /// How many of `namedKeys` are symbols' keys: a key of a kind the object holds none of is absent without a lookup.
685
+ private var symbolKeyCount = 0
686
+ /// Properties that are accessors or not plain writable, enumerable, configurable data.
687
+ private var slots: [JSPropertyKey: JSPropertySlot] = [:]
688
+ public private(set) var extensible = true
689
+ public var jsTracker: JSTracker? {
690
+ didSet { if isClassPrototype && (oldValue == nil) != (jsTracker == nil) { JSPrototypes.prototypeKeysChanged() } }
691
+ }
692
+ /// The object `Object.create(proto)` made it from: a key it doesn't have is read there.
693
+ public var jsPrototype: Any?
694
+ /// A class's prototype (`JSPrototypes.of`), whose keys decide what `JSPrototypes.holder` finds.
695
+ var isClassPrototype = false
696
+
697
+ public init() {}
698
+
699
+ public init(dictionaryLiteral elements: (String, Any?)...) {
700
+ for (key, value) in elements { define(key, value) }
701
+ }
702
+
703
+ public init(_ entries: [(String, Any?)]) {
704
+ storage.reserveCapacity(entries.count)
705
+ namedKeys.reserveCapacity(entries.count)
706
+ for (key, value) in entries { define(key, value) }
707
+ }
708
+
709
+ /// `values` under `keys`, pairwise, with the storage sized once (JSON.parse's objects): a repeated key keeps
710
+ /// its first position and takes its last value, as CreateDataProperty does.
711
+ init<Keys: Collection<String>, Values: Collection<Any?>>(keys: Keys, values: Values) {
712
+ storage.reserveCapacity(keys.count)
713
+ namedKeys.reserveCapacity(keys.count)
714
+ for (key, value) in zip(keys, values) { define(key, value) }
715
+ }
716
+
717
+ public subscript(key: String) -> Any? {
718
+ get {
719
+ if !slots.isEmpty, let getter = slots[JSPropertyKey(key)]?.get {
720
+ do { return try getter(self) } catch { jsReportUncaught(jsCaught(error)); return nil }
721
+ }
722
+ guard let tracker = jsTracker else {
723
+ if let value = storage[JSPropertyKey(key)] { return value }
724
+ guard let proto = jsPrototype, !(proto is JSNull) else { return nil }
725
+ do { return try (proto as? JSObject).map { try $0.get(key, receiver: self) } ?? jsGet(proto, key) } catch { jsReportUncaught(jsCaught(error)); return nil }
726
+ }
727
+ tracker.track()
728
+ return jsReactiveAny(storage[JSPropertyKey(key)] ?? nil)
729
+ }
730
+ set {
731
+ if !slots.isEmpty || !extensible || jsPrototype != nil {
732
+ do { try put(key, newValue) } catch { jsReportUncaught(jsCaught(error)) }
733
+ return
734
+ }
735
+ guard let tracker = jsTracker else { define(key, newValue); return }
736
+ let old = storage[JSPropertyKey(key)]
737
+ define(key, newValue)
738
+ if let old, jsSameValue(old, newValue) { return }
739
+ tracker.trigger()
740
+ }
741
+ }
742
+
743
+ /// `has(key) ? get(key, receiver:) : nil` in one lookup, what a getter throws reported: nil where the key is not the object's own.
744
+ func ownValue(_ key: String, receiver: Any?) -> Any?? {
745
+ jsTracker?.track()
746
+ if holdsNone(like: key) { return nil }
747
+ let k = JSPropertyKey(key)
748
+ guard let value = storage[k] else { return nil }
749
+ if !slots.isEmpty, let slot = slots[k], slot.isAccessor {
750
+ do { return .some(try slot.get?(receiver) ?? nil) } catch { jsReportUncaught(jsCaught(error)); return .some(nil) }
751
+ }
752
+ return .some(value)
753
+ }
754
+
755
+ /// A prototype's property read for an instance: a getter runs with the instance as `this`.
756
+ func get(_ key: String, receiver: Any?) throws -> Any? {
757
+ let k = JSPropertyKey(key)
758
+ if !slots.isEmpty, let slot = slots[k] {
759
+ if let getter = slot.get { return try getter(receiver) }
760
+ if slot.isAccessor { return nil }
761
+ }
762
+ if let value = storage[k] { return value }
763
+ return try (jsPrototype as? JSObject)?.get(key, receiver: receiver) ?? nil
764
+ }
765
+
766
+ /// The object of the prototype chain that has `key`, the object itself excluded.
767
+ private func inheritedHolder(_ key: JSPropertyKey) -> JSObject? {
768
+ var p = jsPrototype as? JSObject
769
+ while let holder = p {
770
+ if holder.storage[key] != nil { return holder }
771
+ p = holder.jsPrototype as? JSObject
772
+ }
773
+ return nil
774
+ }
775
+
776
+ /// A prototype's setter for a key, nil when the key holds a value; an accessor without one throws as strict code does.
777
+ func setter(_ key: String) -> ((Any?, Any?) throws -> Void)? {
778
+ guard !slots.isEmpty, let slot = slots[JSPropertyKey(key)], slot.isAccessor else { return nil }
779
+ return slot.set ?? { _, _ in throw JSException(JSTypeError("Cannot set property \(key) of #<Object> which has only a getter")) }
780
+ }
781
+
782
+ /// `object[key]`, running a getter.
783
+ public func get(_ key: String) throws -> Any? {
784
+ if !slots.isEmpty, let getter = slots[JSPropertyKey(key)]?.get { return try getter(self) }
785
+ return self[key]
786
+ }
787
+
788
+ /// Updates an already-present own property in one lookup (running its setter or checking writability); returns false if absent.
789
+ func setIfPresent(_ key: String, _ value: Any?, receiver: Any?) throws -> Bool {
790
+ if holdsNone(like: key) { return false }
791
+ let k = JSPropertyKey(key)
792
+ guard let idx = storage.index(forKey: k) else { return false }
793
+ if !slots.isEmpty, let slot = slots[k] {
794
+ if slot.isAccessor {
795
+ guard let setter = slot.set else { throw JSException(JSTypeError("Cannot set property \(key) of #<Object> which has only a getter")) }
796
+ try setter(receiver, value)
797
+ return true
798
+ }
799
+ if !slot.writable { throw JSException(JSTypeError("Cannot assign to read only property '\(key)' of object '#<Object>'")) }
800
+ }
801
+ if let tracker = jsTracker {
802
+ let old = storage.values[idx]
803
+ storage.values[idx] = value
804
+ if !jsSameValue(old, value) { tracker.trigger() }
805
+ } else {
806
+ storage.values[idx] = value
807
+ }
808
+ return true
809
+ }
810
+
811
+ /// Inserts a new plain own property when the caller already verified it is absent and the backing store is extensible.
812
+ func defineNewOwn(_ key: String, _ value: Any?) {
813
+ define(key, JSPropertyKey(key), value)
814
+ jsTracker?.trigger()
815
+ }
816
+
817
+ /// `object[key] = value` in strict code: a read-only property, a getter without a setter
818
+ /// or a new key on an object that is not extensible throws a TypeError.
819
+ public func put(_ key: String, _ value: Any?) throws {
820
+ let k = JSPropertyKey(key)
821
+ if slots.isEmpty && extensible && jsPrototype == nil && jsTracker == nil {
822
+ define(key, k, value)
823
+ return
824
+ }
825
+ if !slots.isEmpty, let slot = slots[k] {
826
+ if slot.isAccessor {
827
+ guard let setter = slot.set else { throw JSException(JSTypeError("Cannot set property \(key) of #<Object> which has only a getter")) }
828
+ return try setter(self, value)
829
+ }
830
+ if !slot.writable { throw JSException(JSTypeError("Cannot assign to read only property '\(key)' of object '#<Object>'")) }
831
+ } else if storage[k] == nil {
832
+ // OrdinarySet: an inherited accessor runs with this object as `this`; an inherited read-only value refuses.
833
+ if jsPrototype != nil, let inherited = inheritedHolder(k)?.slots[k] {
834
+ if inherited.isAccessor {
835
+ guard let setter = inherited.set else { throw JSException(JSTypeError("Cannot set property \(key) of #<Object> which has only a getter")) }
836
+ return try setter(self, value)
837
+ }
838
+ if !inherited.writable { throw JSException(JSTypeError("Cannot assign to read only property '\(key)' of object '#<Object>'")) }
839
+ }
840
+ if !extensible { throw JSException(JSTypeError("Cannot add property \(key), object is not extensible")) }
841
+ }
842
+ guard let tracker = jsTracker else { define(key, k, value); return }
843
+ let old = storage[k]
844
+ define(key, k, value)
845
+ if let old, jsSameValue(old, value) { return }
846
+ tracker.trigger()
847
+ }
848
+
849
+ /// `Object.defineProperty(object, key, descriptor)`; attributes the descriptor leaves out are false for a new property.
850
+ public func defineProperty(_ key: String, _ d: JSPropertyDescriptor) throws {
851
+ let k = JSPropertyKey(key)
852
+ let exists = storage[k] != nil
853
+ var slot = slots[k] ?? JSPropertySlot(enumerable: exists, writable: exists, configurable: exists)
854
+ if !exists && !extensible { throw JSException(JSTypeError("Cannot define property \(key), object is not extensible")) }
855
+ if exists && !slot.configurable {
856
+ let changes = d.get != nil || d.set != nil || d.configurable == true || (d.enumerable.map { $0 != slot.enumerable } ?? false)
857
+ || (!slot.writable && (d.writable == true || (d.value.map { !jsSameValue($0, storage[k] ?? nil) } ?? false)))
858
+ if changes { throw JSException(JSTypeError("Cannot redefine property: \(key)")) }
859
+ }
860
+ if d.get != nil || d.set != nil {
861
+ slot.get = d.get
862
+ slot.set = d.set
863
+ slot.isAccessor = true
864
+ slot.writable = false
865
+ } else if d.value != nil || d.writable != nil {
866
+ if slot.isAccessor { slot.get = nil; slot.set = nil; slot.isAccessor = false }
867
+ }
868
+ if let v = d.enumerable { slot.enumerable = v }
869
+ if let v = d.writable { slot.writable = v }
870
+ if let v = d.configurable { slot.configurable = v }
871
+ define(key, slot.isAccessor ? nil as Any? : (d.value ?? (storage[k] ?? nil)))
872
+ slots[k] = slot.isPlain ? nil : slot
873
+ if isClassPrototype { JSPrototypes.prototypeKeysChanged() }
874
+ jsTracker?.trigger()
875
+ }
876
+
877
+ /// The getter of an own accessor property.
878
+ func getter(_ key: String) -> ((Any?) throws -> Any?)? { slots.isEmpty ? nil : slots[JSPropertyKey(key)]?.get }
879
+
880
+ /// `Object.getOwnPropertyDescriptor(object, key)`.
881
+ public func descriptor(_ key: String) -> JSObject? {
882
+ let k = JSPropertyKey(key)
883
+ guard storage[k] != nil else { return nil }
884
+ let slot = slots[k] ?? JSPropertySlot()
885
+ if slot.isAccessor {
886
+ return JSObject([("get", slot.get.map { g in { (_: [Any?]) throws -> Any? in try g(self) } as JSFunction } as Any?), ("set", slot.set.map { s in { (a: [Any?]) throws -> Any? in try s(self, jsArg(a, 0)); return nil } as JSFunction } as Any?),
887
+ ("enumerable", slot.enumerable), ("configurable", slot.configurable)])
888
+ }
889
+ return JSObject([("value", storage[k] ?? nil), ("writable", slot.writable), ("enumerable", slot.enumerable), ("configurable", slot.configurable)])
890
+ }
891
+
892
+ /// `Object.freeze`, `Object.seal`, `Object.preventExtensions`.
893
+ public func restrict(sealed: Bool, frozen: Bool) {
894
+ extensible = false
895
+ guard sealed || frozen else { return }
896
+ for key in indexKeys.map({ String($0) }) + namedKeys {
897
+ var slot = slots[JSPropertyKey(key)] ?? JSPropertySlot()
898
+ slot.configurable = false
899
+ if frozen && !slot.isAccessor { slot.writable = false }
900
+ slots[JSPropertyKey(key)] = slot
901
+ }
902
+ }
903
+
904
+ public var isSealed: Bool { !extensible && storage.keys.allSatisfy { !(slots[$0] ?? JSPropertySlot()).configurable } }
905
+ public var isFrozen: Bool { !extensible && storage.keys.allSatisfy { let s = slots[$0] ?? JSPropertySlot(); return !s.configurable && (s.isAccessor || !s.writable) } }
906
+
907
+ public func jsAccessorKind(_ key: String) -> String? {
908
+ guard let slot = slots[JSPropertyKey(key)], slot.isAccessor else { return nil }
909
+ return slot.get != nil && slot.set != nil ? "Getter/Setter" : slot.get != nil ? "Getter" : "Setter"
910
+ }
911
+
912
+ /// `Object.getOwnPropertyNames(object)`: string keys, enumerable or not.
913
+ public var ownPropertyNames: [String] {
914
+ indexKeys.map { String($0) } + namedKeys.filter { !jsIsSymbolKey($0) }
915
+ }
916
+
917
+ private func define(_ key: String, _ value: Any?) {
918
+ define(key, JSPropertyKey(key), value)
919
+ }
920
+
921
+ private func define(_ key: String, _ k: JSPropertyKey, _ value: Any?) {
922
+ if storage.updateValue(value, forKey: k) == nil {
923
+ if isClassPrototype { JSPrototypes.prototypeKeysChanged() }
924
+ if let index = jsArrayIndex(key) {
925
+ var low = 0, high = indexKeys.count
926
+ while low < high {
927
+ let mid = (low + high) / 2
928
+ if indexKeys[mid] < index { low = mid + 1 } else { high = mid }
929
+ }
930
+ indexKeys.insert(index, at: low)
931
+ } else {
932
+ namedKeys.append(key)
933
+ if jsIsSymbolKey(key) { symbolKeyCount += 1 }
934
+ }
935
+ }
936
+ }
937
+
938
+ /// `key in object` for own keys.
939
+ public func has(_ key: String) -> Bool {
940
+ jsTracker?.track()
941
+ return !holdsNone(like: key) && storage[JSPropertyKey(key)] != nil
942
+ }
943
+
944
+ @inline(__always)
945
+ private func holdsNone(like key: String) -> Bool {
946
+ jsIsSymbolKey(key) ? symbolKeyCount == 0 : indexKeys.isEmpty && namedKeys.count == symbolKeyCount
947
+ }
948
+
949
+ /// `delete object[key]`.
950
+ @discardableResult
951
+ public func delete(_ key: String) -> Bool {
952
+ if let slot = slots[JSPropertyKey(key)], !slot.configurable { return false }
953
+ slots[JSPropertyKey(key)] = nil
954
+ guard storage.removeValue(forKey: JSPropertyKey(key)) != nil else { return true }
955
+ if isClassPrototype { JSPrototypes.prototypeKeysChanged() }
956
+ if let index = jsArrayIndex(key) {
957
+ indexKeys.removeAll { $0 == index }
958
+ } else if let position = namedKeys.firstIndex(where: { jsStringEquals($0, key) }) {
959
+ namedKeys.remove(at: position)
960
+ if jsIsSymbolKey(key) { symbolKeyCount -= 1 }
961
+ }
962
+ jsTracker?.trigger()
963
+ return true
964
+ }
965
+
966
+ /// `Object.keys(object)` as a Swift array.
967
+ public var keys: [String] {
968
+ jsTracker?.track()
969
+ let all = indexKeys.map { String($0) } + namedKeys.filter { !jsIsSymbolKey($0) }
970
+ return slots.isEmpty ? all : all.filter { slots[JSPropertyKey($0)]?.enumerable ?? true }
971
+ }
972
+
973
+ public var jsSymbolKeys: [String] {
974
+ jsTracker?.track()
975
+ return namedKeys.filter(jsIsSymbolKey)
976
+ }
977
+
978
+ public subscript(jsKey key: String) -> Any? {
979
+ get { self[key] }
980
+ set { self[key] = newValue }
981
+ }
982
+
983
+ public var jsKeys: [String] { keys }
984
+ public var jsClassName: String? = nil
985
+
986
+ public func jsMakeReactive() {
987
+ if jsTracker == nil { jsTracker = JSTracker() }
988
+ }
989
+
990
+ public var description: String { jsInspect(self) }
991
+ }
992
+
993
+ /// ToPrimitive of an untyped object: its `[Symbol.toPrimitive]` method, else OrdinaryToPrimitive over its own `valueOf` and
994
+ /// `toString` (a literal's methods).
995
+ extension JSObject: JSToPrimitive {
996
+ public func jsToPrimitive(_ hint: String) throws -> Any? {
997
+ if let exotic = jsFlat(self[JSSymbol.toPrimitive.key]), !(exotic is JSNull) {
998
+ guard jsIsFunction(exotic) else { throw JSException(JSTypeError("\(jsInspect(exotic)) is not a function")) }
999
+ let result = jsFlat(try jsInvoke(exotic, self, [hint]))
1000
+ if result == nil || !jsIsObject(result!) || result is JSNull || result is JSSymbol || result is JSBigInt { return result }
1001
+ throw JSException(JSTypeError("Cannot convert object to primitive value"))
1002
+ }
1003
+ for name in hint == "string" ? ["toString", "valueOf"] : ["valueOf", "toString"] {
1004
+ guard let method = self[name], jsIsFunction(method) else {
1005
+ // Object.prototype's toString gives a primitive; its valueOf gives the object, so the next method runs.
1006
+ if name == "toString" { return jsStringTag(self).map { "[object \($0)]" } ?? "[object Object]" }
1007
+ continue
1008
+ }
1009
+ let result = jsFlat(try jsInvoke(method, self, []))
1010
+ if result == nil || !jsIsObject(result!) || result is JSNull || result is JSSymbol || result is JSBigInt { return result }
1011
+ }
1012
+ throw JSException(JSTypeError("Cannot convert object to primitive value"))
1013
+ }
1014
+ }
1015
+
1016
+ // MARK: - Property access
1017
+
1018
+ /// `object[key]` / `object.key` on a dynamic value. Reading from undefined or null throws a TypeError.
1019
+ /// `o?.key`, or a member read further along an optional chain, of an untyped value: undefined once the chain reaches undefined or null.
1020
+ public func jsGetIfPresent(_ object: Any?, _ key: String) throws -> Any? {
1021
+ jsIsNullish(object) ? nil : try jsGet(object, key)
1022
+ }
1023
+
1024
+ /// `Object.create(proto)`: an object whose missing keys read from `proto` (nil: none).
1025
+ public func jsObjectCreate(_ proto: Any?) -> JSObject {
1026
+ let object = JSObject()
1027
+ object.jsPrototype = jsFlat(proto)
1028
+ return object
1029
+ }
1030
+
1031
+ public func jsGet(_ object: Any?, _ key: String) throws -> Any? {
1032
+ let object = jsFlat(object)
1033
+ let shape = object.flatMap { jsClassShape(of: $0) }
1034
+ if let value = object, let shape, shape.script {
1035
+ let instance = jsClassInstance(value)
1036
+ if shape.plainObject { return try unsafeDowncast(instance, to: JSObject.self).get(key) }
1037
+ if shape.symbolFieldsPlain, jsIsSymbolKey(key) {
1038
+ let expando = jsExpando(instance, as: shape.expandoType!)
1039
+ return shape.symbolPlain ? jsExpandoSymbolGet(expando, key) : jsExpandoGet(expando, key)
1040
+ }
1041
+ return jsDynamic(instance, as: shape.dynamicType!)[jsKey: key]
1042
+ }
1043
+ if let value = object, shape == nil, jsTypeKind(value) == .struct {
1044
+ if let string = value as? String {
1045
+ if key == "length" { return Double(string.utf16.count) }
1046
+ if key == "constructor" { return jsStringConstructor }
1047
+ if let index = jsArrayIndex(key) {
1048
+ let units = JSStringUnits(string)
1049
+ return Int(index) < units.count ? jsString(unit: units[Int(index)]) : nil
1050
+ }
1051
+ return jsStringMethod(string, key)
1052
+ }
1053
+ if let number = value as? Double { return key == "constructor" ? jsNumberConstructor : jsNumberMethod(number, key) }
1054
+ if let bool = value as? Bool { return key == "constructor" ? jsBooleanConstructor : jsBooleanMethod(bool, key) }
1055
+ if let big = value as? JSBigInt { return jsBigIntMethod(big, key) }
1056
+ }
1057
+ if let value = object, shape?.opaque ?? (jsTypeKind(value) == .objCClass && jsClassShape(value as AnyObject).opaque) {
1058
+ if let native = jsAsNSObject(value) {
1059
+ if jsIsNativeOnly(native) { return jsNativeGet(native, key) }
1060
+ } else {
1061
+ if let moot = value as? JSMootValue, moot.undeclared { throw moot.unavailable() }
1062
+ if let plain = value as? JSObject { return try plain.get(key) }
1063
+ if let dynamic = value as? JSDynamic { return dynamic[jsKey: key] }
1064
+ }
1065
+ }
1066
+ // A class itself (`cls.prototype`), before any cast a class object could wrongly pass as an instance.
1067
+ if shape == nil, let cls = object as? AnyClass { return key == "prototype" ? JSPrototypes.of(cls) : JSPrototypes.staticMember(cls, key) ?? (key == "name" ? jsClassValueName(cls) : nil) }
1068
+ switch object {
1069
+ case nil:
1070
+ throw JSException(JSTypeError("Cannot read properties of undefined (reading '\(key)')"))
1071
+ case is JSNull:
1072
+ throw JSException(JSTypeError("Cannot read properties of null (reading '\(key)')"))
1073
+ case let plain as JSObject:
1074
+ return try plain.get(key)
1075
+ case let dynamic as JSDynamic:
1076
+ return dynamic[jsKey: key]
1077
+ case let array as JSArrayProtocol:
1078
+ if key == "length" { return Double(array.jsLength) }
1079
+ if let index = jsArrayIndex(key) { return Int(index) < array.jsLength ? array.jsElement(at: Int(index)) : nil }
1080
+ if let side = jsSideProperties(array, create: false), side.has(key) { return try side.get(key, receiver: array) }
1081
+ return jsArrayMethod(array, key) ?? jsArrayGenericMethod(key)
1082
+ case let string as String:
1083
+ if key == "length" { return Double(string.utf16.count) }
1084
+ if key == "constructor" { return jsStringConstructor }
1085
+ if let index = jsArrayIndex(key) {
1086
+ let units = JSStringUnits(string)
1087
+ return Int(index) < units.count ? jsString(unit: units[Int(index)]) : nil
1088
+ }
1089
+ return jsStringMethod(string, key)
1090
+ case let match as JSMatch:
1091
+ if key == "length" { return match.length }
1092
+ if key == "index" { return match.isExecResult ? match.index : nil }
1093
+ if key == "input" { return match.isExecResult ? match.input : nil }
1094
+ if key == "groups" { return match.isExecResult ? match.groups : nil }
1095
+ if key == "indices" { return match.indices }
1096
+ if let index = jsArrayIndex(key) { return match.values.element(Double(index)) ?? nil }
1097
+ return nil
1098
+ case let map as JSMapProtocol:
1099
+ return key == "size" ? Double(map.jsSize) : jsMapMethod(map, key)
1100
+ case let set as JSSetProtocol:
1101
+ return key == "size" ? Double(set.jsSize) : jsSetMethod(set, key)
1102
+ // A typed tuple (`[CssProperty, unknown]`) read untyped is the array script made it as.
1103
+ case let value? where jsIsTuple(value):
1104
+ let elements = Mirror(reflecting: value).children.map { $0.value }
1105
+ if key == "length" { return Double(elements.count) }
1106
+ if let index = jsArrayIndex(key) { return Int(index) < elements.count ? jsFlat(elements[Int(index)]) : nil }
1107
+ return nil
1108
+ case let thenable as JSThenable:
1109
+ return jsPromiseMember(thenable, key)
1110
+ case let big as JSBigInt:
1111
+ return jsBigIntMethod(big, key)
1112
+ case let bool as Bool:
1113
+ return key == "constructor" ? jsBooleanConstructor : jsBooleanMethod(bool, key)
1114
+ case let number as Double:
1115
+ return key == "constructor" ? jsNumberConstructor : jsNumberMethod(number, key)
1116
+ case is JSFunction, is JSMethod:
1117
+ return jsFunctionMethod(key)
1118
+ // A Swift struct casts to NSObject too (boxed): a geometry struct is read by its fields first. An NSValue,
1119
+ // which Swift bridges to the struct it holds, is the native object (`toValue.CGRectValue`).
1120
+ case let value? where !(type(of: value) is AnyClass) && jsIsStruct(value):
1121
+ return jsStructMember(value, key)
1122
+ case let native as NSObject:
1123
+ return jsNativeGet(native, key)
1124
+ default:
1125
+ return nil
1126
+ }
1127
+ }
1128
+
1129
+ func jsIsStruct(_ value: Any) -> Bool {
1130
+ #if canImport(UIKit)
1131
+ return value is CGPoint || value is CGSize || value is CGRect || value is UIEdgeInsets
1132
+ #else
1133
+ return false
1134
+ #endif
1135
+ }
1136
+
1137
+ /// A member of a geometry struct held untyped (`view.sizeThatFits(…)` read as `{ width, height }`), as the runtime gives its fields.
1138
+ func jsStructMember(_ value: Any?, _ key: String) -> Any? {
1139
+ #if canImport(UIKit)
1140
+ switch value {
1141
+ case let p as CGPoint: return key == "x" ? Double(p.x) : key == "y" ? Double(p.y) : nil
1142
+ case let z as CGSize: return key == "width" ? Double(z.width) : key == "height" ? Double(z.height) : nil
1143
+ case let r as CGRect: return key == "origin" ? r.origin : key == "size" ? r.size : nil
1144
+ case let i as UIEdgeInsets:
1145
+ switch key { case "top": return Double(i.top); case "left": return Double(i.left); case "bottom": return Double(i.bottom); case "right": return Double(i.right); default: return nil }
1146
+ default: return nil
1147
+ }
1148
+ #else
1149
+ return nil
1150
+ #endif
1151
+ }
1152
+
1153
+ /// Undefined or null given where a function needs a value of its type (`addWeakEventListener(source, name, undefined, target)`):
1154
+ /// the TypeError of the first use of it.
1155
+ @inline(__always)
1156
+ public func jsRequired<T>(_ value: T?, _ name: String) throws -> T {
1157
+ guard let value else { throw jsUndefinedValue(name) }
1158
+ return value
1159
+ }
1160
+
1161
+ @inline(never)
1162
+ public func jsUndefinedValue(_ name: String) -> JSException { JSException(JSTypeError("\(name) is undefined")) }
1163
+
1164
+ /// Lenient code: a value undefined where Swift needs the object (an array's element, a native method's argument).
1165
+ @inline(__always)
1166
+ public func jsObjectRequired<T>(_ value: T?) throws -> T {
1167
+ guard let value else { throw jsNoObject() }
1168
+ return value
1169
+ }
1170
+
1171
+ /// Lenient code: a destructuring pattern's source, `key` its first property, nil for an array pattern: V8's TypeError where it is missing.
1172
+ @inline(__always)
1173
+ public func jsDestructured<T>(_ value: T?, _ key: String?) throws -> T {
1174
+ guard let value else { throw jsNotDestructurable(key) }
1175
+ return value
1176
+ }
1177
+
1178
+ @inline(never)
1179
+ public func jsNotDestructurable(_ key: String?) -> JSException {
1180
+ JSException(JSTypeError(key.map { "Cannot destructure property '\($0)' of 'undefined' as it is undefined." } ?? "undefined is not iterable (cannot read property Symbol(Symbol.iterator))"))
1181
+ }
1182
+
1183
+ /// Lenient code: what `for…of` or a spread iterates, undefined where its type says a collection.
1184
+ @inline(__always)
1185
+ public func jsIterated<T>(_ value: T?, _ message: String) throws -> T {
1186
+ guard let value else { throw jsNotIterable(message) }
1187
+ return value
1188
+ }
1189
+
1190
+ @inline(never)
1191
+ public func jsNotIterable(_ message: String) -> JSException { JSException(JSTypeError(message)) }
1192
+
1193
+ @inline(never)
1194
+ public func jsNoObject() -> JSException { JSException(JSTypeError("Cannot convert undefined or null to object")) }
1195
+
1196
+ /// Lenient code: a function value that may be missing, called as `name(…)`: V8's TypeError where it is.
1197
+ @inline(__always)
1198
+ public func jsCallable<F>(_ function: F?, _ name: String) throws -> F {
1199
+ guard let function else { throw jsNotCallable(name) }
1200
+ return function
1201
+ }
1202
+
1203
+ @inline(never)
1204
+ public func jsNotCallable(_ name: String) -> JSException { JSException(JSTypeError("\(name) is not a function")) }
1205
+
1206
+ /// A function value that may be missing, about to be called: undefined is not a function.
1207
+ public func jsCallee<F>(_ function: F?) throws -> F {
1208
+ guard let function else { throw JSException(JSTypeError("undefined is not a function")) }
1209
+ return function
1210
+ }
1211
+
1212
+ /// `object[key] op= value` on a dynamic value: the member read once, then written with what
1213
+ /// `update` makes of it. The new value.
1214
+ @discardableResult
1215
+ public func jsUpdate(_ object: Any?, _ key: String, _ update: (Any?) throws -> Any?) throws -> Any? {
1216
+ let value = try update(jsGet(object, key))
1217
+ try jsSet(object, key, value)
1218
+ return value
1219
+ }
1220
+
1221
+ /// `object[key]++` and `object[key]--` on a dynamic value: the old value, as a number.
1222
+ @discardableResult
1223
+ public func jsPostUpdate(_ object: Any?, _ key: String, _ step: Double) throws -> Double {
1224
+ let old = jsToNumber(try jsGet(object, key))
1225
+ try jsSet(object, key, old + step)
1226
+ return old
1227
+ }
1228
+
1229
+ /// `object[key] = value` on a dynamic value. Writing to undefined or null throws a TypeError;
1230
+ /// writes to other primitives are ignored.
1231
+ public func jsSet(_ object: Any?, _ key: String, _ value: Any?) throws {
1232
+ let object = jsFlat(object)
1233
+ if let valueObj = object, let shape = jsClassShape(of: valueObj), shape.script {
1234
+ let instance = jsClassInstance(valueObj)
1235
+ if shape.plainObject {
1236
+ try unsafeDowncast(instance, to: JSObject.self).put(key, value)
1237
+ return
1238
+ }
1239
+ if shape.function && (key == "name" || key == "length") {
1240
+ throw JSException(JSTypeError("Cannot assign to read only property '\(key)' of function '\(jsToString(valueObj))'"))
1241
+ }
1242
+ if shape.expando {
1243
+ let expando = jsExpando(instance, as: shape.expandoType!)
1244
+ if let own = expando.jsExpando, try own.setIfPresent(key, value, receiver: expando) {
1245
+ return
1246
+ }
1247
+ if shape.symbolFieldsPlain && jsIsSymbolKey(key) {
1248
+ if let setter = JSPrototypes.setter(type(of: expando), key) {
1249
+ try setter(expando, value)
1250
+ return
1251
+ }
1252
+ if jsRestriction(expando) > 0 {
1253
+ throw JSException(JSTypeError("Cannot add property \(key), object is not extensible"))
1254
+ }
1255
+ if expando.jsExpando == nil { expando.jsExpando = JSObject() }
1256
+ expando.jsExpando!.defineNewOwn(key, value)
1257
+ return
1258
+ }
1259
+ }
1260
+ let dynamic = jsDynamic(instance, as: shape.dynamicType!)
1261
+ let level = jsRestriction(dynamic)
1262
+ if level > 0 {
1263
+ let exists = dynamic.jsKeys.contains(key)
1264
+ if !exists { throw JSException(JSTypeError("Cannot add property \(key), object is not extensible")) }
1265
+ if level == 3 { throw JSException(JSTypeError("Cannot assign to read only property '\(key)' of object '#<Object>'")) }
1266
+ }
1267
+ jsRefusedWrite = nil
1268
+ dynamic[jsKey: key] = value
1269
+ if let refused = jsRefusedWrite {
1270
+ jsRefusedWrite = nil
1271
+ throw refused
1272
+ }
1273
+ return
1274
+ }
1275
+ switch object {
1276
+ case nil:
1277
+ throw JSException(JSTypeError("Cannot set properties of undefined (setting '\(key)')"))
1278
+ case is JSNull:
1279
+ throw JSException(JSTypeError("Cannot set properties of null (setting '\(key)')"))
1280
+ case let function? where (key == "name" || key == "length") && jsIsFunction(function):
1281
+ throw JSException(JSTypeError("Cannot assign to read only property '\(key)' of function '\(jsToString(function))'"))
1282
+ case let plain as JSObject:
1283
+ try plain.put(key, value)
1284
+ // A property the object was given (`Object.defineProperty(obj, key, …)`): its setter, or its value where writable, throwing as strict code does.
1285
+ case let expando as JSExpando where expando.jsExpando?.has(key) == true:
1286
+ let own = expando.jsExpando!
1287
+ if let setter = own.setter(key) { try setter(expando, value) } else { try own.put(key, value) }
1288
+ case let dynamic as JSDynamic:
1289
+ let level = jsRestriction(dynamic)
1290
+ if level > 0 {
1291
+ let exists = dynamic.jsKeys.contains(key)
1292
+ if !exists { throw JSException(JSTypeError("Cannot add property \(key), object is not extensible")) }
1293
+ if level == 3 { throw JSException(JSTypeError("Cannot assign to read only property '\(key)' of object '#<Object>'")) }
1294
+ }
1295
+ jsRefusedWrite = nil
1296
+ dynamic[jsKey: key] = value
1297
+ if let refused = jsRefusedWrite {
1298
+ jsRefusedWrite = nil
1299
+ throw refused
1300
+ }
1301
+ // `promise.cancel = fn` on the promise an animation returns: what its `cancel()` does.
1302
+ case let cancelable as JSCancelable where key == "cancel":
1303
+ cancelable.canceler = { jsReport { _ = try jsCall(value) } }
1304
+ case let native as NSObject:
1305
+ jsNativeSet(native, key, value)
1306
+ case let array as JSArrayProtocol:
1307
+ if key == "length" {
1308
+ let length = jsToNumber(value)
1309
+ guard length >= 0, length <= 4_294_967_295, length == length.rounded(.towardZero) else {
1310
+ throw JSException(JSRangeError("Invalid array length"))
1311
+ }
1312
+ try array.jsSetLength(Int(length))
1313
+ } else if let index = jsArrayIndex(key) {
1314
+ try array.jsSetElement(value, at: Int(index))
1315
+ } else if let side = jsSideProperties(array, create: true) {
1316
+ if let setter = side.setter(key) { try setter(array, value) } else { try side.put(key, value) }
1317
+ }
1318
+ default:
1319
+ break
1320
+ }
1321
+ }
1322
+
1323
+ /// Calls a function stored in a dynamic value. Anything else throws a TypeError.
1324
+ @discardableResult
1325
+ public func jsCall(_ function: Any?, _ arguments: Any?...) throws -> Any? {
1326
+ try jsCall(function, spread: arguments)
1327
+ }
1328
+
1329
+ /// `f(...args)` on an untyped value.
1330
+ @discardableResult
1331
+ public func jsCall(_ function: Any?, spread arguments: [Any?]) throws -> Any? {
1332
+ if let f = jsFlat(function) as? JSFunctionObject { return try f.call(nil, arguments) }
1333
+ if let f = jsFlat(function) as? JSFunction { return try f(arguments) }
1334
+ if let method = jsFlat(function) as? JSMethod { return try method(nil, arguments) }
1335
+ if let moot = jsFlat(function) as? JSMootValue { throw moot.unavailable() }
1336
+ throw JSException(JSTypeError("\(jsInspect(function)) is not a function"))
1337
+ }
1338
+
1339
+ /// `Object.keys(value)`.
1340
+ public func jsObjectKeys(_ value: Any?) -> JSArray<String> {
1341
+ switch jsFlat(value) {
1342
+ case let dynamic as JSDynamic: return JSArray(dynamic.jsKeys)
1343
+ case let array as JSArrayProtocol: return JSArray(jsKeysOf(array))
1344
+ case let string as String: return JSArray((0..<string.utf16.count).map { String($0) })
1345
+ default: return JSArray()
1346
+ }
1347
+ }
1348
+
1349
+ /// `Object.values(value)`.
1350
+ public func jsObjectValues(_ value: Any?) -> JSArray<Any?> {
1351
+ switch jsFlat(value) {
1352
+ case let dynamic as JSDynamic: return JSArray(dynamic.jsKeys.map { dynamic[jsKey: $0] })
1353
+ case let array as JSArrayProtocol: return JSArray(jsKeysOf(array).map { jsField(array, $0) })
1354
+ default: return JSArray()
1355
+ }
1356
+ }
1357
+
1358
+ /// `Object.entries(value)`, each entry a `(key, value)` tuple.
1359
+ public func jsObjectEntries(_ value: Any?) -> JSArray<(String, Any?)> {
1360
+ switch jsFlat(value) {
1361
+ case let dynamic as JSDynamic: return JSArray(dynamic.jsKeys.map { ($0, dynamic[jsKey: $0]) })
1362
+ case let array as JSArrayProtocol: return JSArray(jsKeysOf(array).map { ($0, jsField(array, $0)) })
1363
+ default: return JSArray()
1364
+ }
1365
+ }
1366
+
1367
+ /// `Object.assign(target, ...sources)`.
1368
+ @discardableResult
1369
+ public func jsObjectAssign<T: JSDynamic>(_ target: T, _ sources: Any?...) throws -> T {
1370
+ for source in sources {
1371
+ switch jsFlat(source) {
1372
+ case let dynamic as JSDynamic:
1373
+ for key in dynamic.jsKeys { try jsSet(target, key, dynamic[jsKey: key]) }
1374
+ case let indexed? where indexed is JSArrayProtocol || indexed is String:
1375
+ for key in jsKeysOf(indexed) { try jsSet(target, key, jsField(indexed, key)) }
1376
+ default:
1377
+ break
1378
+ }
1379
+ }
1380
+ return target
1381
+ }
1382
+
1383
+ // MARK: - Operators
1384
+
1385
+ /// `typeof value`.
1386
+ public func jsTypeof(_ value: Any?) -> String {
1387
+ guard let v = jsFlat(value) else { return "undefined" }
1388
+ let t = type(of: v)
1389
+ if t == String.self { return "string" }
1390
+ if t == Bool.self { return "boolean" }
1391
+ if t == Double.self, !(v as! Double).isNaN { return "number" }
1392
+ if let d = v as? Double, d.isNaN, let entry = jsForeignEntry(d) { return jsTypeof(entry.value) }
1393
+ if v is JSFunctionObject { return "function" }
1394
+ if jsIsOpaqueObject(v) { return v is JSSymbol ? "symbol" : (v as? JSMootValue)?.undeclared == true ? "undefined" : "object" }
1395
+ if let boolean = jsNativeBoolean(v) { _ = boolean; return "boolean" }
1396
+ // Any other NSNumber (an NSDecimalNumber among them) is a number, though one of 0 or 1 casts to Bool.
1397
+ if jsTypeKind(v) == .objCClass, v is NSNumber { return "number" }
1398
+ switch v {
1399
+ case is String: return "string"
1400
+ case is Bool: return "boolean"
1401
+ case is JSNull: return "object"
1402
+ case is JSSymbol: return "symbol"
1403
+ case is JSBigInt: return "bigint"
1404
+ default:
1405
+ if jsNumeric(v) != nil { return "number" }
1406
+ return jsIsFunction(v) || jsIsClassObject(v) ? "function" : "object"
1407
+ }
1408
+ }
1409
+
1410
+ /// A `void` value as script holds it: undefined. Boxing `()` itself would give a value that isn't nil.
1411
+ @inline(__always) public func jsUndefined(_: Void) -> Any? { nil }
1412
+
1413
+ /// A `void` variable, held `Void!`: without this overload it would take the `Any?` one and box `()`.
1414
+ @inline(__always) public func jsUndefined(_: Void?) -> Any? { nil }
1415
+
1416
+ /// What a function TypeScript types `void` returned through a dynamic call: kept, as JavaScript keeps it (a promise core checks for).
1417
+ @inline(__always) public func jsUndefined(_ value: Any?) -> Any? { value }
1418
+
1419
+ /// `value === undefined || value === null`.
1420
+
1421
+ public func jsIsNullish(_ value: Any?) -> Bool {
1422
+ let v = jsFlat(value)
1423
+ return v == nil || v is JSNull
1424
+ }
1425
+
1426
+ /// JavaScript truthiness: false for undefined, null, false, 0, -0, NaN and "".
1427
+ public func jsIsTruthy(_ value: Any?) -> Bool {
1428
+ let value = jsFlat(value)
1429
+ if let v = value {
1430
+ let t = type(of: v)
1431
+ if t == Bool.self { return v as! Bool }
1432
+ if t == Double.self { let d = v as! Double; return d != 0 && !d.isNaN }
1433
+ if t == String.self { return !(v as! String).isEmpty }
1434
+ let kind = jsTypeKind(v)
1435
+ if let shape = kind == .swiftClass ? jsClassShape(of: v) : kind == .objCClass ? jsClassShape(v as AnyObject) : nil, shape.opaque {
1436
+ return !shape.null
1437
+ }
1438
+ }
1439
+ switch value {
1440
+ case nil: return false
1441
+ case let b as Bool: return b
1442
+ case let d as Double: return d != 0 && !d.isNaN
1443
+ case let s as String: return !s.isEmpty
1444
+ case is JSNull: return false
1445
+ case let b as JSBigInt: return !b.isZero
1446
+ case let v?:
1447
+ if let n = jsNumeric(v) { return n != 0 && !n.isNaN }
1448
+ return true
1449
+ }
1450
+ }
1451
+
1452
+ /// `a === b` of two numbers lenient code holds, where NaN stands for undefined: two undefined ones are equal.
1453
+ @inlinable public func jsLenientNumberEquals(_ a: Double, _ b: Double) -> Bool { a == b || (a.isNaN && b.isNaN) }
1454
+
1455
+ /// `a === b`: numbers by value (NaN unequal to itself, -0 equal to +0), strings by code units,
1456
+ /// objects by identity. Closures cannot be compared in Swift and are never equal.
1457
+ public func jsStrictEquals(_ a: Any?, _ b: Any?) -> Bool {
1458
+ let a = jsFlat(a), b = jsFlat(b)
1459
+ if let x = a, let y = b {
1460
+ let tx = type(of: x)
1461
+ if tx == type(of: y) {
1462
+ if tx == String.self { return jsStringEquals(x as! String, y as! String) }
1463
+ if tx == Double.self { return (x as! Double) == (y as! Double) }
1464
+ }
1465
+ }
1466
+ if let p = a, let q = b, jsIsOpaqueObject(p) || jsIsOpaqueObject(q) {
1467
+ guard let x = jsIdentity(p), let y = jsIdentity(q) else { return false }
1468
+ return jsIsObject(x) && jsIsObject(y) && (x as AnyObject) === (y as AnyObject)
1469
+ }
1470
+ switch (a, b) {
1471
+ case (nil, nil): return true
1472
+ case (nil, _), (_, nil): return false
1473
+ case let (x as Any.Type, y as Any.Type): return x == y
1474
+ case let (x as Double, y as Double): return x == y
1475
+ case let (x as String, y as String): return jsStringEquals(x, y)
1476
+ case let (x as Bool, y as Bool): return x == y
1477
+ case let (x as JSBigInt, y as JSBigInt): return x == y
1478
+ case let (p?, q?):
1479
+ if let m = jsNumeric(p), let n = jsNumeric(q) { return m == n }
1480
+ guard let x = jsIdentity(p), let y = jsIdentity(q), jsIsObject(x), jsIsObject(y) else { return false }
1481
+ return (x as AnyObject) === (y as AnyObject)
1482
+ }
1483
+ }
1484
+
1485
+ /// SameValueZero (`includes`, `Map` and `Set` keys): `===` except NaN equals NaN.
1486
+ public func jsSameValueZero(_ a: Any?, _ b: Any?) -> Bool {
1487
+ if let x = jsFlat(a).flatMap(jsNumeric), let y = jsFlat(b).flatMap(jsNumeric), x.isNaN && y.isNaN { return true }
1488
+ return jsStrictEquals(a, b)
1489
+ }
1490
+
1491
+ /// SameValue (`Object.is`): `===` except NaN equals NaN and -0 differs from +0.
1492
+ public func jsSameValue(_ a: Any?, _ b: Any?) -> Bool {
1493
+ if let x = jsFlat(a).flatMap(jsNumeric), let y = jsFlat(b).flatMap(jsNumeric) {
1494
+ if x.isNaN && y.isNaN { return true }
1495
+ return x == y && x.sign == y.sign
1496
+ }
1497
+ return jsStrictEquals(a, b)
1498
+ }
1499
+
1500
+ /// `jsSameValue` of two values of one static type: a string, number or boolean compared as itself, not boxed.
1501
+ @inlinable public func jsSameValue<T>(typed a: T, _ b: T) -> Bool {
1502
+ if T.self == String.self { return jsStringEquals(a as! String, b as! String) }
1503
+ if T.self == Double.self {
1504
+ let x = a as! Double, y = b as! Double
1505
+ return x.isNaN ? y.isNaN : x == y && x.sign == y.sign
1506
+ }
1507
+ if T.self == Bool.self { return a as! Bool == b as! Bool }
1508
+ return jsSameValue(a, b)
1509
+ }
1510
+
1511
+ /// `a == b`: null equals undefined; numbers, strings and booleans compare after conversion;
1512
+ /// an object against a primitive compares through its string form.
1513
+ public func jsLooseEquals(_ a: Any?, _ b: Any?) -> Bool {
1514
+ let a = jsFlat(a), b = jsFlat(b)
1515
+ // Strings and numbers told apart by their type's identity, before casts that would try bridging them.
1516
+ if let x = a, let y = b {
1517
+ let tx = type(of: x), ty = type(of: y)
1518
+ if ty == String.self {
1519
+ if tx == String.self { return jsStringEquals(x as! String, y as! String) }
1520
+ if tx == Double.self { return (x as! Double) == jsNumberFromString(y as! String) }
1521
+ } else if ty == Double.self {
1522
+ if tx == Double.self { return (x as! Double) == (y as! Double) }
1523
+ if tx == String.self { return jsNumberFromString(x as! String) == (y as! Double) }
1524
+ }
1525
+ // A script object against a string or number: its primitive, compared again.
1526
+ if ty == String.self || ty == Double.self, jsClassShape(of: x)?.script == true { return jsLooseEquals(jsToPrimitive(x), y) }
1527
+ if tx == String.self || tx == Double.self, jsClassShape(of: y)?.script == true { return jsLooseEquals(x, jsToPrimitive(y)) }
1528
+ }
1529
+ let aNullish = a == nil || a is JSNull
1530
+ let bNullish = b == nil || b is JSNull
1531
+ if aNullish || bNullish { return aNullish && bNullish }
1532
+ guard let x = a, let y = b else { return false }
1533
+ // ToPrimitive leaves a primitive as it is, and a symbol equals no primitive but itself.
1534
+ if x is JSSymbol || y is JSSymbol { return jsStrictEquals(jsToPrimitive(x), jsToPrimitive(y)) }
1535
+ if jsIsOpaqueObject(x) && jsIsOpaqueObject(y) { return jsStrictEquals(x, y) }
1536
+ if let big = x as? JSBigInt { return jsBigIntLooseEquals(big, y) }
1537
+ if let big = y as? JSBigInt { return jsBigIntLooseEquals(big, x) }
1538
+ if let m = jsNumeric(x), let n = jsNumeric(y) { return m == n }
1539
+ if let s = x as? String, let t = y as? String { return jsStringEquals(s, t) }
1540
+ if let p = x as? Bool, let q = y as? Bool { return p == q }
1541
+ if x is Bool { return jsLooseEquals(jsToNumber(x), y) }
1542
+ if y is Bool { return jsLooseEquals(x, jsToNumber(y)) }
1543
+ if let n = jsNumeric(x), let t = y as? String { return n == jsNumberFromString(t) }
1544
+ if let s = x as? String, let n = jsNumeric(y) { return jsNumberFromString(s) == n }
1545
+ let xPrimitive = x is String || jsNumeric(x) != nil
1546
+ let yPrimitive = y is String || jsNumeric(y) != nil
1547
+ if jsIsObject(x) && yPrimitive { return jsLooseEquals(jsToPrimitive(x), y) }
1548
+ if xPrimitive && jsIsObject(y) { return jsLooseEquals(x, jsToPrimitive(y)) }
1549
+ return jsStrictEquals(x, y)
1550
+ }
1551
+
1552
+ /// OrdinaryToPrimitive over an object literal's own `valueOf` and `toString`, in the order the hint asks; nil stands for
1553
+ /// Object.prototype's (a `valueOf` giving the object itself, a `toString` giving "[object Object]").
1554
+ public func jsOrdinaryToPrimitive(_ hint: String, valueOf: (() throws -> Any?)?, toString: (() throws -> Any?)?) throws -> Any? {
1555
+ let inherited: () throws -> Any? = { "[object Object]" }
1556
+ for method in hint == "string" ? [toString ?? inherited, valueOf] : [valueOf, toString ?? inherited] {
1557
+ guard let method else { continue }
1558
+ let result = jsFlat(try method())
1559
+ if result == nil || !jsIsObject(result!) || result is JSNull || result is JSSymbol || result is JSBigInt { return result }
1560
+ }
1561
+ throw JSException(JSTypeError("Cannot convert object to primitive value"))
1562
+ }
1563
+
1564
+ /// ToPrimitive with the default hint: objects become their string form.
1565
+ func jsToPrimitive(_ value: Any?) -> Any? {
1566
+ guard let v = jsFlat(value) else { return nil }
1567
+ if jsClassShape(of: v)?.script == true {
1568
+ if let user = jsUserPrimitive(v, "default") { return user }
1569
+ return jsToString(v)
1570
+ }
1571
+ switch v {
1572
+ case is String, is Bool, is JSNull, is JSSymbol, is JSBigInt: return v
1573
+ default:
1574
+ if let n = jsNumeric(v) { return n }
1575
+ if let user = jsUserPrimitive(v, "default") { return user }
1576
+ return jsToString(v)
1577
+ }
1578
+ }
1579
+
1580
+ /// `a < b` of values typed only at run time: two strings compare by code units, anything else as
1581
+ /// numbers. Nil when either is NaN, where every comparison is false: `a <= b` is `jsGreaterThan(a, b) == false`.
1582
+ public func jsLessThan(_ a: Any?, _ b: Any?) -> Bool? {
1583
+ func primitive(_ value: Any?) -> Any? {
1584
+ guard let v = jsFlat(value) else { return nil }
1585
+ switch v {
1586
+ case is String, is Bool, is JSNull, is JSSymbol, is JSBigInt: return v
1587
+ case let date as JSDate: return date.time
1588
+ default:
1589
+ if let n = jsNumeric(v) { return n }
1590
+ if let user = jsUserPrimitive(v, "number") { return user }
1591
+ return jsToString(v)
1592
+ }
1593
+ }
1594
+ let x = primitive(a), y = primitive(b)
1595
+ if let x = x as? String, let y = y as? String { return jsCompare(x, y) < 0 }
1596
+ let m = jsToNumber(x), n = jsToNumber(y)
1597
+ return m.isNaN || n.isNaN ? nil : m < n
1598
+ }
1599
+
1600
+ /// `a > b` of values typed only at run time, as `jsLessThan`.
1601
+ public func jsGreaterThan(_ a: Any?, _ b: Any?) -> Bool? { jsLessThan(b, a) }
1602
+
1603
+ /// A value code checked without strictNullChecks declares a boolean, as its uses read it: by truthiness.
1604
+ public func jsLenientBool(_ value: Any?) -> Bool {
1605
+ if let b = value as? Bool { return b }
1606
+ return jsTruthy(value)
1607
+ }
1608
+
1609
+ /// A value code checked without strictNullChecks declares a number, converted as JavaScript converts it where
1610
+ /// it is used: undefined is NaN (an unset style's `font-size: ${fontSize}px` is no size), null is 0.
1611
+ public func jsLenientNumber(_ value: Any?) -> Double {
1612
+ if let d = value as? Double { return d }
1613
+ return jsToNumber(value)
1614
+ }
1615
+
1616
+ /// A value code checked without strictNullChecks declares a string: undefined and null are "", anything else converts.
1617
+ public func jsLenientString(_ value: Any?) -> String {
1618
+ if let s = value as? String { return s }
1619
+ return jsIsNullish(value) ? "" : jsToString(value)
1620
+ }
1621
+
1622
+ /// `jsLenientBool`, `jsLenientNumber` and `jsLenientString` where the declared type is optional: undefined and null stay nil.
1623
+ public func jsLenientBoolOrNil(_ value: Any?) -> Bool? { jsIsNullish(value) ? nil : jsLenientBool(value) }
1624
+ public func jsLenientNumberOrNil(_ value: Any?) -> Double? { jsIsNullish(value) ? nil : jsLenientNumber(value) }
1625
+ public func jsLenientStringOrNil(_ value: Any?) -> String? { jsIsNullish(value) ? nil : jsLenientString(value) }
1626
+
1627
+ /// An untyped value asserted to a string, number or boolean: a value `jsTypeof` calls that type passes, in
1628
+ /// whatever representation it has (an NSString, an `Int8`, a CFBoolean), an empty state reads as
1629
+ /// `jsLenientString`/`jsLenientNumber`/`jsLenientBool` read it, and any other value is JavaScript's TypeError there
1630
+ /// rather than a converted one. Only a Swift struct takes the plain cast: an NSNumber casts to `Bool` and `Double` alike.
1631
+ public func jsCheckedString(_ value: Any?) throws -> String {
1632
+ let v = jsFlat(value)
1633
+ if let v, jsTypeKind(v) == .struct, let s = v as? String { return s }
1634
+ if jsIsNullish(v) { return "" }
1635
+ if jsTypeof(v) == "string" { return jsToString(v) }
1636
+ throw jsCastFailure(v, "string")
1637
+ }
1638
+ public func jsCheckedNumber(_ value: Any?) throws -> Double {
1639
+ let v = jsFlat(value)
1640
+ if let v, jsTypeKind(v) == .struct, let d = v as? Double { return d }
1641
+ if jsIsNullish(v) || jsTypeof(v) == "number" { return jsToNumber(v) }
1642
+ throw jsCastFailure(v, "number")
1643
+ }
1644
+ public func jsCheckedBool(_ value: Any?) throws -> Bool {
1645
+ let v = jsFlat(value)
1646
+ if let v, jsTypeKind(v) == .struct, let b = v as? Bool { return b }
1647
+ if jsIsNullish(v) { return false }
1648
+ if jsTypeof(v) == "boolean" { return jsIsTruthy(v) }
1649
+ throw jsCastFailure(v, "boolean")
1650
+ }
1651
+ public func jsCheckedStringOrNil(_ value: Any?) throws -> String? { jsIsNullish(value) ? nil : try jsCheckedString(value) }
1652
+ public func jsCheckedNumberOrNil(_ value: Any?) throws -> Double? { jsIsNullish(value) ? nil : try jsCheckedNumber(value) }
1653
+ public func jsCheckedBoolOrNil(_ value: Any?) throws -> Bool? { jsIsNullish(value) ? nil : try jsCheckedBool(value) }
1654
+ /// As `jsCheckedNumberOrNil` and `jsLenientNumberOrNil` for a built-in's optional number parameter: nil only where the
1655
+ /// value is undefined, since null converts (to 0).
1656
+ public func jsCheckedNumberOrUndefined(_ value: Any?) throws -> Double? { jsFlat(value) == nil ? nil : try jsCheckedNumber(value) }
1657
+ public func jsLenientNumberOrUndefined(_ value: Any?) -> Double? { jsFlat(value) == nil ? nil : jsLenientNumber(value) }
1658
+
1659
+ /// Core's own code (the kit) given an untyped value where it declares a string, number or boolean: a value of the type
1660
+ /// passes, another primitive converts as `String()`, `Number()` and `Boolean()` do (`Number()` of a symbol is its
1661
+ /// TypeError), undefined, null and an empty marker (`jsEmptyMarker`) read as `jsLenientString`, `jsLenientNumber` and
1662
+ /// `jsLenientBool` read them, and any other value is JavaScript's TypeError there.
1663
+ public func jsConvertedString(_ value: Any?) throws -> String {
1664
+ if let s = value as? String { return s }
1665
+ let v = try jsCorePrimitive(value, "string")
1666
+ return jsIsNullish(v) ? "" : jsToString(v)
1667
+ }
1668
+ public func jsConvertedNumber(_ value: Any?) throws -> Double {
1669
+ if let d = value as? Double { return d }
1670
+ let v = try jsCorePrimitive(value, "number")
1671
+ if v is JSSymbol { throw JSException(JSTypeError("Cannot convert a Symbol value to a number")) }
1672
+ return jsToNumber(v)
1673
+ }
1674
+ public func jsConvertedBool(_ value: Any?) throws -> Bool {
1675
+ if let b = value as? Bool { return b }
1676
+ return jsIsTruthy(try jsCorePrimitive(value, "boolean"))
1677
+ }
1678
+ public func jsConvertedStringOrNil(_ value: Any?) throws -> String? { jsIsNullish(value) || jsIsEmptyMarker(value) ? nil : try jsConvertedString(value) }
1679
+ public func jsConvertedNumberOrNil(_ value: Any?) throws -> Double? { jsIsNullish(value) || jsIsEmptyMarker(value) ? nil : try jsConvertedNumber(value) }
1680
+ public func jsConvertedBoolOrNil(_ value: Any?) throws -> Bool? { jsIsNullish(value) || jsIsEmptyMarker(value) ? nil : try jsConvertedBool(value) }
1681
+
1682
+ /// The value `jsConverted*` converts: an empty marker as undefined, a primitive as it is, anything else a TypeError.
1683
+ @inline(never)
1684
+ private func jsCorePrimitive(_ value: Any?, _ type: String) throws -> Any? {
1685
+ guard let v = jsFlat(value), !(v is JSNull) else { return jsFlat(value) }
1686
+ if jsIsEmptyMarker(v) { return nil }
1687
+ switch jsTypeof(v) {
1688
+ case "string", "number", "boolean", "bigint", "symbol": return v
1689
+ case "undefined": return nil
1690
+ default: throw jsNotA(v, type)
1691
+ }
1692
+ }
1693
+
1694
+ enum JSEmptyMarkers {
1695
+ static var all: [AnyObject] = []
1696
+ }
1697
+
1698
+ /// A value core makes only to be told apart by identity (`unsetValue`), which its checked converts read as an empty value.
1699
+ public func jsEmptyMarker<T>(_ value: T) -> T {
1700
+ if let v = jsFlat(value), Swift.type(of: v) is AnyClass { JSEmptyMarkers.all.append(v as AnyObject) }
1701
+ return value
1702
+ }
1703
+
1704
+ func jsIsEmptyMarker(_ value: Any?) -> Bool {
1705
+ guard !JSEmptyMarkers.all.isEmpty, let v = jsFlat(value), Swift.type(of: v) is AnyClass else { return false }
1706
+ let object = v as AnyObject
1707
+ return JSEmptyMarkers.all.contains { $0 === object }
1708
+ }
1709
+
1710
+ /// An untyped value asserted to an array of strings, numbers or booleans: an array's elements each checked by
1711
+ /// `element`, an empty state read as `jsArrayFrom` reads it, and any other value JavaScript's TypeError there.
1712
+ public func jsCheckedArray<T>(_ value: Any?, _ element: (Any?) throws -> T) throws -> JSArray<T> {
1713
+ let v = jsFlat(value)
1714
+ if jsIsNullish(v) || v is JSArrayProtocol { return try jsArrayFrom(v, element) }
1715
+ throw JSException(JSTypeError("\(jsTypeof(v)) is not an array"))
1716
+ }
1717
+
1718
+ /// A value's string where one must be given: undefined and null are "".
1719
+ public func jsStringOrEmpty(_ value: Any?) -> String { jsIsNullish(value) ? "" : jsToString(value) }
1720
+
1721
+ /// An untyped value converted by `convert`, where the type it is read as is optional: undefined and null stay nil.
1722
+ public func jsUnlessNullish<T>(_ value: Any?, _ convert: (Any?) throws -> T) rethrows -> T? {
1723
+ jsIsNullish(value) ? nil : try convert(value)
1724
+ }
1725
+
1726
+ /// A `+` operand beside a string: ToString(ToPrimitive(value, default)).
1727
+ public func jsToStringDefault(_ value: Any?) -> String { jsToString(jsToPrimitive(value)) }
1728
+
1729
+ /// `Number(value)` / unary `+`.
1730
+ public func jsToNumber(_ value: Any?) -> Double {
1731
+ switch jsFlat(value) {
1732
+ case nil: return .nan
1733
+ case let d as Double: return d
1734
+ case let s as String: return jsNumberFromString(s)
1735
+ case let b as Bool: return b ? 1 : 0
1736
+ case is JSNull: return 0
1737
+ case let big as JSBigInt: return big.toDouble()
1738
+ case let v?:
1739
+ if let n = jsNumeric(v) { return n }
1740
+ if jsIsFunction(v) || v is JSSymbol { return .nan }
1741
+ if let user = jsUserPrimitive(v, "number") { return jsToNumber(user) }
1742
+ return jsNumberFromString(jsToString(v))
1743
+ }
1744
+ }
1745
+
1746
+ enum JSJoinGuard {
1747
+ static var active: [ObjectIdentifier] = []
1748
+ }
1749
+
1750
+ /// `String(value)`: arrays join with ",", plain objects are "[object Object]", errors "Name: message".
1751
+ public func jsToString(_ value: Any?) -> String {
1752
+ let value = jsFlat(value)
1753
+ if let object = value, jsIsOpaqueObject(object) { return jsObjectToString(object) }
1754
+ switch value {
1755
+ case nil: return "undefined"
1756
+ case let s as String: return s
1757
+ // A CFBoolean also casts to Double.
1758
+ case let d as Double: return jsNativeBoolean(value!).map { $0 ? "true" : "false" } ?? jsNumberToString(d)
1759
+ case let b as Bool: return b ? "true" : "false"
1760
+ case let v?: return jsObjectToString(v)
1761
+ }
1762
+ }
1763
+
1764
+ /// `String(value)` of what is not undefined, a string, a number or a boolean.
1765
+ private func jsObjectToString(_ value: Any) -> String {
1766
+ if jsIsClassObject(value), let cls = value as? Any.Type { return jsClassString(cls) }
1767
+ switch value {
1768
+ case is JSNull: return "null"
1769
+ case let v as JSToPrimitive: return jsToString(jsUserPrimitive(v, "string") ?? nil)
1770
+ case let v as JSStringConvertible:
1771
+ // What the conversion throws is reported, as for a `[Symbol.toPrimitive]` method.
1772
+ do { return try v.toString() } catch { jsReportUncaught(jsCaught(error)); return "undefined" }
1773
+ case let symbol as JSSymbol: return symbol.toString()
1774
+ case let big as JSBigInt: return big.toString()
1775
+ case let tagged as JSToStringTag: return "[object \(tagged.jsToStringTag)]"
1776
+ case let error as JSError: return error.jsErrorString
1777
+ case let array as JSArrayProtocol: return array.jsJoin(",")
1778
+ case is JSMapProtocol: return "[object Map]"
1779
+ case is JSSetProtocol: return "[object Set]"
1780
+ case is JSThenable: return "[object Promise]"
1781
+ case let v:
1782
+ if let n = jsNumeric(v) { return jsNumberToString(n) }
1783
+ // An entry pair (`[key, value]`) Swift holds as a tuple is the array script made it as.
1784
+ if jsIsTuple(v) {
1785
+ return Mirror(reflecting: v).children.map { (child) -> String in
1786
+ let element = jsFlat(child.value)
1787
+ return element == nil || element is JSNull ? "" : jsToString(element)
1788
+ }.joined(separator: ",")
1789
+ }
1790
+ if jsIsFunction(v) { return "function () { [native code] }" }
1791
+ if jsIsObject(v) { return jsStringTag(v).map { "[object \($0)]" } ?? "[object Object]" }
1792
+ return String(describing: v)
1793
+ }
1794
+ }
1795
+
1796
+ /// `a + b`: string concatenation when either side is (or converts to) a string, else numeric addition.
1797
+ public func jsAdd(_ a: Any?, _ b: Any?) -> Any? {
1798
+ let x = jsToPrimitive(a), y = jsToPrimitive(b)
1799
+ if x is String || y is String { return jsToString(x) + jsToString(y) }
1800
+ return jsToNumber(x) + jsToNumber(y)
1801
+ }
1802
+
1803
+ // MARK: - Conversions of operands held untyped
1804
+ // What an operator converts where the compiler holds an operand untyped. Unlike the conversions above, which report what
1805
+ // a value's own conversion throws, these throw it, and they throw JavaScript's TypeErrors (a BigInt beside a number, a
1806
+ // Symbol as a number or string); a site that calls one is `try`.
1807
+
1808
+ /// ToPrimitive (`jsToPrimitive`) where what the value's own conversion throws is thrown.
1809
+ func jsToPrimitiveThrowing(_ value: Any?, _ hint: String) throws -> Any? {
1810
+ guard let v = jsFlat(value) else { return nil }
1811
+ switch v {
1812
+ case is String, is Bool, is JSNull, is JSSymbol, is JSBigInt: return v
1813
+ default:
1814
+ if let n = jsNumeric(v) { return n }
1815
+ if let user = try jsUserPrimitiveThrowing(v, hint) { return user }
1816
+ return try jsToStringThrowing(v)
1817
+ }
1818
+ }
1819
+
1820
+ /// ToNumeric: a BigInt as it is, anything else its number (`jsToNumber`).
1821
+ private func jsNumericOf(_ value: Any?) throws -> Any {
1822
+ let v = jsFlat(value)
1823
+ switch v {
1824
+ case let big as JSBigInt: return big
1825
+ case is JSSymbol: throw JSException(JSTypeError("Cannot convert a Symbol value to a number"))
1826
+ case nil, is String, is Double, is Bool, is JSNull: return jsToNumber(v)
1827
+ case let object?:
1828
+ if jsNumeric(object) != nil || jsIsFunction(object) { return jsToNumber(object) }
1829
+ if let user = try jsUserPrimitiveThrowing(object, "number") { return try jsNumericOf(user) }
1830
+ if !(object is JSDate), let convertible = object as? JSStringConvertible { return try jsNumericOf(convertible.toString()) }
1831
+ return jsToNumber(object)
1832
+ }
1833
+ }
1834
+
1835
+ private func jsMixedBigInt() -> JSException { JSException(JSTypeError("Cannot mix BigInt and other types, use explicit conversions")) }
1836
+
1837
+ /// `a + b`: as `jsAdd`; two BigInts add as BigInts, and a BigInt beside a number is a TypeError.
1838
+ public func jsAddThrowing(_ a: Any?, _ b: Any?) throws -> Any? {
1839
+ let x = try jsToPrimitiveThrowing(a, "default"), y = try jsToPrimitiveThrowing(b, "default")
1840
+ if x is String || y is String { return try jsToStringThrowing(x) + jsToStringThrowing(y) }
1841
+ let m = try jsNumericOf(x), n = try jsNumericOf(y)
1842
+ switch (m, n) {
1843
+ case let (p as JSBigInt, q as JSBigInt): return p + q
1844
+ case (is JSBigInt, _), (_, is JSBigInt): throw jsMixedBigInt()
1845
+ default: return jsToNumber(m) + jsToNumber(n)
1846
+ }
1847
+ }
1848
+
1849
+ /// `op` on two operands' numbers: two BigInts give `op` of their numbers, and a BigInt beside a number is a TypeError.
1850
+ private func jsNumericThrowing(_ a: Any?, _ b: Any?, _ op: (Double, Double) -> Double) throws -> Double {
1851
+ let m = try jsNumericOf(a), n = try jsNumericOf(b)
1852
+ switch (m, n) {
1853
+ case let (p as JSBigInt, q as JSBigInt): return op(p.toDouble(), q.toDouble())
1854
+ case (is JSBigInt, _), (_, is JSBigInt): throw jsMixedBigInt()
1855
+ default: return op(jsToNumber(m), jsToNumber(n))
1856
+ }
1857
+ }
1858
+
1859
+ /// The numeric and bitwise operators where an operand is held untyped.
1860
+ public func jsSubtractThrowing(_ a: Any?, _ b: Any?) throws -> Double { try jsNumericThrowing(a, b, -) }
1861
+ public func jsMultiplyThrowing(_ a: Any?, _ b: Any?) throws -> Double { try jsNumericThrowing(a, b, *) }
1862
+ public func jsDivideThrowing(_ a: Any?, _ b: Any?) throws -> Double { try jsNumericThrowing(a, b, /) }
1863
+ public func jsRemainderThrowing(_ a: Any?, _ b: Any?) throws -> Double { try jsNumericThrowing(a, b, jsMod) }
1864
+ public func jsExponentThrowing(_ a: Any?, _ b: Any?) throws -> Double { try jsNumericThrowing(a, b, jsPow) }
1865
+ public func jsBitAndThrowing(_ a: Any?, _ b: Any?) throws -> Double { try jsNumericThrowing(a, b, jsBitAnd) }
1866
+ public func jsBitOrThrowing(_ a: Any?, _ b: Any?) throws -> Double { try jsNumericThrowing(a, b, jsBitOr) }
1867
+ public func jsBitXorThrowing(_ a: Any?, _ b: Any?) throws -> Double { try jsNumericThrowing(a, b, jsBitXor) }
1868
+ public func jsShiftLeftThrowing(_ a: Any?, _ b: Any?) throws -> Double { try jsNumericThrowing(a, b, jsShiftLeft) }
1869
+ public func jsShiftRightThrowing(_ a: Any?, _ b: Any?) throws -> Double { try jsNumericThrowing(a, b, jsShiftRight) }
1870
+ public func jsShiftRightUnsignedThrowing(_ a: Any?, _ b: Any?) throws -> Double { try jsNumericThrowing(a, b, jsShiftRightUnsigned) }
1871
+
1872
+ /// `op` where its value is held untyped: two BigInts give `big` of them, and a BigInt beside a number is a TypeError.
1873
+ private func jsNumericUntypedThrowing(_ a: Any?, _ b: Any?, _ op: (Double, Double) -> Double, _ big: (JSBigInt, JSBigInt) throws -> JSBigInt) throws -> Any? {
1874
+ let m = try jsNumericOf(a), n = try jsNumericOf(b)
1875
+ switch (m, n) {
1876
+ case let (p as JSBigInt, q as JSBigInt): return try big(p, q)
1877
+ case (is JSBigInt, _), (_, is JSBigInt): throw jsMixedBigInt()
1878
+ default: return op(jsToNumber(m), jsToNumber(n))
1879
+ }
1880
+ }
1881
+
1882
+ /// The numeric and bitwise operators where both operands are held untyped or BigInts and the value is held untyped.
1883
+ public func jsSubtractUntypedThrowing(_ a: Any?, _ b: Any?) throws -> Any? { try jsNumericUntypedThrowing(a, b, -, { $0 - $1 }) }
1884
+ public func jsMultiplyUntypedThrowing(_ a: Any?, _ b: Any?) throws -> Any? { try jsNumericUntypedThrowing(a, b, *, { $0 * $1 }) }
1885
+ public func jsDivideUntypedThrowing(_ a: Any?, _ b: Any?) throws -> Any? { try jsNumericUntypedThrowing(a, b, /, JSBigInt.divide) }
1886
+ public func jsRemainderUntypedThrowing(_ a: Any?, _ b: Any?) throws -> Any? { try jsNumericUntypedThrowing(a, b, jsMod, JSBigInt.remainder) }
1887
+ public func jsExponentUntypedThrowing(_ a: Any?, _ b: Any?) throws -> Any? { try jsNumericUntypedThrowing(a, b, jsPow, JSBigInt.power) }
1888
+ public func jsBitAndUntypedThrowing(_ a: Any?, _ b: Any?) throws -> Any? { try jsNumericUntypedThrowing(a, b, jsBitAnd, { $0 & $1 }) }
1889
+ public func jsBitOrUntypedThrowing(_ a: Any?, _ b: Any?) throws -> Any? { try jsNumericUntypedThrowing(a, b, jsBitOr, { $0 | $1 }) }
1890
+ public func jsBitXorUntypedThrowing(_ a: Any?, _ b: Any?) throws -> Any? { try jsNumericUntypedThrowing(a, b, jsBitXor, { $0 ^ $1 }) }
1891
+ public func jsShiftLeftUntypedThrowing(_ a: Any?, _ b: Any?) throws -> Any? { try jsNumericUntypedThrowing(a, b, jsShiftLeft, JSBigInt.shiftLeft) }
1892
+ public func jsShiftRightUntypedThrowing(_ a: Any?, _ b: Any?) throws -> Any? { try jsNumericUntypedThrowing(a, b, jsShiftRight, JSBigInt.shiftRight) }
1893
+ public func jsShiftRightUnsignedUntypedThrowing(_ a: Any?, _ b: Any?) throws -> Any? {
1894
+ try jsNumericUntypedThrowing(a, b, jsShiftRightUnsigned, { _, _ in throw JSException(JSTypeError("BigInts have no unsigned right shift, use >> instead")) })
1895
+ }
1896
+
1897
+ /// Unary `+`: ToNumber, a TypeError for a BigInt.
1898
+ public func jsToNumberThrowing(_ value: Any?) throws -> Double {
1899
+ let n = try jsNumericOf(value)
1900
+ if n is JSBigInt { throw JSException(JSTypeError("Cannot convert a BigInt value to a number")) }
1901
+ return jsToNumber(n)
1902
+ }
1903
+
1904
+ /// `n += value` for a number `n`: ToNumeric of value, a BigInt beside the number a TypeError.
1905
+ public func jsNumberAddendThrowing(_ value: Any?) throws -> Double {
1906
+ let n = try jsNumericOf(value)
1907
+ if n is JSBigInt { throw jsMixedBigInt() }
1908
+ return jsToNumber(n)
1909
+ }
1910
+
1911
+ /// A number method's argument held untyped: undefined stays absent, anything else converts by `jsToNumberThrowing`.
1912
+ public func jsToNumberOrUndefinedThrowing(_ value: Any?) throws -> Double? { jsFlat(value) == nil ? nil : try jsToNumberThrowing(value) }
1913
+
1914
+ /// Unary `-` and `~`: ToNumeric, a BigInt as its number.
1915
+ public func jsToNumericThrowing(_ value: Any?) throws -> Double {
1916
+ let n = try jsNumericOf(value)
1917
+ return (n as? JSBigInt)?.toDouble() ?? jsToNumber(n)
1918
+ }
1919
+
1920
+ /// A `+` operand beside a string: ToString(ToPrimitive(value, default)).
1921
+ public func jsToStringDefaultThrowing(_ value: Any?) throws -> String {
1922
+ try jsToStringThrowing(jsToPrimitiveThrowing(value, "default"))
1923
+ }
1924
+
1925
+ /// A template literal's substitution: ToString, a TypeError for a Symbol.
1926
+ public func jsToStringThrowing(_ value: Any?) throws -> String {
1927
+ switch jsFlat(value) {
1928
+ case is JSSymbol: throw JSException(JSTypeError("Cannot convert a Symbol value to a string"))
1929
+ case let v as JSToPrimitive: return try jsToStringThrowing(jsUserPrimitiveThrowing(v, "string") ?? nil)
1930
+ case let v as JSStringConvertible: return try v.toString()
1931
+ default: return jsToString(value)
1932
+ }
1933
+ }
1934
+
1935
+ /// `String(value)`: a Symbol its description, anything else ToString (`jsToStringThrowing`).
1936
+ public func jsStringThrowing(_ value: Any?) throws -> String {
1937
+ if let symbol = jsFlat(value) as? JSSymbol { return symbol.toString() }
1938
+ return try jsToStringThrowing(value)
1939
+ }
1940
+
1941
+ /// IsLessThan(a, b): ToPrimitive (number) of `a` then `b` where `leftFirst`, else `b` then `a`; two strings by code units,
1942
+ /// anything else as numbers (a Symbol a TypeError). Nil where either is NaN, as `jsLessThan`.
1943
+ private func jsLessThanThrowing(_ a: Any?, _ b: Any?, leftFirst: Bool) throws -> Bool? {
1944
+ func primitive(_ value: Any?) throws -> Any? {
1945
+ if let date = jsFlat(value) as? JSDate { return date.time }
1946
+ return try jsToPrimitiveThrowing(value, "number")
1947
+ }
1948
+ let x: Any?, y: Any?
1949
+ if leftFirst { x = try primitive(a); y = try primitive(b) } else { y = try primitive(b); x = try primitive(a) }
1950
+ if let x = x as? String, let y = y as? String { return jsCompare(x, y) < 0 }
1951
+ if x is JSSymbol || y is JSSymbol { throw JSException(JSTypeError("Cannot convert a Symbol value to a number")) }
1952
+ let m = jsToNumber(x), n = jsToNumber(y)
1953
+ return m.isNaN || n.isNaN ? nil : m < n
1954
+ }
1955
+
1956
+ /// The relational operators where an operand's conversion may throw.
1957
+ public func jsLessThrowing(_ a: Any?, _ b: Any?) throws -> Bool { try jsLessThanThrowing(a, b, leftFirst: true) == true }
1958
+ public func jsGreaterThrowing(_ a: Any?, _ b: Any?) throws -> Bool { try jsLessThanThrowing(b, a, leftFirst: false) == true }
1959
+ public func jsLessOrEqualThrowing(_ a: Any?, _ b: Any?) throws -> Bool { try jsLessThanThrowing(b, a, leftFirst: false) == false }
1960
+ public func jsGreaterOrEqualThrowing(_ a: Any?, _ b: Any?) throws -> Bool { try jsLessThanThrowing(a, b, leftFirst: true) == false }
1961
+
1962
+ extension JSArrayProtocol {
1963
+ func jsJoin(_ separator: String) -> String {
1964
+ let id = ObjectIdentifier(self)
1965
+ if JSJoinGuard.active.contains(id) { return "" }
1966
+ JSJoinGuard.active.append(id)
1967
+ defer { JSJoinGuard.active.removeLast() }
1968
+ var out = ""
1969
+ for (i, element) in jsAnyElements.enumerated() {
1970
+ if i > 0 { out += separator }
1971
+ if element == nil || element is JSNull { continue }
1972
+ out += jsToString(element)
1973
+ }
1974
+ return out
1975
+ }
1976
+ }
1977
+
1978
+ /// `f?.(args)` on an untyped value: undefined when `f` is undefined or null.
1979
+ @discardableResult
1980
+ public func jsCallOptional(_ function: Any?, _ arguments: Any?...) throws -> Any? {
1981
+ try jsCallOptional(function, spread: arguments)
1982
+ }
1983
+
1984
+ @discardableResult
1985
+ public func jsCallOptional(_ function: Any?, spread arguments: [Any?]) throws -> Any? {
1986
+ if jsIsNullish(function) { return nil }
1987
+ return try jsCall(function, spread: arguments)
1988
+ }
1989
+
1990
+ public let jsStringConstructor = jsBuiltinFunction("String", 1, { a in a.isEmpty ? "" : jsToString(a[0]) }, [])
1991
+ public let jsNumberConstructor = jsBuiltinFunction("Number", 1, { a in a.isEmpty ? 0.0 : jsToNumber(a[0]) }, [])
1992
+ public let jsBooleanConstructor = jsBuiltinFunction("Boolean", 1, { a in jsTruthy(jsArg(a, 0)) }, [])
1993
+
1994
+ public let jsDateBuiltin = JSObject([
1995
+ ("now", jsFunction("now", 0) { _ in JSDate.now() }),
1996
+ ])
1997
+
1998
+ /// `Array` held as a value: callable without `new` (`Array(3)`), as script's is.
1999
+ public let jsArrayBuiltin = jsBuiltinFunction("Array", 1, { a in try jsArrayConstruct(a) }, [
2000
+ ("isArray", jsFunction("isArray", 1) { a in JSArray<Any?>.isArray(jsArg(a, 0)) }),
2001
+ ])
2002
+
2003
+ private func jsBuiltinFunction(_ name: String, _ length: Int, _ body: @escaping ([Any?]) throws -> Any?, _ members: [(String, Any?)]) -> JSFunctionObject {
2004
+ let function = JSFunctionObject(name, length) { _, a in try body(a) }
2005
+ for (key, value) in members { function[jsKey: key] = value }
2006
+ return function
2007
+ }
2008
+
2009
+ /// `globalThis` read as an object: the runtime's globals (`NativeScriptRuntime`, `com.tns`) are not
2010
+ /// in a native app, so reading one gives undefined. `DOMException`, which core's fetch reads from it, is there.
2011
+ public let jsGlobalThis = JSObject([("DOMException", jsDOMExceptionConstructor), ("performance", jsDateBuiltin)])
2012
+
2013
+ /// `Object` held as a value (`(<any>Object).entries(o)`): its functions over objects, called as script calls them.
2014
+ public let jsObjectBuiltin = jsBuiltinFunction("Object", 1, { a in jsIsNullish(jsArg(a, 0)) ? JSObject() : jsArg(a, 0) }, [
2015
+ ("keys", jsFunction("keys", 1) { a in jsObjectKeys(jsArg(a, 0)) }),
2016
+ ("values", jsFunction("values", 1) { a in jsObjectValues(jsArg(a, 0)) }),
2017
+ ("entries", jsFunction("entries", 1) { a in JSArray<Any?>(jsObjectEntries(jsArg(a, 0)).storage.map { JSArray<Any?>([$0.0, $0.1]) as Any? }) }),
2018
+ ("assign", jsFunction("assign", 2) { a in try jsObjectAssign(jsArg(a, 0), spread: Array(a.dropFirst())) }),
2019
+ ("getPrototypeOf", jsFunction("getPrototypeOf", 1) { a in try jsGetPrototypeOf(jsArg(a, 0)) }),
2020
+ ("prototype", JSPrototypes.objectPrototype),
2021
+ ])
2022
+
2023
+ /// Lenient code: a value that may be undefined where its type says an object. It stays optional; a member read
2024
+ /// of it goes through `jsUnwrap`, JavaScript's TypeError where it is missing.
2025
+ @inline(__always)
2026
+ public func jsImplicit<T>(_ value: T?) -> T? { value }
2027
+
2028
+ /// `value instanceof Name` for a class the kit knows only by that name (`FormData`, which the runtime's globals
2029
+ /// take from core): an object of a kit class of the name, or of a subclass of one. A class whose name another
2030
+ /// of core's took is named `Name__file`.
2031
+ public func jsInstanceOfNamed(_ value: Any?, _ name: String) -> Bool {
2032
+ guard let object = jsIdentity(jsFlat(value)), Mirror(reflecting: object).displayStyle == .class else { return false }
2033
+ var cls: AnyClass? = type(of: object as AnyObject)
2034
+ while let c = cls {
2035
+ if String(describing: c).components(separatedBy: "__")[0] == name { return true }
2036
+ cls = class_getSuperclass(c)
2037
+ }
2038
+ return false
2039
+ }
2040
+
2041
+ /// `value.constructor.name`: the name of the class that made the value.
2042
+ public func jsConstructorName(_ value: Any?) -> String {
2043
+ let v = jsFlat(value)
2044
+ // An error's class, not its `name` (which a subclass leaves as its base's unless it sets it).
2045
+ if let error = v as? JSError { return jsClassValueName(type(of: error)) }
2046
+ if let dynamic = v as? JSDynamic, let name = dynamic.jsClassName { return name }
2047
+ switch v {
2048
+ case is String: return "String"
2049
+ case is Double: return "Number"
2050
+ case is Bool: return "Boolean"
2051
+ case nil: return ""
2052
+ default:
2053
+ let name = String(describing: type(of: v!))
2054
+ return name.split(separator: "__").first.map(String.init) ?? name
2055
+ }
2056
+ }
2057
+
2058
+
2059
+ /// An object of another type where code checked as core is passes it for a class
2060
+ /// (`rule.declarations` as `KeyframeDeclaration[]`): the value itself where it is
2061
+ /// one, else a new instance holding the value's own members, as script reads them
2062
+ /// from the value itself (a member undefined on a new instance is still the value's).
2063
+ public func jsShaped<T: AnyObject>(_ value: Any?, _ make: () throws -> T) -> T? {
2064
+ guard let v = jsFlat(value), !(v is JSNull) else { return nil }
2065
+ if let same = v as? T { return same }
2066
+ guard let made = try? make(), let keyed = made as? JSDynamic else { return nil }
2067
+ for key in jsKeysOf(v) { keyed[jsKey: key] = (try? jsGet(v, key)) ?? nil }
2068
+ return made
2069
+ }