@astryx-vue/core 0.42.0 → 0.42.2

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 (294) hide show
  1. package/dist/AlertDialog/index.js +1 -1
  2. package/dist/{AlertDialog-Cld8wc2u.js → AlertDialog-sk5DEUX7.js} +6 -6
  3. package/dist/AppShell/index.js +1 -1
  4. package/dist/{AppShell-Y-rwHGxA.js → AppShell-BkFP6tZb.js} +2 -2
  5. package/dist/Avatar/index.js +1 -1
  6. package/dist/{Avatar-z50mYJor.js → Avatar-BQz-P6TD.js} +1 -1
  7. package/dist/AvatarGroup/index.d.ts +1 -1
  8. package/dist/AvatarGroup/index.js +1 -1
  9. package/dist/{AvatarGroup-CU1zqtTi.js → AvatarGroup-BvJTbvr_.js} +1 -1
  10. package/dist/Banner/index.d.ts +1 -1
  11. package/dist/Banner/index.js +1 -1
  12. package/dist/{Banner-5KOS4fe8.js → Banner-CW4g5z40.js} +1 -1
  13. package/dist/BottomSheet/index.d.ts +1 -1
  14. package/dist/BottomSheet/index.js +2 -2
  15. package/dist/{BottomSheet-u57AJshc.js → BottomSheet-CpIDC6Wv.js} +1 -1
  16. package/dist/{BottomSheet-B8frtWqm.js → BottomSheet-ngtupehG.js} +7 -7
  17. package/dist/Breadcrumbs/index.js +2 -2
  18. package/dist/{Breadcrumbs-Bcrk04nL.js → Breadcrumbs-Bm8vn9Cv.js} +1 -1
  19. package/dist/Button/index.d.ts +1 -1
  20. package/dist/Button/index.js +1 -1
  21. package/dist/{Button-tVILPfaj.js → Button-CTVXQgV3.js} +4 -4
  22. package/dist/ButtonGroup/index.d.ts +1 -1
  23. package/dist/ButtonGroup/index.js +1 -1
  24. package/dist/{ButtonGroup-D7p8oEry.js → ButtonGroup-CknFA9IA.js} +2 -2
  25. package/dist/Calendar/index.d.ts +1 -1
  26. package/dist/Carousel/index.d.ts +1 -1
  27. package/dist/Carousel/index.js +1 -1
  28. package/dist/{Carousel-DlHeba5J.js → Carousel-B0ZOSlPH.js} +1 -1
  29. package/dist/Chat/index.d.ts +1 -1
  30. package/dist/Chat/index.js +1 -1
  31. package/dist/{Chat-B0jgkmWf.js → Chat-DqwHn6hi.js} +7 -7
  32. package/dist/CheckboxInput/index.d.ts +1 -1
  33. package/dist/CheckboxInput/index.js +1 -1
  34. package/dist/{CheckboxInput-BhKf3JOh.js → CheckboxInput-ChbqO3Hp.js} +4 -4
  35. package/dist/CheckboxList/index.d.ts +1 -1
  36. package/dist/CheckboxList/index.js +1 -1
  37. package/dist/{CheckboxListItem-DFCDLwLP.js → CheckboxListItem-3y4ehVhz.js} +5 -5
  38. package/dist/ClickableCard/index.d.ts +1 -1
  39. package/dist/ClickableCard/index.js +1 -1
  40. package/dist/{ClickableCard-DyBa2X4I.js → ClickableCard-Dkt25nJP.js} +1 -1
  41. package/dist/Code/index.js +2 -2
  42. package/dist/{Code-BtJV5J-h.js → Code-BWZ2fvkr.js} +1 -1
  43. package/dist/{CodeBlock-D1i3lEK3.js → CodeBlock-B__g42B_.js} +1 -1
  44. package/dist/Collapsible/index.js +1 -1
  45. package/dist/{Collapsible-CXbcOn80.js → Collapsible-DqEriJMb.js} +2 -2
  46. package/dist/CommandPalette/index.js +1 -1
  47. package/dist/{CommandPalette-DyjB9xE_.js → CommandPalette-CIpvefL3.js} +3 -3
  48. package/dist/ComplexSelector/index.js +1 -1
  49. package/dist/{ComplexSelector-MRuOupEd.js → ComplexSelector-CXEBaPbo.js} +2 -2
  50. package/dist/ContextMenu/index.d.ts +1 -1
  51. package/dist/ContextMenu/index.js +2 -2
  52. package/dist/{ContextMenu-JZUal7pu.js → ContextMenu-B9UlXANv.js} +5 -5
  53. package/dist/DateInput/index.d.ts +1 -1
  54. package/dist/DateInput/index.js +1 -1
  55. package/dist/{DateInput-B76O2ceL.js → DateInput-BMAcydbp.js} +5 -5
  56. package/dist/DateRangeInput/index.d.ts +1 -1
  57. package/dist/DateRangeInput/index.js +1 -1
  58. package/dist/{DateRangeInput-B8ZWK6sm.js → DateRangeInput-DLvd8izI.js} +3 -3
  59. package/dist/DateTimeInput/index.d.ts +1 -1
  60. package/dist/DateTimeInput/index.js +1 -1
  61. package/dist/{DateTimeInput-DOaPB2D4.js → DateTimeInput-Cq57Vm5c.js} +5 -5
  62. package/dist/Dialog/index.js +3 -3
  63. package/dist/{Dialog-CjN3cV-b.js → Dialog-6rKG9kce.js} +1 -1
  64. package/dist/{Dialog-B2-5xYs2.js → Dialog-CEbICn0m.js} +2 -2
  65. package/dist/{DialogHeader-B4cnOihd.js → DialogHeader-rLh39zHH.js} +2 -2
  66. package/dist/Drawer/index.d.ts +1 -1
  67. package/dist/Drawer/index.js +1 -1
  68. package/dist/{Drawer-dk9etcN3.js → Drawer-Dw1wyfvQ.js} +3 -3
  69. package/dist/DropdownMenu/index.js +2 -2
  70. package/dist/{DropdownMenu-Dqkyvelz.js → DropdownMenu-bFq5UM7K.js} +7 -7
  71. package/dist/EmptyState/index.js +1 -1
  72. package/dist/{EmptyState-uHOykbeo.js → EmptyState-DOMOEsvj.js} +2 -2
  73. package/dist/Field/index.js +3 -3
  74. package/dist/{Field-B_GThk2X.js → Field-DJGFZuwh.js} +1 -1
  75. package/dist/{FieldInfoTip-jhm02XZs.js → FieldInfoTip-l_ke1Zlh.js} +1 -1
  76. package/dist/{FieldLabel-C0XDwWCd.js → FieldLabel-BZiHqHsQ.js} +1 -1
  77. package/dist/FileInput/index.js +1 -1
  78. package/dist/{FileInput-CbXrw3RO.js → FileInput-BOT35CQc.js} +3 -3
  79. package/dist/{geometry-ae8bOxQ5.js → GestureHost-CRgadcBb.js} +2 -29
  80. package/dist/Heading/index.js +1 -1
  81. package/dist/{Heading-BFJhZInd.js → Heading-CsSZgiqn.js} +1 -1
  82. package/dist/HoverCard/index.js +1 -1
  83. package/dist/{HoverCard-Cbxy2KEM.js → HoverCard-BmehvS0D.js} +4 -4
  84. package/dist/IconButton/index.js +1 -1
  85. package/dist/{IconButton-CU1kvO7X.js → IconButton-89mASa8g.js} +1 -1
  86. package/dist/InfoTip/index.d.ts +1 -1
  87. package/dist/InfoTip/index.js +1 -1
  88. package/dist/{InfoTip-BwxUx7Hk.js → InfoTip-B_7kJX7x.js} +2 -2
  89. package/dist/{InputClearButton-CN8J7JOl.js → InputClearButton-BC1ytQT5.js} +1 -1
  90. package/dist/InputGroup/index.js +1 -1
  91. package/dist/{InputGroup-Ca-SOzyp.js → InputGroup-M3mSe3lV.js} +1 -1
  92. package/dist/InternationalizationProvider/index.d.ts +1 -1
  93. package/dist/InternationalizationProvider/index.js +1 -1
  94. package/dist/{InternationalizationProvider-Ddr5L4mQ.js → InternationalizationProvider-CfP0uroW.js} +1 -1
  95. package/dist/{Item-B6nYjAw3.js → Item-DznHXYbG.js} +7 -7
  96. package/dist/{LayerContentBoundary-tgsCvoNX.js → LayerContentBoundary-CMjCvF35.js} +1 -1
  97. package/dist/Layout/index.js +2 -2
  98. package/dist/{Layout-C7oS06UY.js → Layout-DlfCompe.js} +1 -1
  99. package/dist/{LayoutPanel-BwvUhSM5.js → LayoutPanel-DCDIV9LU.js} +2 -2
  100. package/dist/Lightbox/index.js +1 -1
  101. package/dist/{Lightbox-DCI-S6Ln.js → Lightbox-Ge25N7ec.js} +13 -12
  102. package/dist/Link/index.d.ts +1 -1
  103. package/dist/Link/index.js +1 -1
  104. package/dist/{Link-B5CJso43.js → Link-5KuMIFYl.js} +2 -2
  105. package/dist/List/index.d.ts +1 -1
  106. package/dist/List/index.js +4 -4
  107. package/dist/{List-DuWNjAKk.js → List-BVpWTW6J.js} +2 -2
  108. package/dist/{ListItem-BxQt4Emy.js → ListItem-BzOD8HbS.js} +3 -3
  109. package/dist/Markdown/index.d.ts +1 -1
  110. package/dist/Markdown/index.js +1 -1
  111. package/dist/{Markdown-BFV7g8oa.js → Markdown-BUkKWRcl.js} +3 -3
  112. package/dist/MobileNav/index.js +1 -1
  113. package/dist/{MobileNavToggle-VB6SzHYo.js → MobileNavToggle-DYKJC6X6.js} +1 -1
  114. package/dist/MoreMenu/index.d.ts +1 -1
  115. package/dist/MoreMenu/index.js +1 -1
  116. package/dist/{MoreMenu-DOVbdDmP.js → MoreMenu-CsPdGjuE.js} +6 -6
  117. package/dist/MultiSelector/index.d.ts +1 -1
  118. package/dist/MultiSelector/index.js +1 -1
  119. package/dist/{MultiSelector-BLESAk-K.js → MultiSelector-TcYQyyki.js} +5 -5
  120. package/dist/{NavDisclosure-tEaEwaA0.js → NavDisclosure-D-vUD3Bl.js} +1 -1
  121. package/dist/{NavHeadingSurface-CwSYyXFb.js → NavHeadingSurface-D2UWKpSw.js} +1 -1
  122. package/dist/NavItem/index.js +1 -1
  123. package/dist/{NavItem-BR639emm.js → NavItem-BY24W2B0.js} +1 -1
  124. package/dist/NavMenu/index.js +3 -3
  125. package/dist/{NavMenu-CqhjkZuz.js → NavMenu-DF4JqIed.js} +2 -2
  126. package/dist/{NavMenuItem-C9e62bSc.js → NavMenuItem-CGGECLdG.js} +3 -3
  127. package/dist/NumberInput/index.d.ts +1 -1
  128. package/dist/NumberInput/index.js +1 -1
  129. package/dist/{NumberInput-C7cRBlQm.js → NumberInput-BuQf0mvj.js} +4 -4
  130. package/dist/Outline/index.js +1 -1
  131. package/dist/{Outline-BcZMmO9Y.js → Outline-CCnTR9Pe.js} +1 -1
  132. package/dist/OverflowList/index.d.ts +1 -1
  133. package/dist/OverflowList/index.js +1 -1
  134. package/dist/{OverflowList-cjl0AaEP.js → OverflowList-uk0l80Zd.js} +2 -2
  135. package/dist/Pagination/index.d.ts +1 -1
  136. package/dist/Pagination/index.js +1 -1
  137. package/dist/{Pagination-BnA277o8.js → Pagination-1ZayZgit.js} +2 -2
  138. package/dist/{PanGestureRecognizer-BFSO5U4N.js → PanGestureRecognizer-_yCWSqMD.js} +4 -3
  139. package/dist/{PickerWheel-CWT7l-9Q.js → PickerWheel-DJqK1f2w.js} +10 -10
  140. package/dist/Popover/index.d.ts +1 -1
  141. package/dist/Popover/index.js +1 -1
  142. package/dist/{Popover-DfO-mkcm.js → Popover-D34Lo-Cr.js} +5 -5
  143. package/dist/PowerSearch/index.d.ts +1 -1
  144. package/dist/PowerSearch/index.js +1 -1
  145. package/dist/{PowerSearch-CvBTNf6L.js → PowerSearch-DBUQWnPi.js} +27 -27
  146. package/dist/{PressTracker-DDRxFc0Y.js → PressTracker-B_ffL9rM.js} +2 -2
  147. package/dist/ProgressBar/index.js +1 -1
  148. package/dist/{ProgressBar-D4br-4_x.js → ProgressBar-Otv4DLQP.js} +1 -1
  149. package/dist/Radio/index.d.ts +1 -1
  150. package/dist/Radio/index.js +1 -1
  151. package/dist/{RadioGroup-CVOlUPbf.js → RadioGroup-BYZ9mspa.js} +5 -5
  152. package/dist/RadioList/index.d.ts +1 -1
  153. package/dist/RadioList/index.js +1 -1
  154. package/dist/{RadioListItem-5y613Xrt.js → RadioListItem-BjiT8DAp.js} +1 -1
  155. package/dist/Resizable/index.js +1 -1
  156. package/dist/{ResizeHandle-C7xEokaQ.js → ResizeHandle-Ch18ZZOk.js} +2 -2
  157. package/dist/ScrollableArea/index.d.ts +1 -1
  158. package/dist/SegmentedControl/index.js +1 -1
  159. package/dist/{SegmentedControl-B6BQlTfN.js → SegmentedControl-DgZ2y1ff.js} +7 -7
  160. package/dist/SelectableCard/index.d.ts +1 -1
  161. package/dist/SelectableCard/index.js +1 -1
  162. package/dist/{SelectableCard-C2hl7HBW.js → SelectableCard-dUjsGX2o.js} +1 -1
  163. package/dist/Selector/index.d.ts +1 -1
  164. package/dist/Selector/index.js +1 -1
  165. package/dist/{Selector-Dw_0e0zY.js → Selector-P_jhOpNI.js} +3 -3
  166. package/dist/SideNav/index.d.ts +1 -1
  167. package/dist/SideNav/index.js +1 -1
  168. package/dist/{SideNav-dsff7R2R.js → SideNav-D-ubf-w7.js} +8 -8
  169. package/dist/Slider/index.js +1 -1
  170. package/dist/{Slider-CN5NOM10.js → Slider-BrZeUJJF.js} +10 -10
  171. package/dist/StatusDot/index.js +1 -1
  172. package/dist/{StatusDot-arRs8rKk.js → StatusDot-Ce31aeru.js} +1 -1
  173. package/dist/Stepper/index.d.ts +1 -1
  174. package/dist/Stepper/index.js +1 -1
  175. package/dist/{Stepper-BYZasZK7.js → Stepper-BL01wjk9.js} +1 -1
  176. package/dist/Switch/index.d.ts +1 -1
  177. package/dist/Switch/index.js +1 -1
  178. package/dist/{Switch-DHr3_O1r.js → Switch-MeieW4dP.js} +9 -9
  179. package/dist/TabList/index.js +1 -1
  180. package/dist/{TabList-O34fxJlZ.js → TabList-XKIbMcy5.js} +3 -3
  181. package/dist/Table/index.d.ts +1 -1
  182. package/dist/Table/index.js +1 -1
  183. package/dist/{Table-sTJtTqmi.js → Table-x-1Z7nWH.js} +12 -12
  184. package/dist/{TapGestureRecognizer-DCiP88h8.js → TapGestureRecognizer-CH88amVE.js} +4 -3
  185. package/dist/Text/index.js +1 -1
  186. package/dist/{Text-DHm9r3Yh.js → Text-BLPg6wdX.js} +1 -1
  187. package/dist/TextArea/index.d.ts +1 -1
  188. package/dist/TextArea/index.js +1 -1
  189. package/dist/{TextArea-TO_A1D_W.js → TextArea-DilGjhXe.js} +5 -5
  190. package/dist/TextInput/index.d.ts +1 -1
  191. package/dist/TextInput/index.js +1 -1
  192. package/dist/{TextInput-jIBboBDS.js → TextInput-Dd0BHZ5n.js} +5 -5
  193. package/dist/Thumbnail/index.js +1 -1
  194. package/dist/{Thumbnail-CRltyNsq.js → Thumbnail-CdAR7gMc.js} +3 -3
  195. package/dist/{TimeField-BG409_10.js → TimeField-BqOuAcGd.js} +4 -4
  196. package/dist/TimeInput/index.d.ts +1 -1
  197. package/dist/TimeInput/index.js +1 -1
  198. package/dist/{TimeInput-CQzBs55U.js → TimeInput-n9ANugSL.js} +2 -2
  199. package/dist/Timer/index.js +1 -1
  200. package/dist/{Timer-zNCSMU7S.js → Timer-i3ujG9pH.js} +1 -1
  201. package/dist/Timestamp/index.d.ts +1 -1
  202. package/dist/Timestamp/index.js +1 -1
  203. package/dist/{Timestamp-s4Nksy5i.js → Timestamp-Di_Ge164.js} +3 -3
  204. package/dist/Toast/index.js +1 -1
  205. package/dist/{Toast-DcKB9QHW.js → Toast-BHbQcMjq.js} +3 -3
  206. package/dist/ToggleButton/index.d.ts +1 -1
  207. package/dist/ToggleButton/index.js +1 -1
  208. package/dist/{ToggleButton-DZgHhJd7.js → ToggleButton-D5OyWtXD.js} +3 -3
  209. package/dist/Token/index.js +1 -1
  210. package/dist/{Token-B6mV8hyk.js → Token-BYl3tF1p.js} +1 -1
  211. package/dist/Tokenizer/index.d.ts +1 -1
  212. package/dist/Tokenizer/index.js +1 -1
  213. package/dist/{Tokenizer-BvCiuyhk.js → Tokenizer-CHhnsfO1.js} +12 -12
  214. package/dist/Toolbar/index.d.ts +1 -1
  215. package/dist/Tooltip/index.js +2 -2
  216. package/dist/{Tooltip-BuPbbGtv.js → Tooltip-CFQrHG0a.js} +1 -1
  217. package/dist/TopNav/index.d.ts +1 -1
  218. package/dist/TopNav/index.js +1 -1
  219. package/dist/{TopNav-xKD14HTR.js → TopNav-Bvjt444e.js} +5 -5
  220. package/dist/TreeList/index.d.ts +1 -1
  221. package/dist/TreeList/index.js +1 -1
  222. package/dist/{TreeList-BOr0GpJC.js → TreeList-Db0dqCd9.js} +1 -1
  223. package/dist/Typeahead/index.js +2 -2
  224. package/dist/{Typeahead-C18-lx2P.js → Typeahead-oPhwt4z4.js} +5 -5
  225. package/dist/{VelocityTracker-D5wT6A0d.js → VelocityTracker-Cw1aVRnL.js} +1 -1
  226. package/dist/{accessibleName-Chl0zwq_.js → accessibleName-BVk1Rzrl.js} +1 -1
  227. package/dist/{boxHold-BCbXt9_d.js → boxHold-DNjO01uo.js} +1 -1
  228. package/dist/{chat-BUFYB3bA.js → chat-DPxoTm_S.js} +2 -0
  229. package/dist/composables/index.js +10 -10
  230. package/dist/{composables-CKAzgdPD.js → composables-CJ5vBpZ6.js} +11 -11
  231. package/dist/{decay-CUtQFEXK.js → decay-ClFADeqT.js} +1 -1
  232. package/dist/{focusLeaving-BbZ69DYV.js → focusLeaving-Df0Dqr5v.js} +1 -1
  233. package/dist/geometry-BDCUnbgh.js +28 -0
  234. package/dist/{gestures-D_ih8YYG.js → gestures-BpGkqgpV.js} +1 -1
  235. package/dist/{haptics-BPQp81pc.js → haptics-DaX2u-jB.js} +1 -1
  236. package/dist/{index-B9LwZ19y.d.ts → index-B75VMKvS.d.ts} +4 -4
  237. package/dist/{index-C2dLjYoW.d.ts → index-B8XkUCzI.d.ts} +1 -1
  238. package/dist/{index-v27zktLu.d.ts → index-C4viybIG.d.ts} +3 -3
  239. package/dist/{index-Ds4dOCSy.d.ts → index-CCa_dvoF.d.ts} +3 -3
  240. package/dist/{index-lNjYxF1K.d.ts → index-CHnP91LU.d.ts} +33 -33
  241. package/dist/{index-3vt1Ew4A.d.ts → index-CJT9kM7e.d.ts} +2 -2
  242. package/dist/{index-C4S65SAW.d.ts → index-CKnr0JlT.d.ts} +1 -1
  243. package/dist/{index-ZXrvTM3A.d.ts → index-CqXJYXT-.d.ts} +2 -2
  244. package/dist/{index-DXHmlFcC.d.ts → index-CuW4AQ7M.d.ts} +3 -3
  245. package/dist/{index-BItxjc3w.d.ts → index-DOqxWQJp.d.ts} +1 -1
  246. package/dist/{index-J83fLEyo.d.ts → index-DgNCHxvu.d.ts} +2 -2
  247. package/dist/{index-Dn6iAyK4.d.ts → index-EAKu_r6h.d.ts} +6 -6
  248. package/dist/{index-tdOyqA_U.d.ts → index-Pad9p8CU.d.ts} +2 -2
  249. package/dist/{index-BDJQW9cW.d.ts → index-ZtHb6soN.d.ts} +32 -39
  250. package/dist/index.d.ts +17 -16
  251. package/dist/index.js +109 -107
  252. package/dist/internal/touch.d.ts +3467 -0
  253. package/dist/internal/touch.js +230 -0
  254. package/dist/{itemSlots-Dl7Ipj5I.js → itemSlots-CIQbrKkZ.js} +4 -4
  255. package/dist/{layerDepth-D576XVps.js → layerDepth-DxI-GE81.js} +1 -1
  256. package/dist/{lazyBottomSheet-gQtGKE8w.js → lazyBottomSheet-BzI1mp-I.js} +1 -1
  257. package/dist/{loadCatalog-DfwwR4ox.d.ts → loadCatalog-Cm394Q3F.d.ts} +2 -0
  258. package/dist/{loadCatalog-Dvlsgn71.js → loadCatalog-DXx3soG1.js} +2 -1
  259. package/dist/locale/index.d.ts +2 -2
  260. package/dist/locale/index.js +3 -3
  261. package/dist/{locale-BgXR3tSm.js → locale-5NXEHp0U.js} +1 -1
  262. package/dist/{position-DD8UQJ2A.js → position--G96FPl4.js} +1 -1
  263. package/dist/{pressGesture-CwmZDuSC.js → pressGesture-VrM5-7aV.js} +1 -1
  264. package/dist/{pressSlot-31XyOhUS.js → pressSlot-DIN1AmiA.js} +1 -1
  265. package/dist/{projection-Ccz44WX4.js → projection-BafBD5NP.js} +1 -1
  266. package/dist/{resizableChannel-CABtOiJL.js → resizableChannel-C9UA4vam.js} +1 -1
  267. package/dist/{resolveSnapPoint-C7GZY6jT.js → resolveSnapPoint-Cm2KePTm.js} +1 -1
  268. package/dist/{rideKeyboard-BldiTgxS.js → rideKeyboard-SnVXHPCp.js} +1 -1
  269. package/dist/{rubberBand-Ct9HFML5.js → rubberBand-CE3LYEUx.js} +1 -1
  270. package/dist/scrollAnchoring-CNplZXRt.js +60 -0
  271. package/dist/sharedResizeObserver-DojOEX9E.d.ts +62 -0
  272. package/dist/{snapPagingCatcher-RkUaZdWD.js → snapPagingCatcher-Cskp7W35.js} +5 -4
  273. package/dist/{springs-B5hVbZta.js → springs-BqW2WrS-.js} +1 -1
  274. package/dist/{stillPointerGate-CCFCP1uz.js → stillPointerGate-D15jGSjP.js} +1 -1
  275. package/dist/{tooltipFocusRules-CfJwTrhE.js → tooltipFocusRules-D468Tl5q.js} +2 -2
  276. package/dist/{tooltipTriggerRules-DRhcB-wA.js → tooltipTriggerRules-BjnT3wIz.js} +1 -1
  277. package/dist/{useActionGroupTracking-CioHSqgG.js → useActionGroupTracking-CGikRIWR.js} +3 -3
  278. package/dist/{useChatStreamScroll-BQpGHGAr.js → useChatStreamScroll-CGHtw12w.js} +1 -59
  279. package/dist/{useDismiss-Dq7HNw2m.js → useDismiss-ChlwPVfw.js} +1 -1
  280. package/dist/useFingerScroll-DO4LVzDf.js +214 -0
  281. package/dist/{useGestureRecognizer-CtfxP4uw.js → useGestureRecognizer-CozA1twZ.js} +1 -1
  282. package/dist/{useInputStatusIcon-D0xNp9jO.js → useInputStatusIcon-CNYJtEbA.js} +1 -1
  283. package/dist/{useMenuPress-B2Zt5xc5.js → useMenuPress-CARtL4Wa.js} +1 -1
  284. package/dist/{useMobileKeyboard-CN6o0BrJ.js → useMobileKeyboard-DcvMptTe.js} +2 -2
  285. package/dist/{usePressFeedback-D4oohqP5.js → usePressFeedback-DkWA1son.js} +3 -3
  286. package/dist/{useResizable-Dme0X_ZM.js → useResizable-mkUwYfmy.js} +4 -4
  287. package/dist/{useTooltip-Dg2459oV.js → useTooltip-CdD6ivAv.js} +4 -4
  288. package/dist/{useTouchHitArea-rwyNMxFb.js → useTouchHitArea-CxqNaIyt.js} +1 -1
  289. package/dist/{useTouchTriggerInternal-DZ_e8l4G.js → useTouchTriggerInternal-B9YsuMRa.js} +1 -1
  290. package/dist/{useTruncationTooltip-CCVsMc8c.js → useTruncationTooltip-C37kvtXu.js} +3 -3
  291. package/dist/{useTypeaheadMenuConfig-CKEuRCOZ.js → useTypeaheadMenuConfig-DHX88vqs.js} +1 -1
  292. package/dist/utils/index.d.ts +3 -2
  293. package/dist/utils/index.js +3 -1
  294. package/package.json +5 -1
@@ -0,0 +1,3467 @@
1
+ import { i as useFingerScroll, r as UseFingerScrollOptions, t as observeResize } from "../sharedResizeObserver-DojOEX9E.js";
2
+ import { MaybeRefOrGetter } from "vue";
3
+ //#region src/motion/springParameters.d.ts
4
+ /**
5
+ * A spring, in Core Animation's physical vocabulary. Every other way of
6
+ * describing a spring converts to this one.
7
+ */
8
+ interface Spring {
9
+ /** Mass m of the attached object (`CASpringAnimation.mass`). */
10
+ readonly mass: number;
11
+ /** Stiffness k (`CASpringAnimation.stiffness`). */
12
+ readonly stiffness: number;
13
+ /** Viscous damping coefficient c (`CASpringAnimation.damping`). */
14
+ readonly damping: number;
15
+ }
16
+ /** SwiftUI's two-parameter description: `Spring(duration:bounce:)`. */
17
+ interface DurationBounce {
18
+ /**
19
+ * Perceptual duration in seconds: the period of the undamped spring, "the
20
+ * pace of the spring".
21
+ */
22
+ readonly duration: number;
23
+ /**
24
+ * 0 is critically damped (no overshoot), up to 1 (undamped oscillation);
25
+ * negative values, down to −1, are overdamped ("flattened") springs.
26
+ */
27
+ readonly bounce: number;
28
+ }
29
+ /** WWDC18's design-friendly description: response and damping ratio. */
30
+ interface ResponseDamping {
31
+ /** Period of the undamped spring in seconds. */
32
+ readonly response: number;
33
+ /**
34
+ * Damping as a fraction of critical damping (SwiftUI's `dampingFraction`):
35
+ * 1 settles without overshoot, values toward 0 oscillate longer.
36
+ */
37
+ readonly dampingRatio: number;
38
+ }
39
+ /**
40
+ * A spring in any of the vocabularies the constants table uses: physical
41
+ * (mass, stiffness, damping), SwiftUI (duration, bounce) or WWDC18
42
+ * (response, dampingRatio). Tables keep the vocabulary of their source so a
43
+ * value reads exactly as it was published.
44
+ */
45
+ type SpringDescription = {
46
+ readonly mass?: number;
47
+ readonly stiffness: number;
48
+ readonly damping: number;
49
+ } | DurationBounce | ResponseDamping;
50
+ /**
51
+ * Normalizes a description to the physical `Spring`. A physical description
52
+ * gets `springFromPhysics`' treatment: overdamping is clamped to critical, as
53
+ * SwiftUI and Core Animation do by default.
54
+ */
55
+ export declare function toSpring(description: SpringDescription): Spring;
56
+ //#endregion
57
+ //#region src/motion/spring.d.ts
58
+ /** A spring released from a value with a velocity, heading for a target. */
59
+ interface SpringCurve {
60
+ readonly spring: Spring;
61
+ readonly from: number;
62
+ readonly to: number;
63
+ /** Initial velocity, units/s. */
64
+ readonly initialVelocity: number;
65
+ /** Value at `t` seconds after release. */
66
+ value: (t: number) => number;
67
+ /** Velocity at `t` seconds after release, units/s. */
68
+ velocity: (t: number) => number;
69
+ /**
70
+ * The time after which |value(t) − to| stays below `threshold` (in the
71
+ * value's own units) for good: the envelope bound used by
72
+ * `settlingDuration`, applied in absolute units. 0 when already within.
73
+ * Infinity for an undamped spring that is displaced or moving.
74
+ */
75
+ settleTime: (threshold: number) => number;
76
+ }
77
+ /**
78
+ * Closed-form solution of the spring released at `from` with
79
+ * `initialVelocity` (units/s), heading for `to`.
80
+ *
81
+ * @example
82
+ * ```
83
+ * const curve = solveSpring(springFromDurationBounce({duration: 0.5, bounce: 0}), {from: 0, to: 300});
84
+ * curve.value(0.1); // px after 100 ms
85
+ * ```
86
+ */
87
+ export declare function solveSpring(spring: Spring, { from, to, velocity: initialVelocity }: {
88
+ from: number;
89
+ to: number;
90
+ velocity?: number;
91
+ }): SpringCurve;
92
+ //#endregion
93
+ //#region src/gestures/types.d.ts
94
+ /**
95
+ * UIGestureRecognizer.State. A discrete recognizer goes straight from
96
+ * `possible` to `ended` (UIKit's `.recognized` is the same value).
97
+ */
98
+ type GestureState = 'possible' | 'began' | 'changed' | 'ended' | 'cancelled' | 'failed';
99
+ /** What made the contact. A pen on an iPad is `pen`, not `touch`. */
100
+ type PointerKind = 'touch' | 'mouse' | 'pen';
101
+ /**
102
+ * Scroll input a recognizer can take, as UIKit's `UIScrollTypeMask`: a
103
+ * trackpad's two-finger scroll or pinch (`continuous`), or a mouse wheel's
104
+ * notches (`discrete`). A pan takes only a trackpad's; a pinch takes a
105
+ * ctrl-wheel of either.
106
+ */
107
+ type ScrollType = 'continuous' | 'discrete';
108
+ interface Point {
109
+ readonly x: number;
110
+ readonly y: number;
111
+ }
112
+ /** One position of a contact at one instant, in client (viewport) CSS px. */
113
+ interface TouchSample {
114
+ readonly x: number;
115
+ readonly y: number;
116
+ /** Milliseconds on the `performance.now()` clock (an event's `timeStamp`). */
117
+ readonly time: number;
118
+ }
119
+ type TouchPhase = 'began' | 'moved' | 'ended' | 'cancelled';
120
+ /**
121
+ * The scrollers between a touch and the page, as the host sees them: enough
122
+ * for a recognizer to ask whether the browser would scroll something if the
123
+ * finger moved one way, without the recognizer touching the DOM.
124
+ */
125
+ interface NativeScrollProbe {
126
+ /**
127
+ * Whether a finger moving by (dx, dy) would scroll some element under the
128
+ * touch (one that has room left in that direction and whose `touch-action`
129
+ * lets the browser pan that axis).
130
+ */
131
+ canScroll: (dx: number, dy: number) => boolean;
132
+ /** Whether any element under the touch can scroll natively at all. */
133
+ readonly isInsideScroller: boolean;
134
+ /**
135
+ * Whether `touch-action` from the touch target to the page lets the
136
+ * browser pan at all: when it does not, the browser cannot have taken the
137
+ * touch for a scroll, whatever its events say.
138
+ */
139
+ readonly allowsNativePan: boolean;
140
+ }
141
+ /**
142
+ * One contact: UITouch. The arena owns it and updates it in place; a
143
+ * recognizer keeps a reference to every touch it receives.
144
+ */
145
+ interface GestureTouch {
146
+ /** Unique among the contacts the arena tracks at once. */
147
+ readonly id: number;
148
+ readonly pointerType: PointerKind;
149
+ phase: TouchPhase;
150
+ /** Latest position, client CSS px. */
151
+ x: number;
152
+ y: number;
153
+ /** Timestamp of the latest position. */
154
+ time: number;
155
+ readonly startX: number;
156
+ readonly startY: number;
157
+ readonly startTime: number;
158
+ /**
159
+ * Positions since the previous event, oldest first, ending with the
160
+ * current one (coalesced samples where the platform has them). Velocity
161
+ * trackers read these; actions fire once per event.
162
+ */
163
+ samples: TouchSample[];
164
+ /** The node the contact began on. Opaque to the arena. */
165
+ readonly target: unknown;
166
+ /** The native scrollers under the contact, when the host knows them. */
167
+ readonly scroll: NativeScrollProbe | null;
168
+ /** Set for a wheel's or a trackpad's scroll input, which is no contact. */
169
+ readonly scrollType?: ScrollType;
170
+ /** The browser took this contact for its own pan or zoom. */
171
+ takenByBrowser: boolean;
172
+ }
173
+ /** The input a host hands the arena for one contact in one event. */
174
+ interface TouchInput {
175
+ readonly id: number;
176
+ readonly x: number;
177
+ readonly y: number;
178
+ readonly time: number;
179
+ /** Extra positions since the previous event, oldest first (coalesced). */
180
+ readonly history?: ReadonlyArray<TouchSample>;
181
+ }
182
+ /** A new contact: where it is, what made it, and what it landed on. */
183
+ interface TouchBeganInput extends TouchInput {
184
+ readonly pointerType: PointerKind;
185
+ readonly target: unknown;
186
+ readonly scroll?: NativeScrollProbe | null;
187
+ /** Set for a wheel's or a trackpad's scroll input. */
188
+ readonly scrollType?: ScrollType;
189
+ }
190
+ /** What a recognizer is told alongside the touches that changed. */
191
+ interface GestureEventContext {
192
+ /** Timestamp of the event being processed. */
193
+ readonly time: number;
194
+ /** Every contact the arena currently tracks, not only this recognizer's. */
195
+ readonly allTouches: ReadonlyArray<GestureTouch>;
196
+ }
197
+ /**
198
+ * Facts about the page a recognizer may need and must not read from the DOM
199
+ * itself: the viewport for screen-edge pans, and the writing direction of a
200
+ * view for `leading` / `trailing`.
201
+ */
202
+ interface GestureEnvironment {
203
+ viewportSize: () => {
204
+ readonly width: number;
205
+ readonly height: number;
206
+ };
207
+ isRtl: (view: unknown) => boolean;
208
+ /**
209
+ * The box of a recognizer's view in viewport coordinates, or null when it
210
+ * has none to measure. A screen-edge pan reads it to tell a view within
211
+ * its edge band from any other.
212
+ */
213
+ viewRect?: (view: unknown) => {
214
+ readonly left: number;
215
+ readonly top: number;
216
+ readonly width: number;
217
+ readonly height: number;
218
+ } | null;
219
+ }
220
+ /**
221
+ * A view-level touch consumer: what UIKit delivers `touchesBegan` /
222
+ * `touchesEnded` to when no gesture recognizer takes the touch (a UIControl).
223
+ * The arena delivers through it, honoring `delaysTouchesBegan`,
224
+ * `delaysTouchesEnded` and `cancelsTouchesInView`.
225
+ */
226
+ interface TouchConsumer {
227
+ touchBegan: (touch: GestureTouch) => void;
228
+ touchMoved: (touch: GestureTouch) => void;
229
+ touchEnded: (touch: GestureTouch) => void;
230
+ touchCancelled: (touch: GestureTouch) => void;
231
+ /**
232
+ * UIControl's iOS 6 rule: a control's own action wins over an overlapping
233
+ * single-tap recognizer on an ancestor. Return false to stop `recognizer`
234
+ * (attached above this consumer) from beginning for a touch on it.
235
+ */
236
+ allowsAncestorRecognizer?: (recognizer: unknown) => boolean;
237
+ /**
238
+ * Whether the consumer holds this touch now (a control whose press was
239
+ * delivered for that touch): the host cancels the browser's pan for that
240
+ * finger only, as UIKit's `touchesShouldCancel(in:)` is false for a
241
+ * tracking control. A move before the press is delivered, and another
242
+ * finger the consumer is not tracking, still scroll.
243
+ */
244
+ keepsTouch?: (touchId: number) => boolean;
245
+ /**
246
+ * A control whose own record defines a hold action (a stepper's
247
+ * hold-repeat) brings the lock that turns text selection and the callout
248
+ * off for that press only, as a recognizer created with one does
249
+ * (`spec:AST-094` FR41). A control whose hold does nothing leaves it
250
+ * undefined and keeps the browser's long-press selection.
251
+ */
252
+ readonly selectionLock?: SelectionLock;
253
+ /**
254
+ * Whether this touch's press holds the browser's context menu closed now.
255
+ * A control whose hold acts uses it (a switch's hold toggles it). The host
256
+ * then cancels the menu, as for a claimed touch.
257
+ */
258
+ holdsContextMenu?: (touchId: number) => boolean;
259
+ /**
260
+ * Whether the consumer takes touches now (a disabled control does not).
261
+ * The host listens only while something enabled is attached
262
+ * (`spec:AST-094` FR24); after this changes, call `host.update(element)`.
263
+ * @default true
264
+ */
265
+ isEnabled?: () => boolean;
266
+ }
267
+ //#endregion
268
+ //#region src/gestures/arenaTypes.d.ts
269
+ interface GestureClock {
270
+ now: () => number;
271
+ setTimeout: (callback: () => void, ms: number) => unknown;
272
+ clearTimeout: (handle: unknown) => void;
273
+ }
274
+ /**
275
+ * What the browser's click after a touch should do: pass, be swallowed, or
276
+ * be swallowed now and replayed if the recognizers holding it all fail.
277
+ */
278
+ type ClickDisposition = 'allow' | 'suppress' | 'defer';
279
+ interface ArenaBeganInput extends TouchBeganInput {
280
+ /** The recognizers on the touch's hit path, innermost first. */
281
+ readonly recognizers: ReadonlyArray<GestureRecognizer>;
282
+ /** The innermost view-level consumer under the touch, if any. */
283
+ readonly consumer?: TouchConsumer | null;
284
+ }
285
+ interface GestureArenaOptions {
286
+ clock?: GestureClock;
287
+ environment?: GestureEnvironment;
288
+ /**
289
+ * Touches a recognizer now owns, and the recognizer that claimed them. A
290
+ * claim comes in any state: a recognizer that waits on another's failure
291
+ * claims while `possible`, and a swipe claims as `ended`. Each claim is
292
+ * reported once.
293
+ */
294
+ onClaim?: (touchIds: ReadonlyArray<number>, claimer: GestureRecognizer) => void;
295
+ /** Claimed touches given back to the browser (releaseClaim). */
296
+ onRelease?: (touchIds: ReadonlyArray<number>) => void;
297
+ /** A click deferred at touch end resolved: replay it, or drop it. */
298
+ onDeferredClick?: (touch: GestureTouch, allowed: boolean) => void;
299
+ /**
300
+ * The arena dropped its last touch, as after a lifted touch's decision
301
+ * waited on a timer (a tap waiting on a double tap): its host may stop
302
+ * listening now (`spec:AST-094` FR24).
303
+ */
304
+ onIdle?: () => void;
305
+ /**
306
+ * Whether the browser keeps a contact for itself while it is down. Then no
307
+ * claiming recognizer recognizes with it before its lift. So a mouse or pen
308
+ * drag that starts on selectable text selects that text. A recognition at
309
+ * the lift, such as a tap's, is unaffected.
310
+ */
311
+ refusesClaim?: (touch: GestureTouch) => boolean;
312
+ /** Every recognizer transition, for debugging and tests. */
313
+ onTransition?: (recognizer: GestureRecognizer, from: GestureState, to: GestureState) => void;
314
+ }
315
+ type ViewDelivery = 'none' | 'held' | 'delivered' | 'endHeld' | 'done';
316
+ interface TouchRecord {
317
+ readonly touch: GestureTouch;
318
+ readonly participants: GestureRecognizer[];
319
+ readonly consumer: TouchConsumer | null;
320
+ view: ViewDelivery;
321
+ isLifted: boolean;
322
+ isClaimed: boolean;
323
+ suppressClick: boolean;
324
+ deferredClick: boolean;
325
+ }
326
+ interface Timer {
327
+ deadline: number;
328
+ callback: () => void;
329
+ }
330
+ //#endregion
331
+ //#region src/gestures/arenaScheduler.d.ts
332
+ /** The arena's state and clock; GestureArena is the class to use. */
333
+ declare abstract class ArenaScheduler {
334
+ /** Resolves what the latest input or timer decided. */
335
+ protected abstract settle(): void;
336
+ /** A recognizer's place in resolution order. */
337
+ protected abstract rank(recognizer: GestureRecognizer): number;
338
+ readonly environment: GestureEnvironment;
339
+ protected readonly clock: GestureClock;
340
+ protected readonly options: GestureArenaOptions;
341
+ /** The touches whose move the arena is delivering right now. */
342
+ protected movingIds: ReadonlySet<number>;
343
+ protected readonly records: Map<number, TouchRecord>;
344
+ /** Recognizers involved in the current interaction, in resolution order. */
345
+ protected active: GestureRecognizer[];
346
+ protected readonly timers: Map<GestureRecognizer, Timer>;
347
+ protected realTimer: unknown;
348
+ protected realTimerDeadline: number;
349
+ /** The time of the event or timer being processed; null between them. */
350
+ protected currentTime: number | null;
351
+ /** The latest time processed: input never moves the clock backwards. */
352
+ protected latestTime: number;
353
+ protected depth: number;
354
+ /** Open `deferResolution` calls: what their stops unblock waits. */
355
+ protected deferDepth: number;
356
+ /** A deferred stop left a resolution for the next pass. */
357
+ protected owesResolution: boolean;
358
+ constructor(options?: GestureArenaOptions);
359
+ /** The current time on the event clock. */
360
+ now(): number;
361
+ /** Run every timer due at or before `time` (the host's timer and tests). */
362
+ advanceTime(time: number): void;
363
+ /** Internal. Arm a recognizer's one timer at an absolute deadline. */
364
+ setTimer(recognizer: GestureRecognizer, deadline: number, callback: () => void): void;
365
+ /** Internal. */
366
+ clearTimer(recognizer: GestureRecognizer): void;
367
+ /**
368
+ * Runs `body`, code outside input that stops recognizers (an Effect that
369
+ * turns one off or detaches it), without resolving what those stops
370
+ * unblock: the recognitions waiting on them, the touches they held from
371
+ * a view, the resets. A pass a microtask later resolves all of it, at the
372
+ * last event's time, so the listeners and consumers it reaches hear it
373
+ * outside the caller's frame and read the recognized state
374
+ * (react-component-runtime INV2).
375
+ */
376
+ deferResolution(body: () => void): void;
377
+ /** The last event's time, or now before any event. */
378
+ protected lastEventTime(): number;
379
+ protected clampTime(time: number): number;
380
+ /**
381
+ * One external entry: run the timers due by `time`, then `body`, then
382
+ * settle (release held deliveries, reset finished recognizers, forget
383
+ * finished touches). Re-entrant calls (a listener feeding input) run
384
+ * inline and settle with the outermost one.
385
+ */
386
+ protected run(time: number, body: () => void): void;
387
+ protected flushTimers(upTo: number): void;
388
+ protected scheduleRealTimer(): void;
389
+ }
390
+ //#endregion
391
+ //#region src/gestures/arenaDelivery.d.ts
392
+ /** Delivery to the view and click dispositions; GestureArena is the class to use. */
393
+ declare abstract class ArenaDelivery extends ArenaScheduler {
394
+ /** Internal. A recognizer takes its touches from the view, unclaimed. */
395
+ cancelTouchesInViewOf(recognizer: GestureRecognizer): void;
396
+ protected deliverViewBegan(record: TouchRecord): void;
397
+ /** What a lifted touch's view and click get, decided at the lift. */
398
+ protected resolveEnd(record: TouchRecord): ClickDisposition;
399
+ /** Release whatever no recognizer is holding any more. */
400
+ protected reviewHeld(): void;
401
+ protected beginDelayers(record: TouchRecord): boolean;
402
+ protected endDelayers(record: TouchRecord): boolean;
403
+ protected cancelViewTouchesOf(recognizer: GestureRecognizer): void;
404
+ protected cancelView(record: TouchRecord): void;
405
+ protected context(): GestureEventContext;
406
+ protected liveTouches(ids: ReadonlyArray<number>): GestureTouch[];
407
+ protected update(inputs: ReadonlyArray<TouchInput>, phase: 'moved' | 'ended'): GestureTouch[];
408
+ }
409
+ //#endregion
410
+ //#region src/gestures/arenaResolution.d.ts
411
+ /** Conflict resolution and claims; GestureArena is the class to use. */
412
+ declare abstract class ArenaResolution extends ArenaDelivery {
413
+ /** Internal. A recognizer asked for a state change. */
414
+ requestTransition(recognizer: GestureRecognizer, next: GestureState): void;
415
+ /** Cancel an active recognizer, or fail a possible one. */
416
+ stop(recognizer: GestureRecognizer): void;
417
+ protected attemptRecognition(recognizer: GestureRecognizer, next: 'began' | 'ended'): void;
418
+ /** Whether `winner` being recognized prevents `other`. */
419
+ protected conflicts(winner: GestureRecognizer, other: GestureRecognizer): boolean;
420
+ /**
421
+ * Whether a recognizer that claims touches would take a contact the
422
+ * browser keeps while it is down (`refusesClaim`).
423
+ */
424
+ protected isRefusedByBrowser(recognizer: GestureRecognizer): boolean;
425
+ /** UIControl's rule: a control may veto an overlapping ancestor recognizer. */
426
+ protected isVetoedByConsumer(recognizer: GestureRecognizer): boolean;
427
+ protected fail(recognizer: GestureRecognizer): void;
428
+ /**
429
+ * A recognition that claimed its touches and then fails or is cancelled (a
430
+ * waiting recognition that fails, a gesture a second finger or the app
431
+ * cancels) gives them back to the browser unless another recognition owns
432
+ * them, so a finger still resting there can pinch-zoom the page. A gesture
433
+ * that cancels itself on a finger's move (a long press past its tolerance)
434
+ * keeps that finger until it lifts: the drag goes on, and the page never
435
+ * takes it over midway (`spec:AST-094` FR14), as UIKit's scroll view never
436
+ * takes a touch another recognizer had.
437
+ */
438
+ protected releaseClaim(recognizer: GestureRecognizer, keep?: ReadonlySet<number>): void;
439
+ protected apply(recognizer: GestureRecognizer, next: GestureState): void;
440
+ /**
441
+ * Re-run every waiting recognition whose requirements may have resolved.
442
+ * Repeats until nothing changes, so chains (A waits on B waits on C)
443
+ * settle in one pass.
444
+ */
445
+ protected reviewPending(): void;
446
+ protected claim(recognizer: GestureRecognizer): void;
447
+ /** A recognizer's place in resolution order: innermost first, idle last. */
448
+ protected rank(recognizer: GestureRecognizer): number;
449
+ protected settle(): void;
450
+ }
451
+ //#endregion
452
+ //#region src/gestures/GestureArena.d.ts
453
+ /**
454
+ * The arena that decides which recognizer gets a touch.
455
+ */
456
+ declare class GestureArena extends ArenaResolution {
457
+ /** Whether a recognizer owns this touch, so the browser must not pan or zoom it. */
458
+ isClaimed(id: number): boolean;
459
+ /** Internal. The view-level consumer of this touch, if any. */
460
+ consumerOf(id: number): TouchConsumer | null;
461
+ /** The live touch with this id. */
462
+ getTouch(id: number): GestureTouch | undefined;
463
+ /**
464
+ * The recognizers that took touch `id` when it began: each was enabled,
465
+ * accepted its pointer, and its `shouldReceiveTouch` agreed. Empty for a
466
+ * touch the arena does not track.
467
+ */
468
+ participantsOf(id: number): ReadonlyArray<GestureRecognizer>;
469
+ /** Every touch the arena tracks, lifted ones awaiting a decision included. */
470
+ get touches(): ReadonlyArray<GestureTouch>;
471
+ /** Recognizers taking part in the current interaction, in resolution order. */
472
+ get involvedRecognizers(): ReadonlyArray<GestureRecognizer>;
473
+ /** New contacts, each with the recognizers on its hit path. */
474
+ began(inputs: ReadonlyArray<ArenaBeganInput>): void;
475
+ /**
476
+ * A contact began where nothing takes part (plain page content). It is
477
+ * never tracked and stays the browser's; recognizers already tracking a
478
+ * gesture hear of it, as of any touch off their hit path.
479
+ */
480
+ untrackedBegan(input: TouchBeganInput): void;
481
+ /** Contacts moved. */
482
+ moved(inputs: ReadonlyArray<TouchInput>): void;
483
+ /**
484
+ * Contacts lifted. Returns, per touch, what the browser's click for it
485
+ * should do.
486
+ */
487
+ ended(inputs: ReadonlyArray<TouchInput>): Map<number, ClickDisposition>;
488
+ /** The system took these contacts (`touchcancel`, a mouse `pointercancel`). */
489
+ cancelled(ids: ReadonlyArray<number>, time: number): void;
490
+ /**
491
+ * The browser took these contacts for its own pan or zoom: their pointer
492
+ * stream is gone (`pointercancel`) and no click will follow. Possible
493
+ * recognizers sharing them fail and active ones are cancelled, as UIKit
494
+ * fails everything a scroll view's pan beats, except a recognizer that
495
+ * keeps observing the touch. Such a watcher never claims it: a drag the
496
+ * browser took stays the browser's (FR14).
497
+ */
498
+ browserTookOver(ids: ReadonlyArray<number>, time: number): void;
499
+ }
500
+ //#endregion
501
+ //#region src/gestures/recognizerOptions.d.ts
502
+ /**
503
+ * Turns text selection and the touch callout off on `elements` (and on a
504
+ * non-text input `target` inside one) for one held press; returns the undo.
505
+ * utils/selectionLock.ts's `lockSelection` is the one implementation.
506
+ */
507
+ type SelectionLock = (elements: Iterable<Element>, target: EventTarget | null) => () => void;
508
+ interface GestureRecognizerOptions<R = GestureRecognizer> {
509
+ /** A name for debugging and test output. */
510
+ name?: string;
511
+ /** A disabled recognizer receives no touches; disabling one mid-gesture cancels it. @default true */
512
+ isEnabled?: boolean;
513
+ /**
514
+ * When the gesture is recognized, cancel the view's touches: a pressed
515
+ * control un-highlights without acting, and the browser's click for the
516
+ * touch is swallowed. @default true
517
+ */
518
+ cancelsTouchesInView?: boolean;
519
+ /** Hold the view's touch-began until this recognizer fails. @default false */
520
+ delaysTouchesBegan?: boolean;
521
+ /**
522
+ * For a hold that does something (a slider's thumb, a switch's or a
523
+ * segmented control's drag): the lock that turns text selection and the
524
+ * touch callout off on this recognizer's element for each held press
525
+ * (`spec:AST-094` FR41). Pass `lockSelection` from utils/selectionLock.ts;
526
+ * the host calls it and never imports it, so a component without such a
527
+ * hold does not bundle it. Content under a sheet's or a pager's pan stays
528
+ * selectable, so there is none by default; a mouse keeps desktop selection
529
+ * either way. A long press brings its own when it has a hold (a
530
+ * `minimumPressDuration` above 0); `null` brings none.
531
+ */
532
+ selectionLock?: SelectionLock | null;
533
+ /**
534
+ * Hold the view's touch-ended (and the browser's click) while this
535
+ * recognizer may still recognize. @default true
536
+ */
537
+ delaysTouchesEnded?: boolean;
538
+ /** Pointer kinds this recognizer listens to (UIKit's `allowedTouchTypes`). @default all */
539
+ allowedPointerTypes?: ReadonlyArray<PointerKind>;
540
+ /**
541
+ * Scroll input this recognizer takes, as UIKit's `allowedScrollTypesMask`.
542
+ * A pan follows a trackpad's two-finger scroll (`continuous`), never a
543
+ * mouse wheel's notches. It moves as a contact with the content, along its
544
+ * own axis, after the scrollers under the pointer. Its own element is the
545
+ * pan's on the axis its `touch-action` keeps, as for a finger. A pinch takes
546
+ * a ctrl-wheel of either, as a trackpad pinches.
547
+ * @default none; a pinch takes both, the screen-edge pan none whatever a
548
+ * caller passes
549
+ */
550
+ allowedScrollTypes?: ReadonlyArray<ScrollType>;
551
+ /** Ignore a touch of a different kind than the ones already tracked. @default true */
552
+ requiresExclusiveTouchType?: boolean;
553
+ /**
554
+ * Whether this recognizer takes its touches from the browser when it
555
+ * recognizes. `false` makes a watcher (a tab bar that minimizes while the
556
+ * page scrolls): it never claims, so it gets only passive listeners and
557
+ * never delays a scroll; it prevents no other recognizer and none prevents
558
+ * it (`spec:AST-094` FR15); it cancels no press or click under it; and it
559
+ * keeps tracking a touch the browser takes for a scroll,
560
+ * reporting through the native scroll and ending at the lift.
561
+ * @default true
562
+ */
563
+ claimsTouches?: boolean;
564
+ /** gestureRecognizerShouldBegin: return false to fail instead of beginning. */
565
+ shouldBegin?: (recognizer: R) => boolean;
566
+ /** gestureRecognizer(_:shouldReceive:): return false to never see this touch. */
567
+ shouldReceiveTouch?: (recognizer: R, touch: GestureTouch) => boolean;
568
+ /** gestureRecognizer(_:shouldRecognizeSimultaneouslyWith:). */
569
+ shouldRecognizeSimultaneously?: (recognizer: R, other: GestureRecognizer) => boolean;
570
+ /** gestureRecognizer(_:shouldRequireFailureOf:). */
571
+ shouldRequireFailureOf?: (recognizer: R, other: GestureRecognizer) => boolean;
572
+ /** gestureRecognizer(_:shouldBeRequiredToFailBy:). */
573
+ shouldBeRequiredToFailBy?: (recognizer: R, other: GestureRecognizer) => boolean;
574
+ }
575
+ type GestureListener<R> = (recognizer: R) => void;
576
+ type GestureTransitionListener<R> = (recognizer: R, from: GestureState, to: GestureState) => void;
577
+ /**
578
+ * The browser behaviors `touch-action` can keep or remove.
579
+ */
580
+ interface NativeTouchBehavior {
581
+ readonly panX: boolean;
582
+ readonly panY: boolean;
583
+ readonly pinchZoom: boolean;
584
+ /** Double-tap to zoom, the reason for the old 300 ms click delay. */
585
+ readonly doubleTapZoom: boolean;
586
+ }
587
+ /**
588
+ * What a recognizer is. The gesture code tells the family apart by it, never
589
+ * by `instanceof` (`architecture:react-component-runtime` INV13); a
590
+ * screen-edge pan is its own kind, though it is built on the pan.
591
+ */
592
+ type RecognizerKind = 'tap' | 'longPress' | 'pan' | 'screenEdgePan' | 'swipe' | 'pinch';
593
+ //#endregion
594
+ //#region src/gestures/recognizerCore.d.ts
595
+ /** A recognizer's configuration and relationships; GestureRecognizer is the class to extend. */
596
+ declare abstract class RecognizerCore {
597
+ /** What this recognizer is (see RecognizerKind). */
598
+ abstract get kind(): RecognizerKind;
599
+ /** Stable id, for ordering and debugging. */
600
+ readonly id: number;
601
+ name: string;
602
+ isEnabled: boolean;
603
+ cancelsTouchesInView: boolean;
604
+ /** See GestureRecognizerOptions.selectionLock. */
605
+ readonly selectionLock: SelectionLock | null;
606
+ delaysTouchesBegan: boolean;
607
+ delaysTouchesEnded: boolean;
608
+ allowedPointerTypes: ReadonlySet<PointerKind> | null;
609
+ /** See GestureRecognizerOptions.allowedScrollTypes. */
610
+ readonly allowedScrollTypes: ReadonlySet<ScrollType>;
611
+ requiresExclusiveTouchType: boolean;
612
+ /**
613
+ * The element (or any object) the recognizer is attached to. The DOM host
614
+ * sets it; the arena treats it as opaque.
615
+ */
616
+ view: unknown;
617
+ /** Internal. The arena delivering touches to this recognizer, if any. */
618
+ protected arena: GestureArena | null;
619
+ /** Internal. A recognition waiting for a failure requirement. */
620
+ protected pending: 'began' | 'ended' | null;
621
+ /**
622
+ * The delegate functions. Typed against the base so a subclass stays
623
+ * assignable to GestureRecognizer; each is only ever called with `this`.
624
+ */
625
+ protected readonly options: GestureRecognizerOptions<GestureRecognizer>;
626
+ protected stateValue: GestureState;
627
+ protected readonly listeners: Set<GestureListener<GestureRecognizer>>;
628
+ protected readonly transitionListeners: Set<GestureTransitionListener<GestureRecognizer>>;
629
+ protected readonly failureRequirements: Set<GestureRecognizer>;
630
+ protected readonly simultaneousWith: Set<GestureRecognizer>;
631
+ /** Touches currently tracked, by id. */
632
+ protected readonly touches: Map<number, GestureTouch>;
633
+ /** Internal. Every touch id received since the last reset. */
634
+ protected readonly seenTouchIds: Set<number>;
635
+ protected lastLocation: Point;
636
+ constructor(options?: GestureRecognizerOptions<never>);
637
+ /** This recognizer, as the GestureRecognizer every recognizer is. */
638
+ protected get self(): GestureRecognizer;
639
+ /** Discrete recognizers go from `possible` straight to `ended`. */
640
+ get isDiscrete(): boolean;
641
+ /**
642
+ * Whether recognizing takes the touches from the browser: while a claiming
643
+ * recognizer owns a touch, the host cancels the browser's pan and zoom for
644
+ * it. Every touch recognizer claims; hover has no touches to claim.
645
+ */
646
+ get claimsTouches(): boolean;
647
+ get state(): GestureState;
648
+ /**
649
+ * What the browser may still do natively on this recognizer's view: the
650
+ * host intersects these across a view's recognizers into its
651
+ * `touch-action`. A recognizer that takes no touches constrains nothing.
652
+ */
653
+ get nativeTouchBehavior(): NativeTouchBehavior;
654
+ /** Internal. Whether this recognizer listens to touch at all. */
655
+ protected get acceptsTouchInput(): boolean;
656
+ /** How many touches the recognizer is tracking right now. */
657
+ get numberOfTouches(): number;
658
+ /** The touches being tracked, in the order they began. */
659
+ get trackedTouches(): ReadonlyArray<GestureTouch>;
660
+ /**
661
+ * The centroid of the tracked touches in client coordinates; after they
662
+ * end, where they were last.
663
+ */
664
+ location(): Point;
665
+ /** Facts about the page (viewport, writing direction). */
666
+ protected get environment(): GestureEnvironment;
667
+ /** UIKit's `require(toFail:)`: recognize only once `other` has failed. */
668
+ requireToFail(other: GestureRecognizer): this;
669
+ /** Let this and `others` be recognized at the same time (both directions). */
670
+ recognizeSimultaneouslyWith(...others: GestureRecognizer[]): this;
671
+ /** Internal. Whether this recognizer must wait for `other` to fail. */
672
+ protected requiresFailureOf(other: GestureRecognizer): boolean;
673
+ /**
674
+ * Internal. Whether this and `other` may be active together: both allow it
675
+ * (`recognizeSimultaneouslyWith` sets both sides; each delegate answers for
676
+ * its own recognizer), so one delegate alone keeps them exclusive (FR15).
677
+ */
678
+ protected allowsSimultaneous(other: GestureRecognizer): boolean;
679
+ /** Internal. The delegate's should-begin answer. */
680
+ protected shouldBegin(): boolean;
681
+ /**
682
+ * Internal. Whether this recognizer holds `touchId` before it begins: the
683
+ * host then cancels that finger's moves as for a touch a recognizer owns.
684
+ * None does by default (`spec:AST-094` FR19); a scroll-edge pan holds a
685
+ * finger pulling away from an edge every scroller under it is at.
686
+ */
687
+ protected keepsTouch(_touchId: number): boolean;
688
+ /** UIKit's `canPrevent(_:)`: whether recognizing fails `other`. */
689
+ canPrevent(_other: GestureRecognizer): boolean;
690
+ /** UIKit's `canBePrevented(by:)`. */
691
+ canBePrevented(_other: GestureRecognizer): boolean;
692
+ /**
693
+ * Whether this recognizer is still part of the current interaction: it
694
+ * tracks touches, is waiting on a requirement, or (a multi-tap between
695
+ * taps) expects more input. An idle `possible` recognizer cannot recognize
696
+ * and so does not hold up anything that requires it to fail.
697
+ */
698
+ isInvolved(): boolean;
699
+ /** Called on began, changed, ended (recognized) and cancelled. */
700
+ addListener(listener: GestureListener<this>): () => void;
701
+ /** Called on every transition, including failed and the reset to possible. */
702
+ addTransitionListener(listener: GestureTransitionListener<this>): () => void;
703
+ /** The scroll types taken when the options name none (UIKit's: none). */
704
+ protected get defaultScrollTypes(): ReadonlyArray<ScrollType>;
705
+ }
706
+ //#endregion
707
+ //#region src/gestures/GestureRecognizer.d.ts
708
+ declare abstract class GestureRecognizer extends RecognizerCore {
709
+ /** New touches for this recognizer. */
710
+ protected touchesBegan(_touches: ReadonlyArray<GestureTouch>, _event: GestureEventContext): void;
711
+ protected touchesMoved(_touches: ReadonlyArray<GestureTouch>, _event: GestureEventContext): void;
712
+ /** Touches lifted; they are removed from `touches` after this returns. */
713
+ protected touchesEnded(_touches: ReadonlyArray<GestureTouch>, _event: GestureEventContext): void;
714
+ /**
715
+ * The system or the browser took these touches. By default an active
716
+ * gesture is cancelled and a possible one fails.
717
+ */
718
+ protected touchesCancelled(_touches: ReadonlyArray<GestureTouch>, _event: GestureEventContext): void;
719
+ /**
720
+ * The browser took these touches for its own pan or zoom (their pointer
721
+ * stream is gone). Return true to keep observing them; by default they are
722
+ * treated as cancelled. An observer never claims them: a drag the browser
723
+ * took stays the browser's (FR14).
724
+ */
725
+ protected touchesTakenByBrowser(touches: ReadonlyArray<GestureTouch>, event: GestureEventContext): boolean;
726
+ /**
727
+ * A touch began elsewhere (off this recognizer's hit path) while this
728
+ * recognizer tracks touches of its own. It is not this recognizer's touch
729
+ * and is never delivered as one; a recognizer that a foreign finger should
730
+ * end (a menu's press slide) cancels itself here. By default nothing
731
+ * happens.
732
+ */
733
+ protected touchBeganElsewhere(_touches: ReadonlyArray<GestureTouch>, _event: GestureEventContext): void;
734
+ /** Clear per-gesture state before the next attempt. */
735
+ protected reset(): void;
736
+ /**
737
+ * Whether a touch may join. The base checks enabled, pointer kind and
738
+ * exclusivity of kind; subclasses narrow it (a one-finger pan ignores a
739
+ * second finger once it is moving).
740
+ */
741
+ protected acceptsTouch(touch: GestureTouch): boolean;
742
+ /**
743
+ * Ask for a state change. The arena may refuse (the recognizer fails
744
+ * instead) or defer it until a failure requirement resolves.
745
+ */
746
+ protected setState(next: GestureState): void;
747
+ /** Arm the recognizer's one timer at an absolute time on the event clock. */
748
+ protected setTimer(deadline: number, callback: () => void): void;
749
+ protected clearTimer(): void;
750
+ /** The event clock's current time. */
751
+ protected now(): number;
752
+ /**
753
+ * Takes this recognizer's touches from the view, as a claiming winner does
754
+ * under `cancelsTouchesInView`: the view's press ends and no click follows.
755
+ * The touches stay unclaimed, so the page still scrolls.
756
+ */
757
+ protected cancelTouchesInView(): void;
758
+ /** Internal. Whether this recognizer takes `touch` right now. */
759
+ protected wantsTouch(touch: GestureTouch): boolean;
760
+ /** Internal. */
761
+ protected deliverBegan(touches: ReadonlyArray<GestureTouch>, event: GestureEventContext): void;
762
+ /** Internal. */
763
+ protected deliverBeganElsewhere(touches: ReadonlyArray<GestureTouch>, event: GestureEventContext): void;
764
+ /** Internal. */
765
+ protected deliverMoved(touches: ReadonlyArray<GestureTouch>, event: GestureEventContext): void;
766
+ /** Internal. */
767
+ protected deliverEnded(touches: ReadonlyArray<GestureTouch>, event: GestureEventContext): void;
768
+ /** Internal. */
769
+ protected deliverCancelled(touches: ReadonlyArray<GestureTouch>, event: GestureEventContext): void;
770
+ /** Internal. */
771
+ protected deliverTakenByBrowser(touches: ReadonlyArray<GestureTouch>, event: GestureEventContext): void;
772
+ /** Internal. The host's hook: listeners follow whether anything is enabled. */
773
+ onEnabledChange: (() => void) | null;
774
+ /**
775
+ * UIKit's `isEnabled` setter: turning a recognizer off mid-gesture cancels
776
+ * the gesture (an active one) or fails it (a possible one).
777
+ */
778
+ setEnabled(value: boolean): void;
779
+ /** Cancel this recognizer if it is active, or fail it if it is possible. */
780
+ cancel(): void;
781
+ /** Internal. Apply a transition the arena has approved. */
782
+ protected applyState(next: GestureState): void;
783
+ /** Internal. Return to `possible` for the next attempt. */
784
+ protected resetToPossible(): void;
785
+ }
786
+ //#endregion
787
+ //#region src/gestures/panOptions.d.ts
788
+ type PanDirection = 'any' | 'horizontal' | 'vertical' | 'left' | 'right' | 'up' | 'down';
789
+ interface PanGestureRecognizerOptions extends GestureRecognizerOptions<PanGestureRecognizer> {
790
+ /** @default 1 */
791
+ minimumNumberOfTouches?: number;
792
+ /** @default Infinity */
793
+ maximumNumberOfTouches?: number;
794
+ /**
795
+ * The travel that begins the pan, px. A function gives each press its own
796
+ * threshold: it reads the press's first touch when that touch lands.
797
+ * @default UIKit's 10
798
+ */
799
+ hysteresis?: number | ((touch: GestureTouch) => number);
800
+ /** Movement that may begin the pan; anything else fails it. @default 'any' */
801
+ direction?: PanDirection;
802
+ /**
803
+ * For a pan limited to an axis: how much the movement along the axis must
804
+ * exceed the movement across it to begin. Above 1, movement that is still
805
+ * between the two lines when the pan reaches its hysteresis fails it: a pan
806
+ * that competes with native scrolling decides within 10 px
807
+ * (`spec:AST-094` FR19). Below 1, the pan claims drags up to
808
+ * atan(1 / axisRatio) off its axis.
809
+ * @default 1
810
+ */
811
+ axisRatio?: number;
812
+ /**
813
+ * With `direction: 'any'`, report movement along the axis that dominated
814
+ * at the start only (UIScrollView's directional lock).
815
+ */
816
+ lockAxis?: boolean;
817
+ /**
818
+ * A trackpad's two-finger scroll (`continuous`) drives the pan where its
819
+ * owner allows it. It moves as a contact with the content, along its own
820
+ * axis, after the scrollers under the pointer. Its own element is the pan's
821
+ * on the axis its `touch-action` keeps, as for a finger. A mouse wheel's
822
+ * notches never drive a pan; they scroll what is under the pointer.
823
+ * @default [] (none)
824
+ */
825
+ allowedScrollTypes?: ReadonlyArray<'continuous'>;
826
+ /** Begin only when the native scrollers under the touch are at the edge. */
827
+ scrollEdge?: boolean;
828
+ /**
829
+ * A one-way pan decides on the touch's first move. A first move its own way
830
+ * holds the touch from that move. Any other first move fails the pan, so the
831
+ * page keeps the touch. A toast's swipe works this way.
832
+ */
833
+ firstMoveDecides?: boolean;
834
+ }
835
+ //#endregion
836
+ //#region src/gestures/PanGestureRecognizer.d.ts
837
+ export declare class PanGestureRecognizer extends GestureRecognizer {
838
+ get kind(): GestureRecognizer['kind'];
839
+ /** Internal. The host's brand: a pan follows the one-finger rule (recognizerInternals). */
840
+ protected get family(): 'pan';
841
+ minimumNumberOfTouches: number;
842
+ maximumNumberOfTouches: number;
843
+ hysteresis: number;
844
+ direction: PanDirection;
845
+ axisRatio: number;
846
+ lockAxis: boolean;
847
+ scrollEdge: boolean;
848
+ firstMoveDecides: boolean;
849
+ /** The axis a `lockAxis` pan locked to when it began. */
850
+ lockedAxis: 'x' | 'y' | null;
851
+ /** The movement the begin threshold took (excluded from `translation()`). */
852
+ travelAtBegan: Point;
853
+ private readonly tracker;
854
+ /**
855
+ * Read once per press. A finger that lands later keeps the press's
856
+ * threshold.
857
+ */
858
+ private readonly hysteresisFor;
859
+ /** The lift's event time once the pan ended: its release (AST-100 FR2). */
860
+ private releaseTime;
861
+ /** The centroid where the gesture started, in client px. */
862
+ private origin;
863
+ /** Re-basing that keeps the translation continuous across finger changes. */
864
+ private adjust;
865
+ /** Translation since touch-down, before `setTranslation` offsets. */
866
+ private raw;
867
+ private offset;
868
+ /** How a `firstMoveDecides` pan read the touch's first move, once it moved. */
869
+ private firstMove;
870
+ constructor(options?: PanGestureRecognizerOptions);
871
+ /**
872
+ * Movement since the pan began (or since `setTranslation`), client px; the
873
+ * movement since touch-down while it is still possible.
874
+ */
875
+ translation(): Point;
876
+ /**
877
+ * Change the allowed direction for the next gesture (a pan in progress
878
+ * keeps the one it began with). The element's touch-action is derived
879
+ * when the recognizer is attached: switching between directions that
880
+ * leave the browser the same touches (up and down) needs nothing more.
881
+ */
882
+ setDirection(direction: PanDirection): void;
883
+ /** UIKit's `setTranslation(_:in:)`: make the current translation read `value`. */
884
+ setTranslation(value: Point): void;
885
+ /** Movement since the fingers landed, threshold included, client px. */
886
+ totalTranslation(): Point;
887
+ /**
888
+ * Velocity in px/s, UIKit's way, for a dragged surface. At the release it
889
+ * is 0 when the finger rested longer than the stillness interval before
890
+ * lifting, or moved fewer than twice (spec:AST-100 FR2).
891
+ */
892
+ velocity(): Point;
893
+ /**
894
+ * A scrolling surface's release velocity in px/s (paging, a wheel): the
895
+ * scroll-view blend of the pan's last two values, with the same release
896
+ * rules (architecture:interaction-modality INV10).
897
+ */
898
+ scrollVelocity(): Point;
899
+ /**
900
+ * The browser keeps the axis a two-way pan does not use. A one-way pan,
901
+ * and a pan that coordinates with native scrolling, leave the browser
902
+ * everything: the other direction still scrolls (a toast dragged away from
903
+ * its edge scrolls the page), and the pan claims its own direction by
904
+ * cancelling `touchmove` when it begins, below the distance at which the
905
+ * browser decides to scroll. Pinch-zoom stays the browser's.
906
+ */
907
+ get nativeTouchBehavior(): NativeTouchBehavior;
908
+ protected acceptsTouch(touch: GestureTouch): boolean;
909
+ protected touchesBegan(touches: ReadonlyArray<GestureTouch>, event: GestureEventContext): void;
910
+ protected touchesMoved(_touches: ReadonlyArray<GestureTouch>, event: GestureEventContext): void;
911
+ protected touchesEnded(touches: ReadonlyArray<GestureTouch>, event: GestureEventContext): void;
912
+ protected reset(): void;
913
+ /**
914
+ * What this movement means for a pan limited to a direction: begin, fail,
915
+ * or undecided (between `axisRatio`'s lines), which fails it too once it
916
+ * reaches its hysteresis.
917
+ */
918
+ protected classify(translation: Point): 'begin' | 'fail' | 'wait';
919
+ private tryBegin;
920
+ /**
921
+ * Leave the threshold's travel out of the translation, as UIKit does at
922
+ * .began: up to `hysteresis` px per axis, so a slow drag starts at zero and
923
+ * a step that overshoots keeps the overshoot (measured: a slow diagonal
924
+ * that crossed at (10.67, 10.67) reads (0.67, 0.67); a 3:1 drag crossing at
925
+ * (11, 3.67) reads (1, 0)). Some fast first moves read zero in UIKit; that
926
+ * case is not modelled.
927
+ */
928
+ private startFromHere;
929
+ /**
930
+ * Inside a tap's wobble the moves stay the browser's, so WebKit keeps the
931
+ * tap's click. Past it, at an edge where the browser would only rubber-band,
932
+ * the pan holds the finger before it begins (`spec:AST-094` FR19, DEC-18).
933
+ * A move the content can still scroll stays the browser's, and so does every
934
+ * move while a second finger is down (a pinch).
935
+ */
936
+ protected keepsTouch(touchId: number): boolean;
937
+ private travelAlongAxis;
938
+ private nativeCanScroll;
939
+ private track;
940
+ /** Keep the translation continuous when fingers join or leave. */
941
+ private rebase;
942
+ private locked;
943
+ }
944
+ //#endregion
945
+ //#region src/motion/types.d.ts
946
+ /**
947
+ * A value the animator can drive.
948
+ */
949
+ type MotionProperty = 'x' | 'y' | 'rotate' | 'scaleX' | 'scaleY' | 'opacity';
950
+ /**
951
+ * Values by property; `scale` sets `scaleX` and `scaleY` together.
952
+ */
953
+ type MotionValues = Partial<Record<MotionProperty | 'scale', number>>;
954
+ /**
955
+ * A spring and the velocity it starts with.
956
+ */
957
+ interface SpringTransition {
958
+ /** The spring, in any vocabulary of the constants table. */
959
+ spring: SpringDescription;
960
+ /**
961
+ * Initial velocities in units per second (px/s, deg/s, 1/s), for example a
962
+ * gesture's release velocity. A property without one keeps the velocity it
963
+ * has on screen.
964
+ */
965
+ velocity?: MotionValues;
966
+ }
967
+ /** What `Animator.rebase` takes besides the amounts. */
968
+ interface RebaseOptions {
969
+ /** Time of the shift on the document timeline (ms). Defaults to now. */
970
+ at?: number;
971
+ /**
972
+ * Per property, the value its spring heads for after the shift. A spring
973
+ * whose target plus its amount lands there moves whole, before its first
974
+ * frame and once its start is known. Its curve and target move by the
975
+ * amount. It keeps its start time and velocity, as when the element's
976
+ * resting place moves under a curve that keeps going. If its first frame
977
+ * has run while its start is unread, only the model moves. The next call
978
+ * on the channel in the same task rebuilds its animation, or else the end
979
+ * of the task does.
980
+ */
981
+ towards?: MotionValues;
982
+ }
983
+ /**
984
+ * Options of `animate` and `play`: the spring, a release velocity, the Reduced
985
+ * Motion handling.
986
+ */
987
+ interface AnimateOptions {
988
+ /**
989
+ * Start time on the document timeline (ms, `performance.now()` clock).
990
+ * Defaults to now. Pass one value to several animators to put their
991
+ * animations on one clock.
992
+ */
993
+ at?: number;
994
+ /**
995
+ * The call starts from the release of a touch drag (a sheet let go, a swipe
996
+ * back released). Under Reduced Motion it then cross-fades whatever the
997
+ * primary pointer (design:reduced-motion DR2), where another call on a
998
+ * fine primary pointer completes at once (DR3). The gesture host knows;
999
+ * nothing is inferred from the last pointer.
1000
+ */
1001
+ touchRelease?: boolean;
1002
+ /**
1003
+ * Which way the substituted cross-fade goes when the call's own opacity
1004
+ * does not say (a sheet slides in or out without fading): `'entrance'`
1005
+ * lands the travel at once and fades the opacity in from 0; `'exit'` fades
1006
+ * it out in place, then lands the travel and returns the opacity to its
1007
+ * value. The call's targets stay the end state; without Reduced Motion this
1008
+ * changes nothing.
1009
+ */
1010
+ crossfadeAs?: 'entrance' | 'exit';
1011
+ /**
1012
+ * When the call's animations start. By default a call from rest starts
1013
+ * when the browser commits it. A call that continues motion on screen (a
1014
+ * retarget) starts now, from the value on screen. A curve whose tail
1015
+ * already shows as at rest counts as rest. Ignored with `at`.
1016
+ * - `'commit'`: a call that continues motion also starts when the browser
1017
+ * commits it. The browser dates it, as it dates a call from rest.
1018
+ * - `'presented'`: a call from rest leaves its element at rest. Its
1019
+ * animations are created two frames later, once the frame with the
1020
+ * element at rest has been presented. They then start at their commit,
1021
+ * so a busy UI process delays the motion instead of skipping into it.
1022
+ * Any other change to the animator before then creates the animations
1023
+ * first, in call order. A call that continues motion on screen starts
1024
+ * now, as by default.
1025
+ * - `'next-frame'`: the caller makes the call in an input event's own
1026
+ * task, never in a frame callback. The first frame whose callbacks run
1027
+ * after the call commits it. A call from rest starts at that frame,
1028
+ * however long the task ran, so a later listener's block delays the
1029
+ * motion. Without it, the browser dates the start inside that block, and
1030
+ * the motion skips ahead. A call that continues motion starts now, as by
1031
+ * default.
1032
+ */
1033
+ start?: 'commit' | 'presented' | 'next-frame';
1034
+ /**
1035
+ * A call that retargets a curve on screen adds to it instead of replacing
1036
+ * it, as UIKit's animations do: the old curve keeps going (past its end, at
1037
+ * its target) and a spring of the difference between the two targets runs
1038
+ * from 0 on top, in the same animation. Its value and velocity at the call
1039
+ * are the old curve's, so whichever frame first shows it (WebKit can apply
1040
+ * a new curve tens of ms late), nothing steps back. Ignored for a property
1041
+ * at rest or still waiting for the browser's start, for a property given a
1042
+ * velocity, and under Reduced Motion. Use it for a played curve that starts
1043
+ * at rest (an eased reversal) while the property moves; a spring retarget
1044
+ * on the same spring moves the same either way, and a curve that already
1045
+ * continues the velocity on screen must not add to it.
1046
+ */
1047
+ additive?: boolean;
1048
+ }
1049
+ /**
1050
+ * Any closed-form curve to play on the compositor (`Animator.play`, and a
1051
+ * release's coast through `Animator.decay`): a spring chasing a moving
1052
+ * target, a piecewise curve, a fitted UIKit curve. Times are seconds from
1053
+ * the curve's start; the value at `duration` is the end state. Start it at
1054
+ * the property's presentation value (`get`) to continue without a jump.
1055
+ */
1056
+ interface MotionCurve {
1057
+ /** Length, s. */
1058
+ readonly duration: number;
1059
+ /** Value `t` seconds after the start (0 ≤ t ≤ duration). */
1060
+ at: (t: number) => number;
1061
+ /** Velocity `t` seconds after the start, units/s. */
1062
+ velocity: (t: number) => number;
1063
+ /**
1064
+ * A transition started on release rather than a throw's momentum (a
1065
+ * spring back from past an edge): under Reduce Motion it is no coast and
1066
+ * cross-fades like `animate` (`design:reduced-motion` DR2).
1067
+ */
1068
+ readonly isTransition?: boolean;
1069
+ }
1070
+ /** How `set` puts values in place. */
1071
+ interface SetOptions {
1072
+ /**
1073
+ * Whether the write promotes its channels to a compositing layer, as a
1074
+ * drag's per-frame writes need so each is a composite only (default
1075
+ * true). `false` writes the values and nothing else: a one-off switch that
1076
+ * must not give its element a layer, such as a veil under a sticky header
1077
+ * switched during a programmatic scroll (on iOS 26.2, a layer there blanks
1078
+ * the header's painted items for about two frames). A channel another
1079
+ * motion keeps promoted stays promoted, and a channel with other motion
1080
+ * still running gets its animation's layer as usual.
1081
+ */
1082
+ promote?: boolean;
1083
+ }
1084
+ /**
1085
+ * Options of `createMotionEngine`.
1086
+ */
1087
+ interface AnimatorOptions {
1088
+ /**
1089
+ * Animates a pseudo-element of the element instead (`'::backdrop'` of a
1090
+ * native dialog). A pseudo-element has no inline style. So a static filling
1091
+ * animation holds its value after a curve ends and after `set`, unless the
1092
+ * value is its `base`.
1093
+ */
1094
+ pseudoElement?: string;
1095
+ /** Starting values; identity by default. Never read from the DOM. */
1096
+ initial?: MotionValues;
1097
+ /**
1098
+ * For a pseudo-element: the values its own stylesheet shows at rest. A
1099
+ * value equal to its base needs no holding animation, so the
1100
+ * pseudo-element keeps no compositing layer there. Declare only what the
1101
+ * stylesheet shows: in development, the first hold dropped warns when the
1102
+ * computed style differs.
1103
+ */
1104
+ base?: MotionValues;
1105
+ /** Clock in ms on the document timeline's time base. */
1106
+ now?: () => number;
1107
+ /**
1108
+ * Runs a callback in the next animation frame, with the frame's timestamp;
1109
+ * `requestAnimationFrame` by default. A call from rest reads the start the
1110
+ * browser gave it there.
1111
+ */
1112
+ requestFrame?: (callback: (frame?: number) => void) => void;
1113
+ /**
1114
+ * Renders `x` into this custom property instead of `translate`, for an
1115
+ * element whose parts all read one value, such as a row's swipe travel.
1116
+ * `y` is not rendered. The value is a `<length>` in px or a plain
1117
+ * `<number>`. Registration lets it interpolate. It is inherited, so every
1118
+ * part of the element reads it. It animates on the main thread, not the
1119
+ * compositor, and every other channel renders as usual.
1120
+ * A `companion` is a second custom property that its `map` draws from x in
1121
+ * the same keyframes and writes. It shares x's animation and start, so it
1122
+ * follows x through every retarget and Reduce Motion plan.
1123
+ */
1124
+ customProperty?: {
1125
+ name: string;
1126
+ syntax: '<length>' | '<number>';
1127
+ companion?: {
1128
+ name: string;
1129
+ syntax: '<length>' | '<number>';
1130
+ map: (x: number) => number;
1131
+ };
1132
+ };
1133
+ }
1134
+ /**
1135
+ * One `animate` / `decay` call's animations.
1136
+ */
1137
+ interface MotionHandle {
1138
+ /** The properties this call drives. */
1139
+ readonly properties: ReadonlyArray<MotionProperty>;
1140
+ /**
1141
+ * True when every property reached the end of this call's curve, false
1142
+ * as soon as any of them is retargeted, stopped or set before that.
1143
+ */
1144
+ readonly finished: Promise<boolean>;
1145
+ /**
1146
+ * When the motion started on the document timeline (ms): for a call from
1147
+ * rest, the time the browser committed it (a block before the first frame
1148
+ * moves it later); otherwise the call time, or `at`. A retarget whose
1149
+ * frame comes late starts its springs at that frame, and this stays the
1150
+ * call time.
1151
+ */
1152
+ readonly started: Promise<number>;
1153
+ /** Presentation value of a property at `time` (default now). */
1154
+ value: (property: MotionProperty, time?: number) => number;
1155
+ /** Presentation velocity of a property at `time`, units/s. */
1156
+ velocity: (property: MotionProperty, time?: number) => number;
1157
+ /**
1158
+ * The curve this call started on `property` (`scale` reads `scaleX`),
1159
+ * in seconds from the call's start: what the keyframes play. Null for a
1160
+ * property the call does not move, or moves without travel (Reduced
1161
+ * Motion). Map it onto a companion property with `mapProgress`, and play
1162
+ * that on the same clock. A retarget whose frame comes late starts its
1163
+ * spring again at that frame, and this stays the curve the call started.
1164
+ */
1165
+ curve: (property: MotionProperty | 'scale') => MotionCurve | null;
1166
+ /** New targets for this call's properties, keeping their velocity. */
1167
+ retarget: (to: MotionValues, transition?: SpringTransition, options?: AnimateOptions) => MotionHandle;
1168
+ /** Freezes this call's properties at their presentation values. */
1169
+ stop: () => void;
1170
+ }
1171
+ /**
1172
+ * A compositor animator bound to one element (see the file header).
1173
+ */
1174
+ interface Animator {
1175
+ /**
1176
+ * What Reduced Motion makes of a call on this element right now:
1177
+ * `'off'` (motion plays), `'crossfade'` (an opacity-only fade: a coarse
1178
+ * pointer, or `touchRelease`) or `'instant'` (any other pointer). For
1179
+ * feedback that has no fade of its own (a press lift, a lens chasing the
1180
+ * finger): skip it unless `'off'`.
1181
+ */
1182
+ reducedMotion: (options?: {
1183
+ touchRelease?: boolean;
1184
+ }) => 'off' | 'crossfade' | 'instant';
1185
+ /** The element the animator writes to, if attached. */
1186
+ readonly element: HTMLElement | null;
1187
+ /**
1188
+ * Attaches (or detaches, with null) the element. Attaching writes the
1189
+ * current state and resumes running curves from now.
1190
+ */
1191
+ attach: (element: HTMLElement | null) => void;
1192
+ /** Presentation value at `time` (default now), from the curve. */
1193
+ get: (property: MotionProperty | 'scale', time?: number) => number;
1194
+ /** Presentation velocity at `time` (default now), units/s. */
1195
+ getVelocity: (property: MotionProperty | 'scale', time?: number) => number;
1196
+ /**
1197
+ * Puts values in place now, ending their animations: the per-frame write
1198
+ * of a drag (one style write per channel, no animation when nothing else
1199
+ * on the channel is moving).
1200
+ */
1201
+ set: (values: MotionValues, options?: SetOptions) => void;
1202
+ /** Springs to `to` from the presentation values. */
1203
+ animate: (to: MotionValues, transition: SpringTransition, options?: AnimateOptions) => MotionHandle;
1204
+ /**
1205
+ * Plays given curves (`scale` drives both axes), baked like a spring:
1206
+ * presentation values, velocities, `stop`, `finished` and the shared
1207
+ * clock work the same, and a later `animate` starts from the curve's
1208
+ * value and velocity. Reduced Motion treats a curve that moves x, y, rotate
1209
+ * or scale as travel, which the policy replaces (design:reduced-motion: a
1210
+ * cross-fade after a touch, an immediate change otherwise). Its handle has
1211
+ * no spring of its own: `retarget` needs one.
1212
+ */
1213
+ play: (curves: Partial<Record<MotionProperty | 'scale', MotionCurve>>, options?: AnimateOptions) => MotionHandle;
1214
+ /**
1215
+ * Plays momentum curves as given, on the translate axes only: a released
1216
+ * scroll view's coast and edge bounce, which `coast()` (coast.ts) builds
1217
+ * from a finger's release velocity. Under Reduce Motion momentum keeps
1218
+ * its motion: it continues a throw, direct movement (design:reduced-motion
1219
+ * DR2, DEC-2). A curve marked `isTransition` (coast()'s spring back from
1220
+ * past an edge) is a transition and plays through the Reduce Motion
1221
+ * policy, as `animate` does. Anything else (a fade, a slide a tap starts)
1222
+ * is a transition too: play it with `play` or `animate`. Pass
1223
+ * `touchRelease` when a touch drag's release starts it, so a spring back
1224
+ * cross-fades on any pointer (DR2). Only a surface that coasts imports the
1225
+ * coast math and the scroll table.
1226
+ */
1227
+ decay: (curves: Partial<Record<'x' | 'y', MotionCurve>>, options?: Pick<AnimateOptions, 'at' | 'touchRelease'>) => MotionHandle;
1228
+ /**
1229
+ * Moves properties by the given amounts at once, as when a layout shift
1230
+ * moves the element under them: a property moving on a spring keeps its
1231
+ * spring, velocity and target (the curve restarts from the shifted value);
1232
+ * any other moving curve shifts whole, its end included; a resting
1233
+ * property takes the offset and stays. `towards` moves some springs whole
1234
+ * instead (RebaseOptions).
1235
+ */
1236
+ rebase: (deltas: MotionValues, options?: RebaseOptions) => void;
1237
+ /** Freezes properties (all by default) at their presentation values. */
1238
+ stop: (properties?: ReadonlyArray<MotionProperty | 'scale'>) => void;
1239
+ /**
1240
+ * Resolves once none of `properties` (every property by default) is moving:
1241
+ * after the last curve ends, whoever started it, retargets included.
1242
+ */
1243
+ atRest: (properties?: ReadonlyArray<MotionProperty | 'scale'>) => Promise<void>;
1244
+ /** Cancels everything and detaches. */
1245
+ dispose: () => void;
1246
+ }
1247
+ //#endregion
1248
+ //#region src/motion/animator.d.ts
1249
+ /**
1250
+ * The one animator for `element` (and `options.pseudoElement`), created on
1251
+ * first use. Code that animates one element from several places (a swipe on
1252
+ * x, a removal on y) shares it, so their curves compose in one `translate`
1253
+ * track and retargeting one axis leaves the other on its curve; two
1254
+ * animators on one element would overwrite each other. `options` apply
1255
+ * when it is created; later calls get the same animator. Never `attach` it
1256
+ * elsewhere or `dispose` it: it lives as long as the element.
1257
+ */
1258
+ export declare function animatorFor(element: HTMLElement, options?: AnimatorOptions): Animator;
1259
+ /**
1260
+ * Creates an animator for `element` (or for an element attached later).
1261
+ *
1262
+ * @example
1263
+ * ```
1264
+ * const animator = createMotionEngine(sheet);
1265
+ * // finger lifts at 1200 px/s heading for the detent at 0 (a component
1266
+ * // passes the spring of its motion role):
1267
+ * animator.animate({y: 0}, {spring: {response: 0.45, dampingRatio: 0.9}, velocity: {y: 1200}});
1268
+ * // the finger lands again: where is it right now?
1269
+ * const y = animator.get('y', event.timeStamp);
1270
+ * animator.stop(['y']);
1271
+ * ```
1272
+ */
1273
+ export declare function createMotionEngine(element: HTMLElement | null, options?: AnimatorOptions): Animator;
1274
+ //#endregion
1275
+ //#region src/composables/internal/focusLeaving.d.ts
1276
+ /**
1277
+ * 如果变化会让焦点丢掉就返回 true:现在哪儿都没有焦点,或者焦点还在即将被藏起的 `surface` 里。
1278
+ * 读 `surface` 自己所在的文档,所以 iframe 或画中画窗口里的元素也能判断。
1279
+ */
1280
+ export declare function isFocusLost(surface: Element | null, doc?: Document): boolean;
1281
+ //#endregion
1282
+ //#region src/composables/internal/interactionModality.d.ts
1283
+ /**
1284
+ * 交互模态:用户上一次是用键盘还是用指针(鼠标、手指、笔)操作的。
1285
+ *
1286
+ * `:focus-visible` 仍然是画焦点环的条件,但它答不了「是不是键盘移过来的焦点」:
1287
+ * 鼠标点进文本框也会命中 `:focus-visible`,程序聚焦也会。只想在键盘操作后画环的组件,
1288
+ * 拿这里的答案和 `:focus-visible` 一起判断,不是替代它。
1289
+ *
1290
+ * 状态挂在 `document` 上(用全局 Symbol 作键),页面里就算打进了两份本库,
1291
+ * 也只有一份状态、一对监听。第一个用到的组件装上监听,之后一直留到页面结束,
1292
+ * 免得两个组件之间的空档里漏掉输入。模块加载时不碰 DOM,服务端答键盘(最安全的默认)。
1293
+ */
1294
+ type InteractionModality = 'keyboard' | 'pointer';
1295
+ //#endregion
1296
+ //#region src/composables/internal/focusReturn.d.ts
1297
+ /**
1298
+ * 程序移动焦点,焦点环跟着上一次的输入走:
1299
+ * 上一次是键盘就照常画环,上一次是鼠标或手指就不画。
1300
+ *
1301
+ * 用鼠标或手指关掉浮层后,焦点回到触发器上,但触发器不会突然亮起一圈焦点环。
1302
+ * 文本输入类元素例外:它们本来就要画出「打字会落在这里」,多一次 blur 还可能触发校验,
1303
+ * 所以一律直接聚焦。`options` 原样交给 `focus()`,例如 `preventScroll`。
1304
+ * `modality` 是调用方已经读到的上一次输入,不传就读页面当前的。
1305
+ */
1306
+ export declare function focusForLastInput(element: HTMLElement, options?: FocusOptions, modality?: InteractionModality): void;
1307
+ //#endregion
1308
+ //#region src/utils/inputAge.d.ts
1309
+ /**
1310
+ * @file inputAge.ts
1311
+ * @input An input's time stamp, and its event or the node it landed on
1312
+ * @output clockOf, timeOn and msSinceInput: the clock of the window that
1313
+ * stamped an input, its time on that clock, and how long ago it happened
1314
+ * @position Internal utility. The content-touch delay (utils/pressFeedback.ts,
1315
+ * gestures/PressTracker.ts) and the long-press hold
1316
+ * (hooks/longPressDetector.ts) count from the touch with it.
1317
+ */
1318
+ /**
1319
+ * The part of a window's performance timeline an input's age reads, with
1320
+ * the time origin that converts an epoch stamp.
1321
+ */
1322
+ type EventClock = Pick<Performance, 'now' | 'timeOrigin'>;
1323
+ //#endregion
1324
+ //#region src/gestures/ScreenEdgePanGestureRecognizer.d.ts
1325
+ /**
1326
+ * An edge by writing direction: under RTL the leading edge is the right one.
1327
+ * Top and bottom edges land with their first user.
1328
+ */
1329
+ type ScreenEdge = 'leading' | 'trailing';
1330
+ /** A physical horizontal edge of the viewport. */
1331
+ type PhysicalEdge = 'left' | 'right';
1332
+ /**
1333
+ * A screen-edge pan is a finger's: it takes no `allowedPointerTypes` and no
1334
+ * `allowedScrollTypes`, so neither a mouse, a trackpad nor a pen drives it.
1335
+ */
1336
+ interface ScreenEdgePanGestureRecognizerOptions extends Omit<PanGestureRecognizerOptions, 'direction' | 'allowedPointerTypes' | 'allowedScrollTypes' | 'hysteresis'> {
1337
+ /** The edges a touch may start from. @default ['leading'] */
1338
+ edges?: ReadonlyArray<ScreenEdge>;
1339
+ /** Width of the band at each edge, px. */
1340
+ edgeRegion?: number;
1341
+ /**
1342
+ * The travel that begins the pan in its edge zone, px. It is one number for
1343
+ * every press, since the zone sets the threshold itself. @default UIKit's 15
1344
+ */
1345
+ hysteresis?: number;
1346
+ }
1347
+ export declare class ScreenEdgePanGestureRecognizer extends PanGestureRecognizer {
1348
+ get kind(): PanGestureRecognizer['kind'];
1349
+ edges: ReadonlyArray<ScreenEdge>;
1350
+ edgeRegion: number;
1351
+ /** The physical edge the current gesture started from. */
1352
+ activeEdge: PhysicalEdge | null;
1353
+ /**
1354
+ * Internal. Set by the host while attached: called when the edge-zone
1355
+ * answer changes, so the element's `touch-action` follows it
1356
+ * (spec:AST-094 FR19, DEC-22).
1357
+ */
1358
+ onTouchBehaviorChange: (() => void) | null;
1359
+ /** The hysteresis where the pan takes its axis (UIKit's 15 px). */
1360
+ private readonly edgeHysteresis;
1361
+ /** What the pan measured of its view (see EdgeLayout), until a layout change. */
1362
+ private layout;
1363
+ constructor(options?: ScreenEdgePanGestureRecognizerOptions);
1364
+ /**
1365
+ * The pan takes the horizontal axis only in its edge zone, a view within
1366
+ * the band of an edge it watches; elsewhere it leaves the browser every
1367
+ * touch behavior, so the author's scrolling is untouched (spec:AST-094
1368
+ * FR18), never claiming across a whole wider element.
1369
+ */
1370
+ get nativeTouchBehavior(): NativeTouchBehavior;
1371
+ /**
1372
+ * Internal. Whether the edge zone depends on the viewport's width: the pan
1373
+ * watches the right side, whose band moves with the viewport, so the host
1374
+ * reports a viewport resize to it as well as its own box's (FR19, FR24).
1375
+ */
1376
+ get watchesViewport(): boolean;
1377
+ /**
1378
+ * Internal. The view's box may have changed (a resize): its edges' sides
1379
+ * and the edge zone are measured again, and a changed answer calls
1380
+ * onTouchBehaviorChange.
1381
+ */
1382
+ layoutChanged(): void;
1383
+ protected touchesBegan(touches: ReadonlyArray<GestureTouch>, event: GestureEventContext): void;
1384
+ /**
1385
+ * The physical sides the pan's edges resolve to under the view's writing
1386
+ * direction, and the sides whose band the view lies within, measured
1387
+ * together once until a layout change: the view starts at that side and
1388
+ * reaches no farther than `edgeRegion` from it, within layout's rounding
1389
+ * (a strip authored at the 40.2 px region lays out at 40.203 px, on
1390
+ * 1/64 px). A view that cannot be measured lies within none.
1391
+ */
1392
+ private measured;
1393
+ protected reset(): void;
1394
+ private edgeAt;
1395
+ }
1396
+ //#endregion
1397
+ //#region src/gestures/hostHelpers.d.ts
1398
+ interface PlacedContact {
1399
+ readonly x: number;
1400
+ readonly y: number;
1401
+ readonly target: unknown;
1402
+ }
1403
+ //#endregion
1404
+ //#region src/gestures/hostWheel.d.ts
1405
+ /** A wheel gesture: the contacts it drives in the arena, or none where the page keeps it. */
1406
+ interface WheelGesture {
1407
+ readonly kind: 'pan' | 'pinch';
1408
+ /** A mouse wheel's notches, or a trackpad's continuous scroll. */
1409
+ readonly scrollType: ScrollType;
1410
+ readonly ids: ReadonlyArray<number>;
1411
+ /** A pan's contact, or a pinch's center. */
1412
+ x: number;
1413
+ y: number;
1414
+ /** A pinch's span between its two contacts. */
1415
+ span: number;
1416
+ /** The latest wheel's time. */
1417
+ last: number;
1418
+ /**
1419
+ * How long after its last wheel it ends, ms. A trackpad pan stream waits
1420
+ * out its axis's pause bound, whoever keeps it. A pinch or a mouse wheel's
1421
+ * notches wait 100 ms.
1422
+ */
1423
+ readonly endMs: number;
1424
+ timer: unknown;
1425
+ /** The recognizers that took it; none where the page keeps it. */
1426
+ readonly takers: ReadonlyArray<GestureRecognizer>;
1427
+ /** A trackpad scroll a pan follows, until its fingers lift. */
1428
+ follow?: WheelFollow;
1429
+ }
1430
+ /** A trackpad scroll a pan follows: where its fingers lift, and what waits until then. */
1431
+ interface WheelFollow {
1432
+ /** The fingers lifted: the momentum after them never moves the pan. */
1433
+ lifted: boolean;
1434
+ /**
1435
+ * Shrinking deltas held until the splitter decides. They are the fingers'
1436
+ * when larger ones follow, and the start of momentum when it reads the
1437
+ * lift.
1438
+ */
1439
+ heldX: number;
1440
+ heldY: number;
1441
+ /** The time of the fingers' last move the pan took. */
1442
+ lastMove: number;
1443
+ /** The fingers' travel as of that move: the contact without any held delta. */
1444
+ trueX: number;
1445
+ trueY: number;
1446
+ /** Where the pan was shown at that move, which the undecided stretch moves on from. */
1447
+ baseX: number;
1448
+ baseY: number;
1449
+ /** The fingers' speed at that move, content px per ms. */
1450
+ speedX: number;
1451
+ speedY: number;
1452
+ /**
1453
+ * The reading behind that speed: the fingers' travel where it began, and
1454
+ * its interval in ms.
1455
+ */
1456
+ readFromX: number;
1457
+ readFromY: number;
1458
+ readSpan: number;
1459
+ /** The fingers' speed before that reading, content px per ms. */
1460
+ priorSpeedX: number;
1461
+ priorSpeedY: number;
1462
+ }
1463
+ //#endregion
1464
+ //#region src/gestures/PressTracker.d.ts
1465
+ interface PressBounds {
1466
+ readonly left: number;
1467
+ readonly top: number;
1468
+ readonly right: number;
1469
+ readonly bottom: number;
1470
+ }
1471
+ //#endregion
1472
+ //#region src/gestures/hostTypes.d.ts
1473
+ interface Registration {
1474
+ readonly recognizers: GestureRecognizer[];
1475
+ consumer: TouchConsumer | null;
1476
+ /**
1477
+ * Where fingers come from their pointer events, whether the element
1478
+ * carries the host's blocking `touchend` handler, which cancels a claimed
1479
+ * finger's lift (`spec:AST-094` FR21).
1480
+ */
1481
+ hasTouchEndListener: boolean;
1482
+ /** Whether the element carries the host's shared blocking touchmove handler. */
1483
+ hasTouchMoveListener: boolean;
1484
+ /** Whether the element carries the host's wheel handler. */
1485
+ hasWheelListener: boolean;
1486
+ /** Inline values the host replaced, to restore on detach. */
1487
+ readonly savedStyle: Map<string, string>;
1488
+ /**
1489
+ * What the element's own stylesheet gives it, read in a frame for the
1490
+ * derived value the host marked then: `null` where the host's rule is in
1491
+ * force (the author sets nothing else); the host never allows more than
1492
+ * the author does. `null` before the read.
1493
+ */
1494
+ authorTouchAction: {
1495
+ derived: string;
1496
+ author: string | null;
1497
+ } | null;
1498
+ manageStyle: boolean;
1499
+ /**
1500
+ * The recognizers attached with `manageStyle: false`. The host styles the
1501
+ * element for its other recognizers only.
1502
+ */
1503
+ readonly unstyled: Set<GestureRecognizer>;
1504
+ /** An action group (`family:action-groups` FR5). */
1505
+ actionGroup: boolean;
1506
+ /** The attachments that asked for the action group; it lasts while one does. */
1507
+ actionGroupAsks: number;
1508
+ }
1509
+ interface GestureHostOptions {
1510
+ /** The arena's clock; tests pass a manual one. */
1511
+ clock?: GestureClock;
1512
+ /**
1513
+ * Where fingers come from: Touch Events where the browser has them
1514
+ * (`auto`), or Pointer Events only.
1515
+ */
1516
+ inputMode?: 'auto' | 'pointer-events';
1517
+ /** Every recognizer transition, for debugging and tests. */
1518
+ onTransition?: GestureArenaOptions['onTransition'];
1519
+ /**
1520
+ * Send a contact to what is drawn while a compositor animation moves an
1521
+ * element (motion/presentation.ts): `auto` where the engine hit-tests such
1522
+ * an element where its animation started (iOS WebKit); `always` or
1523
+ * `never` for tests. @default 'auto'
1524
+ */
1525
+ presentedHitTesting?: 'auto' | 'always' | 'never';
1526
+ /**
1527
+ * Whether the primary pointer is coarse (a phone, a tablet). Gestures
1528
+ * attach for every pointer (`spec:AST-094` FR43); where it is fine, an
1529
+ * element that uses a gesture keeps one passive `pointerdown` listener
1530
+ * (beside a claiming recognizer's blocking `touchmove`, FR19) and the
1531
+ * page's listeners last only a press (FR24).
1532
+ * @default `(pointer: coarse)` on the document's window
1533
+ */
1534
+ isPrimaryPointerCoarse?: () => boolean;
1535
+ }
1536
+ interface AttachOptions {
1537
+ /**
1538
+ * Let the host set the element's styles: its `touch-action`, and the
1539
+ * selection and callout lock a hold that does something keeps while it is
1540
+ * held (`spec:AST-094` FR41). With false the caller keeps both for this
1541
+ * recognizer, and the host still styles the element for its others.
1542
+ * @default true
1543
+ */
1544
+ manageStyle?: boolean;
1545
+ /**
1546
+ * Accepted and ignored: every attachment reads each event's pointer
1547
+ * (`spec:AST-094` FR43). Kept so callers written before FR43 compile.
1548
+ * @deprecated
1549
+ */
1550
+ perEventPointer?: boolean;
1551
+ /**
1552
+ * The element is an action group, sibling actions a held pointer slides
1553
+ * across (`family:action-groups` FR5). It is served like every
1554
+ * attachment, for every pointer (`spec:AST-094` FR43). @default false
1555
+ */
1556
+ actionGroup?: boolean;
1557
+ }
1558
+ //#endregion
1559
+ //#region src/utils/dragSelection.d.ts
1560
+ /**
1561
+ * @file dragSelection.ts
1562
+ * @input The elements a claimed mouse or pen drag presses, their window,
1563
+ * and the page's selection when the press began
1564
+ * @output lockDragSelection (and its DragSelectionHold and
1565
+ * DragSelectionReleaseOptions): a claimed drag's hold, which refuses a new
1566
+ * selection and keeps the page's
1567
+ * @position The gesture host's drag hold; a held finger's lock is
1568
+ * lockSelection in selectionLock.ts, and the selection reads are
1569
+ * selectionRanges.ts
1570
+ *
1571
+ * SYNC: When modified, update gestures/hostSelection.ts.
1572
+ */
1573
+ interface DragSelectionReleaseOptions {
1574
+ /**
1575
+ * The press was cancelled (a pointercancel, a blur, a detach), so no
1576
+ * mouseup or click follows: the hold ends at once. Called again after a
1577
+ * lift, it ends the hold's last task at once too.
1578
+ */
1579
+ isCancel?: boolean;
1580
+ }
1581
+ /** A drag's selection hold: call it to release the hold. */
1582
+ interface DragSelectionHold {
1583
+ (options?: DragSelectionReleaseOptions): void;
1584
+ /**
1585
+ * Called after the lift's own handlers ran. A selection they made since
1586
+ * the release stays: the hold then puts it back, not the press's.
1587
+ */
1588
+ keepLiftSelection: () => void;
1589
+ }
1590
+ //#endregion
1591
+ //#region src/gestures/wheelSegmenter.d.ts
1592
+ /**
1593
+ * @file wheelSegmenter.ts
1594
+ * @input A wheel stream's deltas along one axis, with their event times
1595
+ * @output Exports WheelSegmenter and isBunched. WheelSegmenter splits the
1596
+ * stream into gestures and reads a trackpad's lift (the onset of momentum).
1597
+ * It keeps a trackpad's late or merged glide wheels in their flick.
1598
+ * isBunched tells one stall's merge from a frame.
1599
+ * @position Read by GestureHost.ts's wheel input: the web reports no
1600
+ * trackpad contact or phase, so both are inferred.
1601
+ */
1602
+ type WheelBoundary = 'first' | 'idle' | 'reversal' | 'jump' | 'gap';
1603
+ type WheelPhase = 'finger' | 'momentum';
1604
+ interface WheelSegment {
1605
+ /** Why this event starts a new gesture, or null when it continues one. */
1606
+ readonly boundary: WheelBoundary | null;
1607
+ readonly phase: WheelPhase;
1608
+ /** The gesture's number, counting from 1. */
1609
+ readonly gesture: number;
1610
+ /** This event is where the fingers lifted (momentum begins with it). */
1611
+ readonly liftNow: boolean;
1612
+ /** This event shrank, so it may be momentum: hold it until known. */
1613
+ readonly decaying: boolean;
1614
+ /** This event came so soon after the one before that it is a merge. */
1615
+ readonly bunched: boolean;
1616
+ /**
1617
+ * The signed travel of the late wheel before this one, with any wheel
1618
+ * merged with it. It is handed over when that wheel joined the glide and
1619
+ * this one grows into a new gesture; else 0.
1620
+ */
1621
+ readonly carried: number;
1622
+ }
1623
+ /**
1624
+ * A trackpad gesture has a finger phase and, after a fling, a momentum phase.
1625
+ * In the finger phase, deltas come while the fingers move, with pauses when
1626
+ * they move slowly. In the momentum phase, deltas come at frame rate and
1627
+ * shrink smoothly. The lift is the start of a run of shrinking deltas that
1628
+ * has lost a fifth of its size. In the finger phase, a pause of `idleMs`
1629
+ * ends the gesture. In the momentum phase, a reversal, a jump up against the
1630
+ * decay, or a pause of 50 ms starts a new gesture. A bunched wheel is never
1631
+ * a jump. The decay reads it by its last step. Momentum never pauses,
1632
+ * reverses or grows.
1633
+ *
1634
+ * A stalled page receives a trackpad's glide late, and the engine merges the
1635
+ * wheels it held. In momentum, a trackpad wheel that the glide's decay
1636
+ * explains stays in the flick. It may come after a pause, or rise after more
1637
+ * than a frame. It is at or below the next step, or near the sum of the next
1638
+ * steps its stall spans. After such a wheel, a trackpad wheel that grows
1639
+ * starts a new gesture and takes the late wheel's travel. The decay also
1640
+ * reads a trackpad merge in momentum, by its last step. It reads one in a
1641
+ * shrinking run too, where it explains the merge better than steady steps
1642
+ * do. Other wheels keep the rules above.
1643
+ */
1644
+ declare class WheelSegmenter {
1645
+ gesture: number;
1646
+ phase: WheelPhase;
1647
+ private last;
1648
+ private previous;
1649
+ private sign;
1650
+ private count;
1651
+ private run;
1652
+ private runStart;
1653
+ /** The decay's step-to-step ratio, from the last two one-step wheels. */
1654
+ private ratio;
1655
+ /** The gesture's last on-pace intervals, ms: their median is its frame. */
1656
+ private paces;
1657
+ /** The intervals in a row that came slower than the frame allows, ms. */
1658
+ private slower;
1659
+ /** When the gesture's last wheel within two frames of the one before came. */
1660
+ private onPace;
1661
+ /** The gesture's last wheel that was not bunched, px. */
1662
+ private paced;
1663
+ /** A wheel joined the glide late: a later one that grows is the fingers'. */
1664
+ private resumed;
1665
+ /**
1666
+ * The signed travel of the last wheel that joined the glide late, with any
1667
+ * wheel merged with it.
1668
+ */
1669
+ private joined;
1670
+ /**
1671
+ * Reads one wheel. `continuous` is whether it carries a trackpad's
1672
+ * signature (`scrollTypeOf`). Only those wheels can join a glide late.
1673
+ */
1674
+ push(time: number, delta: number, idleMs: number, continuous?: boolean): WheelSegment;
1675
+ /**
1676
+ * Keep an interval for the frame. The gesture's first FIRST_PACES set it.
1677
+ * After them, only an interval within half a frame and one and a half
1678
+ * frames counts: a stall's squeezed wheels come faster. FIRST_PACES slower
1679
+ * intervals in a row set the frame again, so a squeezed start cannot hold
1680
+ * it down.
1681
+ */
1682
+ private notePace;
1683
+ /**
1684
+ * The gesture's frame interval: the median of its last on-pace intervals,
1685
+ * or FRAME_MS before it shows one. A trackpad reports at 60 Hz or faster,
1686
+ * so a longer median is a stall's.
1687
+ */
1688
+ private frameMs;
1689
+ /** The sum of the decay's next `count` steps from `previous`. */
1690
+ private glideSum;
1691
+ /**
1692
+ * How far a merge of `size` lies from whole steps of the run's steady
1693
+ * size, or of its last step, whichever lies nearer.
1694
+ */
1695
+ private steadyOff;
1696
+ /**
1697
+ * How many of the decay's next steps a trackpad wheel of `size` carries,
1698
+ * at most `most`. A wheel at or below the next step carries one. A larger
1699
+ * one carries the fewest steps whose sum lies within FIT_PX or `share` of
1700
+ * it. The decay goes on from `previous` at `ratio` a step. Null when
1701
+ * no sum lies that near.
1702
+ */
1703
+ private glideSteps;
1704
+ /** The gesture ended on its own (its timer): the next event starts one. */
1705
+ end(): void;
1706
+ }
1707
+ //#endregion
1708
+ //#region src/gestures/hostState.d.ts
1709
+ /** The host's state: its arena, clock, notes per contact and per element, and the reads every layer shares; GestureHost is the class to use. */
1710
+ declare abstract class HostState {
1711
+ protected abstract lockClaimedDrags(ids: ReadonlyArray<number>, claimer: GestureRecognizer): void;
1712
+ protected abstract refresh(element: Element, registration: Registration): void;
1713
+ protected abstract releaseArmedPress(): void;
1714
+ protected abstract releaseClaimedDrags(ids: ReadonlyArray<number>): void;
1715
+ protected abstract replayClick(touch: GestureTouch, allowed: boolean): void;
1716
+ protected abstract syncListeners(): void;
1717
+ readonly arena: GestureArena;
1718
+ protected readonly doc: Document;
1719
+ protected readonly registry: Map<Element, Registration>;
1720
+ /** Stops following the animator's moving elements (iOS WebKit only). */
1721
+ protected stopWatchingMovers: (() => void) | null;
1722
+ /** Whether the document carries the blocking touchmove for a mover. */
1723
+ protected stopBlockingForMovers: (() => void) | null;
1724
+ /** Elements whose caller touch-action waits for a read after paint. */
1725
+ protected readonly pendingCallerReads: Set<HTMLElement>;
1726
+ protected isCallerReadScheduled: boolean;
1727
+ /** Cancels the scheduled next-frame read (readCallerTouchActionInNextFrame). */
1728
+ protected cancelCallerRead: (() => void) | null;
1729
+ /** The selection lock each contact holds, by host contact id. */
1730
+ protected readonly lockedBy: Map<number, (options?: DragSelectionReleaseOptions) => void>;
1731
+ /**
1732
+ * The page's selection when each mouse or pen press began: a drag a
1733
+ * recognizer claims keeps it.
1734
+ */
1735
+ protected readonly pressSelections: Map<number, readonly AbstractRange[]>;
1736
+ /**
1737
+ * Mouse and pen contacts that began on selectable text. Once one moves, the
1738
+ * browser keeps the drag for a selection, and no recognizer claims it.
1739
+ */
1740
+ protected readonly selectingContacts: Set<number>;
1741
+ /**
1742
+ * Drag selection holds until their last task ends, a task after their lift
1743
+ * (lockDragSelection); the last detach ends them at once.
1744
+ */
1745
+ protected readonly dragHolds: Set<(options?: DragSelectionReleaseOptions) => void>;
1746
+ /** Each claimed contact's drag hold, until its lift or a give-back. */
1747
+ protected readonly claimHolds: Map<number, DragSelectionHold>;
1748
+ protected readonly presentedHitTesting: 'auto' | 'always' | 'never';
1749
+ /**
1750
+ * Contacts sent to what is drawn instead of what the engine hit, by host
1751
+ * contact id, with where they landed (for their click).
1752
+ */
1753
+ protected readonly retargeted: Map<number, {
1754
+ x: number;
1755
+ y: number;
1756
+ target: EventTarget;
1757
+ }>;
1758
+ /** Touch.identifier → arena id, for live fingers. */
1759
+ protected readonly touchIds: Map<number, number>;
1760
+ /**
1761
+ * Fingers cancelled because the app lost focus, kept until the browser
1762
+ * ends them: a browser that keeps such a touch alive must not let its
1763
+ * lift click (`spec:AST-094` FR28: nothing acts).
1764
+ */
1765
+ protected readonly cancelledFingers: Set<number>;
1766
+ /**
1767
+ * The pens and pointer-read fingers that the app's lost focus cancelled,
1768
+ * by pointer id. Each is kept until its lift, which must not click either,
1769
+ * or until a new press.
1770
+ */
1771
+ protected readonly cancelledPointers: Map<number, PointerKind>;
1772
+ /** Touch.identifier → the element the finger landed on. */
1773
+ protected readonly touchTargets: Map<number, EventTarget>;
1774
+ /**
1775
+ * Finger targets with listeners of their own: how many fingers each, and
1776
+ * how many of those a recognizer could claim while they move (only those
1777
+ * need the blocking `touchmove` listener).
1778
+ */
1779
+ protected readonly watched: Map<EventTarget, {
1780
+ count: number;
1781
+ blocking: number;
1782
+ claiming: number;
1783
+ }>;
1784
+ /** Fingers whose target listener is the blocking one. */
1785
+ protected readonly blockingFingers: Set<number>;
1786
+ /**
1787
+ * Fingers a participant could claim (a recognizer that claims touches, or
1788
+ * a press consumer): only their target's `touchend` may need cancelling,
1789
+ * so a touch only watchers follow gets a passive one (`spec:AST-094`
1790
+ * FR20).
1791
+ */
1792
+ protected readonly claimingFingers: Set<number>;
1793
+ /** Touch events already handled (the document's and the target's listeners both see one). */
1794
+ protected readonly processed: WeakSet<Event>;
1795
+ /** pointerId → arena id, for live mouse and pen contacts. */
1796
+ protected readonly pointerIds: Map<number, number>;
1797
+ /** Each contact's kind: a blur refuses a pen's or a pointer-read finger's lift, never a mouse's. */
1798
+ protected readonly pointerKinds: Map<number, PointerKind>;
1799
+ /**
1800
+ * The boxes the host watches for screen-edge pans (syncLayoutWatch): each
1801
+ * element with an enabled one, and the root for one whose band moves with
1802
+ * the viewport (spec:AST-094 FR18, FR19, DEC-22), and the one observer
1803
+ * that watches them.
1804
+ */
1805
+ protected readonly layoutWatched: Set<Element>;
1806
+ protected layoutObserver: ResizeObserver | null;
1807
+ /** Where and when the last pen hold the host tracked ended. */
1808
+ protected lastPenLift: {
1809
+ target: unknown;
1810
+ time: number;
1811
+ } | null;
1812
+ /**
1813
+ * Arena ids of the pen contacts that left the long press's tolerance
1814
+ * before its duration. No such contact is a hold.
1815
+ */
1816
+ protected readonly driftedPens: Set<number>;
1817
+ /** Fingers whose first uncancelable `touchmove` was already judged. */
1818
+ protected readonly judgedUncancelable: Set<number>;
1819
+ /**
1820
+ * A finger's pointerId → its arena id, once its pointerdown and its
1821
+ * touchstart are paired. Chromium sends no `touchmove` until a finger has
1822
+ * travelled its slop (about 16 px), but sends every `pointermove`, so a
1823
+ * paired finger is sampled from its pointer events (`pointerFed`); and its
1824
+ * `pointercancel` is the browser's claim of exactly that finger.
1825
+ */
1826
+ protected readonly fingerPointers: Map<number, number>;
1827
+ /** Finger pointerdowns still waiting for their touchstart. */
1828
+ protected readonly pendingPointers: Map<number, PlacedContact>;
1829
+ /**
1830
+ * A paired finger's lift, at its `pointerup`: the place and clock its moves
1831
+ * came on. Linux WebKit stamps the `touchend` that follows only after the
1832
+ * page's pointerup listeners finish. A busy listener would then make a flick
1833
+ * read as a resting finger. Read at the touchend, dropped with the finger.
1834
+ */
1835
+ protected readonly liftStamps: Map<number, {
1836
+ x: number;
1837
+ y: number;
1838
+ time: number;
1839
+ }>;
1840
+ /**
1841
+ * Where fingers come from their pointer events, where claimed fingers
1842
+ * lifted and when: the `touchend` that follows each `pointerup` is
1843
+ * cancelled (FR21). A record no `touchend` consumed expires
1844
+ * (CLAIMED_LIFT_MS).
1845
+ */
1846
+ protected readonly claimedLifts: (PlacedContact & {
1847
+ time: number;
1848
+ })[];
1849
+ /** The one timer that drops claimed lifts whose `touchend` never came. */
1850
+ protected claimedLiftTimer: unknown;
1851
+ /** The arena's clock, which the claimed lifts' timer runs on too. */
1852
+ protected readonly clock: GestureClock;
1853
+ /**
1854
+ * The clock of the document's own window, which stamps its events. A page
1855
+ * can replace it after the host exists, so each read looks it up.
1856
+ */
1857
+ protected get timing(): EventClock | null;
1858
+ /** Fingers still waiting for their pointerdown, by arena id. */
1859
+ protected readonly unpairedTouches: Map<number, PlacedContact>;
1860
+ protected readonly isPrimaryPointerCoarse: () => boolean;
1861
+ /** Whether the host follows `(pointer: coarse)` (no read was passed). */
1862
+ protected readonly followsPointer: boolean;
1863
+ /** The last sample fed per contact: a contact's time never runs back. */
1864
+ protected readonly lastFed: Map<number, TouchSample>;
1865
+ /**
1866
+ * Fingers whose samples come from their pointer events. A finger the
1867
+ * browser reports on both channels is sampled from ONE: the pointer
1868
+ * channel, where its pointerdown paired with its touchstart; touch events
1869
+ * sample only a finger no pointer event reported (no Pointer Events). The
1870
+ * other channel keeps its control duties (cancelling, claiming, the
1871
+ * browser's takeover) but never feeds a sample, so the two copies of one
1872
+ * move cannot both reach a velocity, however far apart they arrive.
1873
+ */
1874
+ protected readonly pointerFed: Set<number>;
1875
+ /** When a finger was last down or lifted, and where it landed. */
1876
+ protected lastTouch: {
1877
+ readonly target: Node;
1878
+ readonly time: number;
1879
+ } | null;
1880
+ /** Scrollers a recognizer is scrolling itself this frame (ownScroll). */
1881
+ protected readonly ownedScrolls: Map<Node, number>;
1882
+ /** Numbers each ownScroll call: only the newest one's timer clears it. */
1883
+ protected ownScrollCalls: number;
1884
+ /** Cancels each scroller's pending ownScroll frames. */
1885
+ protected readonly ownScrollFrames: Map<Node, () => void>;
1886
+ /** The last scroll a finger drove, and when. */
1887
+ protected lastScroll: {
1888
+ readonly scroller: Node;
1889
+ readonly time: number;
1890
+ } | null;
1891
+ /** Predicates that hold a touch's target away from every participant. */
1892
+ protected readonly touchGates: Set<(target: Node) => boolean>;
1893
+ /** Who keeps the listeners installed without a registration (retain). */
1894
+ protected retainers: number;
1895
+ /** Told after every touch event that changed the fingers on the screen. */
1896
+ protected readonly fingerListeners: Set<() => void>;
1897
+ /**
1898
+ * Where each finger now on the screen landed, from the last touch event's
1899
+ * `touches` (every finger, whether or not a recognizer tracks it).
1900
+ */
1901
+ protected fingerTargets: ReadonlyArray<Node>;
1902
+ protected nextId: number;
1903
+ /** The wheel gesture in progress. */
1904
+ protected wheel: WheelGesture | null;
1905
+ /** The wheel latch's input-stream subscription, while a gesture is latched. */
1906
+ protected stopWheelLatch: (() => void) | null;
1907
+ /** Splits the wheel stream into gestures and reads a trackpad's lift. */
1908
+ protected readonly segmenter: WheelSegmenter;
1909
+ /** The latest wheel's segment. */
1910
+ protected wheelSegment: WheelSegment | null;
1911
+ /** Wheels already taken: each element on the path with a listener hears one. */
1912
+ protected readonly wheelsSeen: WeakSet<Event>;
1913
+ protected isInstalled: boolean;
1914
+ /**
1915
+ * Whether the primary pointer is coarse (`spec:AST-094` FR19), read when
1916
+ * something first attaches and kept current while anything is attached.
1917
+ */
1918
+ protected isCoarse: boolean;
1919
+ protected stopWatchingPointer: (() => void) | null;
1920
+ /** The input stream subscriptions while installed. */
1921
+ protected unsubscribers: (() => void)[];
1922
+ /**
1923
+ * Where the primary pointer is fine, each element that uses a gesture
1924
+ * listens for a press itself; the page's listeners last that press (FR24).
1925
+ */
1926
+ protected readonly armedElements: Map<Element, () => void>;
1927
+ protected isArmedPress: boolean;
1928
+ /**
1929
+ * Whether the installed listeners include the cancelable ones (the
1930
+ * document's touchend, contextmenu and the window's click): only while a
1931
+ * participant that can claim is attached (`spec:AST-094` FR20).
1932
+ */
1933
+ protected isClaimingInstalled: boolean;
1934
+ /** The input stream subscriptions syncClaimingListeners keeps. */
1935
+ protected claimingUnsubscribers: (() => void)[];
1936
+ protected readonly inputMode: 'auto' | 'pointer-events';
1937
+ protected usesTouchEvents: boolean;
1938
+ constructor(doc: Document, options?: GestureHostOptions);
1939
+ /**
1940
+ * Internal. The document this host serves.
1941
+ */
1942
+ get document(): Document;
1943
+ /**
1944
+ * Internal. Whether a recognizer owns the touch with this Touch Events
1945
+ * `identifier`, so the browser must not pan it (pageHold.ts asks).
1946
+ */
1947
+ isTouchClaimed(identifier: number): boolean;
1948
+ /**
1949
+ * Re-derive an element's styles and the host's listeners after its
1950
+ * recognizers' options or its consumer's enabled state changed.
1951
+ */
1952
+ update(element: Element): void;
1953
+ /**
1954
+ * The Pointer Events `pointerId` of a contact the arena tracks: a mouse's
1955
+ * or a pen's own, and for a finger driven by touch events the pointer its
1956
+ * touch was paired with (null before the pairing, or without Pointer
1957
+ * Events). It hands a held finger to code that follows pointers, as a
1958
+ * menu does when a long press turns into a press-drag selection.
1959
+ */
1960
+ pointerIdOf(touch: GestureTouch | number): number | null;
1961
+ }
1962
+ //#endregion
1963
+ //#region src/gestures/hostAttach.d.ts
1964
+ /** Attaching recognizers and consumers, layout watches, and the registrations' reads; GestureHost is the class to use. */
1965
+ declare abstract class HostAttach extends HostState {
1966
+ protected abstract applyStyle(element: HTMLElement, registration: Registration): void;
1967
+ protected abstract endWheel(endTime?: number): void;
1968
+ protected abstract readonly onBlockingTouchMove: (event: Event) => void;
1969
+ protected abstract readonly onClaimedTouchEnd: (event: Event) => void;
1970
+ protected abstract readonly onWheel: (event: Event) => void;
1971
+ protected abstract syncTouchMoveListener(element: Element, registration: Registration): void;
1972
+ protected abstract uninstallIfIdle(): void;
1973
+ protected abstract watchPointer(): void;
1974
+ protected abstract wheelHasTaker(gesture: WheelGesture): boolean;
1975
+ /** Attach a recognizer to an element. Returns the detach function. */
1976
+ attach(element: Element, recognizer: GestureRecognizer, options?: AttachOptions): () => void;
1977
+ /**
1978
+ * Watch the box of each element with an enabled screen-edge pan, and the
1979
+ * root's for a pan that watches the right side, whose band moves with the
1980
+ * viewport: a resize may move an element into or out of its edge band, and
1981
+ * the pan then measures again and re-derives the element's touch-action
1982
+ * (FR19). The host sets touch-action for every pointer (FR43), so it
1983
+ * watches under any primary pointer. One ResizeObserver serves every
1984
+ * element and goes with the last one, and no listener is added (FR24); an
1985
+ * engine without ResizeObserver keeps each pan's first measurement.
1986
+ */
1987
+ protected syncLayoutWatch(): void;
1988
+ /** A watched box or the root resized: each enabled edge pan measures again. */
1989
+ protected readonly onLayoutChange: () => void;
1990
+ /** Attach the view-level touch consumer of an element (a pressable control). */
1991
+ attachConsumer(element: Element, consumer: TouchConsumer, _options?: Pick<AttachOptions, 'perEventPointer'>): () => void;
1992
+ /**
1993
+ * Internal. Keep the host's listeners installed until the returned
1994
+ * function runs, with no recognizer attached (fingerScroll.ts reads the
1995
+ * finger record meanwhile).
1996
+ */
1997
+ retain(): () => void;
1998
+ /**
1999
+ * Internal. Call `listener` after each touch event the host hears, once
2000
+ * the finger record is up to date. Returns the unsubscribe.
2001
+ */
2002
+ onFingersChange(listener: () => void): () => void;
2003
+ /** Internal. Whether a finger that landed inside `node` is down now. */
2004
+ isFingerDownIn(node: Node): boolean;
2005
+ /**
2006
+ * Internal. Whether a pen that went down inside `node` is down now,
2007
+ * whichever participant keeps it. A pen's own menu event is that hold's
2008
+ * (contextRequest.ts).
2009
+ */
2010
+ isPenDownIn(node: Node): boolean;
2011
+ /**
2012
+ * Internal. When a pen hold that went down inside `node` last ended, at
2013
+ * its lift or a cancel. The time is on the host's clock: negative infinity
2014
+ * when none did.
2015
+ */
2016
+ lastPenLiftIn(node: Node): number;
2017
+ protected registrationFor(element: Element): Registration;
2018
+ /** Whether anything attached could take input. */
2019
+ protected needsInput(): boolean;
2020
+ protected refresh(element: Element, registration: Registration): void;
2021
+ protected cleanup(element: Element, registration: Registration): void;
2022
+ }
2023
+ //#endregion
2024
+ //#region src/gestures/hostStyle.d.ts
2025
+ /** The derived touch-action and its writes, and which listeners an element keeps; GestureHost is the class to use. */
2026
+ declare abstract class HostStyle extends HostAttach {
2027
+ protected abstract hasClaimer(): boolean;
2028
+ protected abstract hitTestsLayout(): boolean;
2029
+ protected abstract install(): void;
2030
+ protected abstract readonly onContextMenu: (event: MouseEvent) => void;
2031
+ protected abstract readonly onTouchEnd: (event: TouchEvent) => void;
2032
+ protected abstract readsFingersFromPointerEvents(): boolean;
2033
+ protected abstract sendsTouchEvents(): boolean;
2034
+ protected abstract syncArmed(): void;
2035
+ protected abstract uninstall(): void;
2036
+ /**
2037
+ * The element's blocking `touchmove`. For every pointer a claiming
2038
+ * recognizer keeps it: a finger's claim cancels its moves here (FR19), a
2039
+ * listener FR24 counts outside the one-listener budget a fine pointer's
2040
+ * element keeps for its press (syncArmed). A kept press needs it only
2041
+ * while a press is held: a phone's before every touch (Safari honours a
2042
+ * blocking listener only when registered before the touch began), a fine
2043
+ * pointer's only during an armed press, whose `pointerdown` comes before
2044
+ * the touch it brings (FR24).
2045
+ */
2046
+ protected syncTouchMoveListener(element: Element, registration: Registration): void;
2047
+ protected applyStyle(element: HTMLElement, registration: Registration): void;
2048
+ /**
2049
+ * The touch-action to write inline, if any. The author's value (a
2050
+ * trigger's own `touch-action: none`) stays in force and the host never
2051
+ * allows more (spec:AST-094 FR18, DEC-8):
2052
+ * - an inline value is the style's own, read with no recalc, and the host
2053
+ * writes what both allow, inline; a CSS-wide keyword (`initial`,
2054
+ * `inherit`, `unset`, `revert`, `revert-layer`) names no touch-action of
2055
+ * its own, so it is read as an author rule is, as what it resolves to;
2056
+ * - otherwise the element is marked with the derived value, under a rule
2057
+ * any author rule outranks, as the recognizer attaches: a subtree that
2058
+ * mounts with it is styled once, never restyled for it in a later frame.
2059
+ * The next frame reads what is in force, styles clean, and the host
2060
+ * writes inline only what both allow where that is narrower than an
2061
+ * author rule's value.
2062
+ */
2063
+ protected touchActionToWrite(element: HTMLElement, registration: Registration, derived: string | undefined): string | undefined;
2064
+ /**
2065
+ * Read the touch-action in force on each marked element in the next frame,
2066
+ * then apply its style again. Batched: one style read serves every pending
2067
+ * element, and the writes follow the reads. The host has written no
2068
+ * touch-action inline on them, so a value other than the mark is an author
2069
+ * rule's.
2070
+ */
2071
+ protected readCallerTouchActionInNextFrame(element: HTMLElement): void;
2072
+ /**
2073
+ * Listen only while something could take a touch now (`spec:AST-094`
2074
+ * FR24, FR43): where the primary pointer is coarse, an enabled recognizer
2075
+ * or consumer, or a finger-scroll watch; where it is fine, only during a
2076
+ * press an element armed (syncArmed). Otherwise no document listener is
2077
+ * registered, so an idle page and a disabled control pay nothing.
2078
+ */
2079
+ protected syncListeners(): void;
2080
+ /**
2081
+ * Safari honours a blocking `touchmove` only where it was registered before
2082
+ * the touch began, on the engine's own target, and on iOS WebKit a finger
2083
+ * on an element a compositor animation moves lands, for the engine, on
2084
+ * whatever sits under the motion's start (see presentedTarget). So while an
2085
+ * element a recognizer that claims moving touches lives in (or around) is
2086
+ * moving, the blocking listener subscribes to the window's capturing
2087
+ * `touchmove` through the shared input stream with `{cancels: true}`,
2088
+ * which sees every touch on the page whatever the engine targets and makes
2089
+ * that one listener non-passive (`spec:AST-094` FR19;
2090
+ * architecture:react-component-runtime INV13). It leaves when the motion
2091
+ * ends: only while it is subscribed does a scroll starting anywhere wait on
2092
+ * the main thread.
2093
+ */
2094
+ protected syncMoverBlocking(): void;
2095
+ /** Whether a recognizer that claims moving touches lives in or around `mover`. */
2096
+ protected hasClaimingRecognizerAround(mover: Element): boolean;
2097
+ /**
2098
+ * Keeps the touchend cancelable, and the contextmenu subscription on,
2099
+ * only while a claimer is attached; with only watchers the touchend is
2100
+ * passive and the contextmenu is off. Clicks are the click guard's
2101
+ * (utils/clickGuard.ts), whose one listener a window gets only once a
2102
+ * gesture first arms it.
2103
+ */
2104
+ protected syncClaimingListeners(): void;
2105
+ protected shouldListen(): boolean;
2106
+ }
2107
+ //#endregion
2108
+ //#region src/gestures/hostInstall.d.ts
2109
+ /** Armed presses, the page listeners' install and uninstall, and the release when idle; GestureHost is the class to use. */
2110
+ declare abstract class HostInstall extends HostStyle {
2111
+ protected abstract cancelEverything(time: number): void;
2112
+ protected abstract clearClaimedLifts(): void;
2113
+ protected abstract readonly onBlur: () => void;
2114
+ protected abstract readonly onPointerCancel: (event: PointerEvent) => void;
2115
+ protected abstract readonly onPointerDown: (event: PointerEvent) => void;
2116
+ protected abstract readonly onPointerMove: (event: PointerEvent) => void;
2117
+ protected abstract readonly onPointerUp: (event: PointerEvent) => void;
2118
+ protected abstract readonly onScroll: (event: Event) => void;
2119
+ protected abstract readonly onTouchCancel: (event: TouchEvent) => void;
2120
+ protected abstract readonly onTouchMove: (event: TouchEvent) => void;
2121
+ protected abstract readonly onTouchStart: (event: TouchEvent) => void;
2122
+ protected abstract readonly onVisibilityChange: () => void;
2123
+ /**
2124
+ * Where the primary pointer is fine, each element with an enabled
2125
+ * recognizer or press consumer listens for a press itself: one passive
2126
+ * `pointerdown` listener on the element. The host's page listeners come at
2127
+ * that press and go once its contacts end and the arena drops their last
2128
+ * record (onIdle: a decision that waited on a timer), so an idle page has none
2129
+ * (`spec:AST-094` FR24, FR43). A finger on a touchscreen whose primary
2130
+ * pointer is fine sends its `pointerdown` before its `touchstart`, so the
2131
+ * host hears both.
2132
+ */
2133
+ protected syncArmed(): void;
2134
+ /** A press on an armed element, a mouse's primary button, a pen or a finger: listen for this press. */
2135
+ protected readonly onArmedPress: (event: Event) => void;
2136
+ /** A kept press's blocking `touchmove` follows the armed press (syncTouchMoveListener). */
2137
+ protected syncKeptPresses(): void;
2138
+ /**
2139
+ * A new press is a new gesture, as the click guard reads one, so the lifts
2140
+ * the blur cancelled owe nothing after it. A second finger keeps the other
2141
+ * fingers' refusals, since those fingers may still be down.
2142
+ */
2143
+ protected dropCancelledLifts(event: PointerEvent): void;
2144
+ /**
2145
+ * After a contact ends: an armed press that is over stops listening. A
2146
+ * contact the lost focus cancelled still owes its lift, so the press is
2147
+ * not over until that lift comes. A lift the page never hears ends it at
2148
+ * the next press, or at a cancel.
2149
+ */
2150
+ protected releaseArmedPress(): void;
2151
+ /** With nothing attached, stop listening and stop following the pointer. */
2152
+ protected uninstallIfIdle(): void;
2153
+ /**
2154
+ * In the microtask after the last detach, unless something attached again
2155
+ * in the same task (a component that remounts mid-press keeps its notes):
2156
+ * nothing the host holds outlives it, no note and no pending frame or
2157
+ * timer (`spec:AST-094` FR24).
2158
+ */
2159
+ protected releaseWhenIdle(): void;
2160
+ /** Read the primary pointer, and follow it while anything is attached. */
2161
+ protected watchPointer(): void;
2162
+ /**
2163
+ * The primary pointer turned coarse or fine (a tablet docking a mouse):
2164
+ * install or remove everything, as if each attach happened now.
2165
+ */
2166
+ protected pointerChanged(isCoarse: boolean): void;
2167
+ /**
2168
+ * Whether an enabled participant could claim a touch or cancel a lift: a
2169
+ * consumer, or a recognizer that claims touches and takes a finger or a
2170
+ * pen. With only watchers, or only scroll-only recognizers
2171
+ * (`allowedPointerTypes: []`), the host's listeners are all passive.
2172
+ */
2173
+ protected hasClaimer(): boolean;
2174
+ protected install(): void;
2175
+ protected uninstall(): void;
2176
+ }
2177
+ //#endregion
2178
+ //#region src/gestures/hostHitTest.d.ts
2179
+ /** Presented hit testing, click retargeting, and the participants a contact meets; GestureHost is the class to use. */
2180
+ declare abstract class HostHitTest extends HostInstall {
2181
+ /**
2182
+ * An element's box where it is drawn: the box the engine reports, moved
2183
+ * by the compositor animations of it and its ancestors on engines that
2184
+ * report and hit-test those where they started (iOS WebKit). Elsewhere
2185
+ * `getBoundingClientRect` already reports the drawn box. Press trackers
2186
+ * read their bounds through it.
2187
+ */
2188
+ presentedRect(element: Element): PressBounds;
2189
+ /** Whether this engine hit-tests a compositor-moved element at layout. */
2190
+ protected hitTestsLayout(): boolean;
2191
+ /**
2192
+ * Where a contact lands among what is drawn. iOS WebKit hit-tests an
2193
+ * element that a compositor animation moves where the animation started:
2194
+ * a finger on a settling sheet lands on whatever sat under the sheet's
2195
+ * start (the scrim, which closes it), and a finger where the sheet was
2196
+ * lands on the sheet. UIKit keeps an interruptible animation hit-testable
2197
+ * where it is drawn (UIViewPropertyAnimator). The touch goes to what was
2198
+ * drawn under the finger when it landed (`time`, its event's timestamp),
2199
+ * even when a busy main thread hands it over later, and content that slid
2200
+ * under the finger since takes nothing (`spec:AST-094` FR11).
2201
+ */
2202
+ protected presentedTarget(native: EventTarget | null, x: number, y: number, time: number): EventTarget | null;
2203
+ /** What is drawn at a point beneath every mover. */
2204
+ protected drawnBeneath(x: number, y: number, movers: ReadonlyArray<Element>): Element | null;
2205
+ /** What is drawn at a point, inside open shadow roots too. */
2206
+ protected drawnAt(x: number, y: number): Element | null;
2207
+ /** The browser took these touches (a scroll): no click of ours for them. */
2208
+ protected browserTook(ids: ReadonlyArray<number>, time: number): void;
2209
+ /**
2210
+ * The click a retargeted tap earned, on what was drawn under the finger.
2211
+ * The engine's own click would hit the start position, so the caller
2212
+ * cancels it (or the click guard drops it, a late one included) and this one
2213
+ * is the tap's single activation.
2214
+ */
2215
+ protected clickRetargeted(target: EventTarget, x: number, y: number, pointerType: string): void;
2216
+ /**
2217
+ * Whether a finger set a scroller containing `node` moving within the last
2218
+ * `window` ms. A touch there now brakes the scroll rather than pressing
2219
+ * whatever is under it: a native list highlights nothing for one.
2220
+ */
2221
+ isScrollBraking(node: Node, window?: number): boolean;
2222
+ /**
2223
+ * The recognizers on the path from `target` to the document, innermost
2224
+ * first, and (for a contact) its consumer: the innermost element with an
2225
+ * attached consumer.
2226
+ */
2227
+ protected participantsAt(target: unknown, pointerType: PointerKind | null): {
2228
+ recognizers: GestureRecognizer[];
2229
+ consumer: TouchConsumer | null;
2230
+ consumerElement: Element | null;
2231
+ };
2232
+ }
2233
+ //#endregion
2234
+ //#region src/gestures/hostSelection.d.ts
2235
+ /** The selection lock under a held finger, the drag hold under a claimed mouse or pen, and touch gates; GestureHost is the class to use. */
2236
+ declare abstract class HostSelection extends HostHitTest {
2237
+ /**
2238
+ * Turn text selection and the touch callout off, for as long as this
2239
+ * finger or pen is down, only on the elements whose hold does something:
2240
+ * a long press's (a menu, a hold-repeat), those of recognizers created
2241
+ * with a `selectionLock` (a slider's thumb, a switch's drag, a tab bar's
2242
+ * zero-delay lens) and that of a press tracker created with one (a
2243
+ * stepper's hold-repeat). Anything whose hold does nothing, a plain
2244
+ * press-tracked control or row included, keeps the browser's long-press
2245
+ * selection (`spec:AST-094` FR41). Restored when the contact ends. Callers
2246
+ * lock for a finger or a pen under any primary pointer, never for a mouse
2247
+ * (locksSelectionFor), and only once the arena has admitted the contact:
2248
+ * `recognizers` and `consumer` are the ones that took it.
2249
+ */
2250
+ protected lockSelection(id: number, recognizers: ReadonlyArray<GestureRecognizer>, target: EventTarget | null, consumer: TouchConsumer | null, consumerElement: Element | null): void;
2251
+ /**
2252
+ * Hold the page's selection for a mouse or pen contact that a recognizer
2253
+ * claims. Examples are a pan's drag and a press a group claims at its own
2254
+ * pointerdown. While the contact is down, the claiming recognizers'
2255
+ * elements refuse a new selection. The selection the page had at the press
2256
+ * is put back over anything that replaced it. That includes the press's own
2257
+ * collapse and a selection the drag made before its claim. The claiming
2258
+ * recognizer's element holds from its claim, in any state: a waiting
2259
+ * recognizer claims while possible, and a swipe claims as ended. The
2260
+ * participants that already recognize hold too. A claim given back to the
2261
+ * browser lets its hold go (releaseClaimedDrags). A drag that starts on
2262
+ * selectable text never gets here, because no recognizer claims it
2263
+ * (`selectingContacts`). A tap claims only at its lift, so a click keeps
2264
+ * the selection it made. A finger keeps the touch-down lock alone.
2265
+ */
2266
+ protected lockClaimedDrags(ids: ReadonlyArray<number>, claimer: GestureRecognizer): void;
2267
+ /**
2268
+ * Claimed contacts the arena gave back. Their drag holds end at once, so
2269
+ * the browser's drag selects again. A contact's press lock (lockSelection)
2270
+ * is not a drag hold and stays.
2271
+ */
2272
+ protected releaseClaimedDrags(ids: ReadonlyArray<number>): void;
2273
+ /**
2274
+ * At a mouse or pen press, mark one that lands on selectable text: once it
2275
+ * moves, it is the browser's drag, and selects text.
2276
+ * Text whose hold does something is locked at this press already
2277
+ * (lockSelection), so it is not selectable text.
2278
+ */
2279
+ protected noteSelectingPress(id: number, x: number, y: number, target: EventTarget | null): void;
2280
+ /**
2281
+ * Undo a contact's selection locks, its press lock and its drag hold, at
2282
+ * once for a cancel, and forget its press's selection; idempotent. A
2283
+ * drag's hold keeps its last task after a lift (lockDragSelection).
2284
+ */
2285
+ protected unlockSelection(id: number, isCancel?: boolean): void;
2286
+ /**
2287
+ * Hold touches away from every participant while `gate(target)` answers
2288
+ * true. Returns the release. The input hold's held layers need no gate,
2289
+ * because the host asks `holdsTouch` for every touch.
2290
+ */
2291
+ addTouchGate(gate: (target: Node) => boolean): () => void;
2292
+ /**
2293
+ * Internal. Whether a press consumer that keeps its press (a hold-repeat
2294
+ * control, `keepsTouch`) sits on the path from `target` up to `boundary`,
2295
+ * both included. Such a control keeps its long press its own. Its right
2296
+ * click and Shift+F10 still reach a context request around it
2297
+ * (contextRequest.ts).
2298
+ */
2299
+ keepsPressBetween(target: unknown, boundary: Element): boolean;
2300
+ /**
2301
+ * How many fingers are on the screen: the length of `touches` in the last
2302
+ * touch event the host's listeners heard (`touchstart`, `touchmove`,
2303
+ * `touchend`, `touchcancel`), whatever its target, so a finger on an
2304
+ * element with no recognizer counts too. 0 before any, and while no
2305
+ * listener is installed. A recognizer that must not begin under a second
2306
+ * finger reads it in `shouldBegin`.
2307
+ */
2308
+ fingersDown(): number;
2309
+ /** Whether this event is new to the host (and mark it handled). */
2310
+ protected takeEvent(event: Event): boolean;
2311
+ }
2312
+ //#endregion
2313
+ //#region src/gestures/hostWheelInput.d.ts
2314
+ /** The wheel's events: trackpad segments, provisional follows and who takes them; GestureHost is the class to use. */
2315
+ declare abstract class HostWheelInput extends HostSelection {
2316
+ protected abstract beginWheel(wheel: WheelEvent, kind: 'pan' | 'pinch', dx: number, dy: number, time: number): WheelGesture;
2317
+ protected abstract latchWheel(): void;
2318
+ /**
2319
+ * Wheel and trackpad input. A wheel gesture drives the recognizers that
2320
+ * allow its scroll type, as a contact that moves with the content. A pan
2321
+ * takes it along its own axis, once no scroller between the pointer and
2322
+ * the pan's element can scroll that way. The gesture's first wheel decides
2323
+ * this. A pinch takes a ctrl-wheel, as a trackpad pinches, as two contacts
2324
+ * whose span follows exp(-deltaY / 100). A wheel the page keeps is never
2325
+ * prevented, and a wheel a recognizer takes always is. A gesture ends its
2326
+ * end window after its last wheel (wheelEndMs), at that wheel's time, so
2327
+ * its release keeps its velocity. A gesture a recognizer took is latched
2328
+ * to it, as a browser latches a scroller. While the gesture lasts, the
2329
+ * shared input stream hands this every wheel first, wherever it lands. So
2330
+ * a pan whose element moves from under a still pointer keeps the gesture.
2331
+ * The page listener exists only during a gesture.
2332
+ */
2333
+ protected readonly onWheel: (event: Event) => void;
2334
+ /**
2335
+ * Move a followed pan through the splitter's undecided stretch. It moves on
2336
+ * from where it was shown at the fingers' last move, at their last speed.
2337
+ * It never passes what that speed projects for the time since.
2338
+ */
2339
+ protected followProvisionally(gesture: WheelGesture, f: WheelFollow, time: number): void;
2340
+ /**
2341
+ * Whether a scroller between `target` and `boundary` (both included)
2342
+ * scrolls this wheel now, along the wheel's major axis. It uses the edge
2343
+ * test a finger's probe uses (canElementScroll). With `keepsBoundary`, the
2344
+ * boundary's own scroll is its recognizers', as it is for a finger.
2345
+ */
2346
+ protected scrollerTakes(target: unknown, boundary: Element, dx: number, dy: number, isHorizontal: boolean, keepsBoundary: boolean): boolean;
2347
+ /**
2348
+ * Whether the touch-action the host derives for `element` keeps the
2349
+ * wheel's axis from the browser. A finger's pan along that axis is then
2350
+ * the element's recognizers', and so is a trackpad's scroll of the element
2351
+ * itself.
2352
+ */
2353
+ protected keepsAxis(element: Element, isHorizontal: boolean): boolean;
2354
+ /** A ctrl-wheel pinch's two contacts, `span` apart around its center. */
2355
+ protected pinchContacts(gesture: WheelGesture, time: number): {
2356
+ id: number;
2357
+ x: number;
2358
+ y: number;
2359
+ time: number;
2360
+ }[];
2361
+ /** Whether a recognizer that took this wheel gesture still takes part in it. */
2362
+ protected wheelHasTaker(gesture: WheelGesture): boolean;
2363
+ }
2364
+ //#endregion
2365
+ //#region src/gestures/hostWheelGesture.d.ts
2366
+ /** A wheel gesture's begin, latch and end; GestureHost is the class to use. */
2367
+ declare abstract class HostWheelGesture extends HostWheelInput {
2368
+ /** Start a wheel gesture: who takes it, decided once, or nobody. */
2369
+ protected beginWheel(wheel: WheelEvent, kind: 'pan' | 'pinch', dx: number, dy: number, time: number): WheelGesture;
2370
+ /**
2371
+ * Route every wheel on the page to the live wheel gesture, from its claim.
2372
+ * The route is the shared input stream's capture listener on the window,
2373
+ * which runs before any document listener. It is non-passive only while it
2374
+ * is subscribed.
2375
+ */
2376
+ protected latchWheel(): void;
2377
+ /**
2378
+ * End the trackpad pan a recognizer still drives, when the page loses focus
2379
+ * or hides, and return its contacts to cancel. The rest of its stream is
2380
+ * the page's until the stream ends, as a touch the browser takes is. A
2381
+ * ctrl-wheel pinch keeps its stream, so the page never zooms for it. A
2382
+ * gesture the page keeps stays as it is. So does a pan its lift released:
2383
+ * its momentum stays latched and prevented until the stream ends.
2384
+ */
2385
+ protected dropDrivenWheel(): ReadonlyArray<number>;
2386
+ /**
2387
+ * End the wheel gesture in progress. On its own timer, it ends its end
2388
+ * window after its last wheel. A taker that leaves (a detach, a disable)
2389
+ * passes that last wheel's time. An input that ends it sooner (a press,
2390
+ * the next gesture's first wheel) passes its own time. Both times are on
2391
+ * the wheels' time base (eventTime), never the host's clock, which need
2392
+ * not share it.
2393
+ */
2394
+ protected endWheel(endTime?: number): void;
2395
+ }
2396
+ //#endregion
2397
+ //#region src/gestures/hostTouchStart.d.ts
2398
+ /** Touch events: a finger's start and move, and a claimed finger's end; GestureHost is the class to use. */
2399
+ declare abstract class HostTouchStart extends HostWheelGesture {
2400
+ protected abstract dropFingersNotDown(event: TouchEvent): void;
2401
+ protected abstract failUnclaimedLoneFingerPans(): void;
2402
+ protected abstract feedMoves(inputs: ReadonlyArray<TouchInput>): void;
2403
+ protected abstract forgetFinger(identifier: number): number | undefined;
2404
+ protected abstract isFingerClaimed(): boolean;
2405
+ protected abstract noteFingersDown(event: TouchEvent): void;
2406
+ protected abstract pairTouch(id: number, place: PlacedContact): void;
2407
+ protected abstract watchTarget(identifier: number, target: EventTarget | null, isBlocking: boolean, isClaiming: boolean): void;
2408
+ protected readonly onTouchStart: (event: TouchEvent) => void;
2409
+ protected readonly onTouchMove: (event: TouchEvent) => void;
2410
+ /** The one blocking `touchmove` handler every claiming element shares. */
2411
+ protected readonly onBlockingTouchMove: (event: Event) => void;
2412
+ /**
2413
+ * Cancel a `touchmove` while a recognizer owns one of its fingers. A touch
2414
+ * no recognizer owns keeps its moves (`spec:AST-094` FR19): nothing is
2415
+ * cancelled before a recognizer begins, or for a touch it does not track,
2416
+ * unless a recognizer holds that finger already (a scroll-edge pan pulling
2417
+ * away from an edge every scroller under it is at; FR19, DEC-18).
2418
+ */
2419
+ /**
2420
+ * Under `inputMode: 'pointer-events'` a finger comes from its pointer
2421
+ * events, so its touches carry no id of ours: the live finger it is, the
2422
+ * nearest pointer-fed finger on the same target. Its touchmoves can then
2423
+ * be cancelled once a recognizer claims it (`spec:AST-094` FR19, FR21).
2424
+ */
2425
+ protected pointerFingerAt(touch: Touch): number | undefined;
2426
+ /**
2427
+ * Cancel the `touchend` of a finger a recognizer owned when it lifted
2428
+ * (`inputMode: 'pointer-events'`): its `pointerup` came first, at the same
2429
+ * place on the same target (`spec:AST-094` FR21). Records older than
2430
+ * CLAIMED_LIFT_MS are dropped first: their touchend never came.
2431
+ */
2432
+ protected readonly onClaimedTouchEnd: (event: Event) => void;
2433
+ protected cancelIfClaimed(event: TouchEvent): void;
2434
+ }
2435
+ //#endregion
2436
+ //#region src/gestures/hostTouchEnd.d.ts
2437
+ /** Touch events: a finger's end and cancel, the target's own listeners, and pairing touches with pointers; GestureHost is the class to use. */
2438
+ declare abstract class HostTouchEnd extends HostTouchStart {
2439
+ protected readonly onTouchEnd: (event: TouchEvent) => void;
2440
+ /**
2441
+ * Clicks what a retargeted contact touched if it ended as a tap the
2442
+ * engine would click: nothing claimed it, the browser did not take it
2443
+ * (a taken contact is no longer retargeted), and the finger stayed within
2444
+ * a tap's movement. Returns whether it clicked.
2445
+ */
2446
+ protected clickRetargetedTap(landed: {
2447
+ x: number;
2448
+ y: number;
2449
+ target: EventTarget;
2450
+ } | undefined, end: {
2451
+ x: number;
2452
+ y: number;
2453
+ }, disposition: ClickDisposition | undefined, pointerType: string): boolean;
2454
+ protected readonly onTouchCancel: (event: TouchEvent) => void;
2455
+ /** The target's own listeners, for a target that left the document. */
2456
+ protected readonly onTargetTouchMove: (event: Event) => void;
2457
+ /** The same for a finger nothing could claim while it moves: never blocks. */
2458
+ protected readonly onTargetTouchMovePassive: (event: Event) => void;
2459
+ protected readonly onTargetTouchEnd: (event: Event) => void;
2460
+ /** The same, registered passively for a touch only watchers follow. */
2461
+ protected readonly onTargetTouchEndPassive: (event: Event) => void;
2462
+ protected readonly onTargetTouchCancel: (event: Event) => void;
2463
+ /**
2464
+ * Cancel tracked fingers the event says are no longer down. `touches`
2465
+ * lists every finger on the screen; one missing from it (and not lifting
2466
+ * in this very event) ended where we could not see it.
2467
+ */
2468
+ protected dropFingersNotDown(event: TouchEvent): void;
2469
+ protected watchTarget(identifier: number, target: EventTarget | null, isBlocking: boolean, isClaiming: boolean): void;
2470
+ protected unwatchTarget(identifier: number): void;
2471
+ /**
2472
+ * Keeps one `touchmove` listener on a watched target: the blocking one
2473
+ * while a finger on it could be claimed as it moves, a passive one
2474
+ * otherwise, so a scroll starting there never waits on the main thread
2475
+ * (`spec:AST-094` FR19).
2476
+ */
2477
+ protected swapTargetTouchMove(target: EventTarget, wasBlocking: boolean, isBlocking: boolean): void;
2478
+ /**
2479
+ * Keeps one `touchend` listener on a watched target: the cancelable one
2480
+ * while a finger on it has a participant that could claim (a lift whose
2481
+ * click must not happen cancels its `touchend`), a passive one while only
2482
+ * watchers follow its fingers (`spec:AST-094` FR20).
2483
+ */
2484
+ protected swapTargetTouchEnd(target: EventTarget, wasClaiming: boolean, isClaiming: boolean): void;
2485
+ /** Stop tracking a finger by its Touch.identifier; returns its arena id. */
2486
+ protected forgetFinger(identifier: number): number | undefined;
2487
+ protected pairTouch(id: number, place: PlacedContact): void;
2488
+ protected pairPointer(pointerId: number, place: PlacedContact): void;
2489
+ /** Feed moves from a contact's sampling channel, in time order. */
2490
+ protected feedMoves(inputs: ReadonlyArray<TouchInput>): void;
2491
+ /** Forget a contact's pairing and echo state. */
2492
+ protected forgetContact(id: number): void;
2493
+ }
2494
+ //#endregion
2495
+ //#region src/gestures/hostPointer.d.ts
2496
+ /** Pointer events: a press's down, move and up, claimed lifts, and the host's own scrolls; GestureHost is the class to use. */
2497
+ declare abstract class HostPointer extends HostTouchEnd {
2498
+ protected abstract isPenHold(id: number, time: number): boolean;
2499
+ protected abstract notePenDrift(id: number, x: number, y: number, time: number): void;
2500
+ protected abstract refuseCancelledLift(event: PointerEvent): void;
2501
+ protected readonly onPointerDown: (event: PointerEvent) => void;
2502
+ protected readonly onPointerMove: (event: PointerEvent) => void;
2503
+ /**
2504
+ * In Chromium, a sandboxed frame can miss the `pointerup` of a button
2505
+ * released outside the window. The next mouse event shows the button up,
2506
+ * or a new press. The contact then ends at its last place. No click comes
2507
+ * to this document, so no click guard is armed.
2508
+ */
2509
+ protected endMissedMouseLift(event: PointerEvent): boolean;
2510
+ protected readonly onPointerUp: (event: PointerEvent) => void;
2511
+ /**
2512
+ * Note a claimed finger's lift, so the `touchend` that follows its
2513
+ * `pointerup` is cancelled (FR21). Only where an element's listener can take
2514
+ * that touchend: elsewhere none comes, and the note would hold its node for
2515
+ * nothing. At most CLAIMED_LIFT_LIMIT wait, the oldest going first, and one
2516
+ * timer drops each once CLAIMED_LIFT_MS has passed (FR24); the host's
2517
+ * uninstall keeps them, as it can run in the microtask after the pointerup,
2518
+ * before the touchend that comes later in the same task.
2519
+ */
2520
+ protected noteClaimedLift(event: PointerEvent): void;
2521
+ /** Arm the one timer for the oldest claimed lift still waiting. */
2522
+ protected armClaimedLiftTimer(): void;
2523
+ /** Drop every claimed lift and its timer, once the last one is taken. */
2524
+ protected clearClaimedLifts(): void;
2525
+ /**
2526
+ * A recognizer is about to scroll `scroller` itself (a menu's edge
2527
+ * autoscroll, spec:AST-094 FR30): the scroll that write fires is not a
2528
+ * finger's and not the browser taking one. It passes until the end of the
2529
+ * next frame, when that event has fired; a real pan in that window still
2530
+ * reports itself through pointercancel or touchcancel.
2531
+ */
2532
+ ownScroll(scroller: Node): void;
2533
+ /**
2534
+ * Internal. Whether a recognizer is scrolling `scroller` itself now
2535
+ * (ownScroll): that scroll is not a finger's (fingerScroll.ts reads it).
2536
+ */
2537
+ isOwnScroll(scroller: Node): boolean;
2538
+ protected readonly onScroll: (event: Event) => void;
2539
+ }
2540
+ //#endregion
2541
+ //#region src/gestures/GestureHost.d.ts
2542
+ declare class GestureHost extends HostPointer {
2543
+ protected readonly onPointerCancel: (event: PointerEvent) => void;
2544
+ /**
2545
+ * Whether a pen contact is a hold: it stays within the long press's
2546
+ * tolerance for its duration. Only such a hold fires the platform's own
2547
+ * menu event, so the host notes no other pen's lift.
2548
+ */
2549
+ protected isPenHold(id: number, time: number): boolean;
2550
+ /**
2551
+ * A pen contact that leaves the long press's tolerance before its duration
2552
+ * is no hold, so its lift arms no menu refusal.
2553
+ */
2554
+ protected notePenDrift(id: number, x: number, y: number, time: number): void;
2555
+ /**
2556
+ * Which live finger a touch `pointercancel` is about. The pointer keeps
2557
+ * the target the finger landed on (implicit capture), as the Touch does;
2558
+ * among fingers on that target, the nearest. WebKit also numbers the
2559
+ * pointer like the Touch, which settles what position cannot.
2560
+ */
2561
+ protected touchForCancelledPointer(event: PointerEvent): number | null;
2562
+ protected replayClick(touch: GestureTouch, allowed: boolean): void;
2563
+ protected readonly onContextMenu: (event: MouseEvent) => void;
2564
+ protected noteFingersDown(event: TouchEvent): void;
2565
+ /**
2566
+ * A second finger landed somewhere (wherever: often on a plain row): a
2567
+ * pan that takes one finger only and has not claimed its touch fails, so
2568
+ * the two fingers stay the browser's pinch (WCAG 1.4.4) instead of the
2569
+ * pan claiming them midway. A drag a recognizer has claimed keeps its
2570
+ * finger: a second finger never cancels or redirects it (`spec:AST-094`
2571
+ * FR10), and no claim is released here.
2572
+ */
2573
+ protected failUnclaimedLoneFingerPans(): void;
2574
+ /** Whether a finger's drag is claimed: then two fingers make no pinch. */
2575
+ protected isFingerClaimed(): boolean;
2576
+ protected readonly onVisibilityChange: () => void;
2577
+ protected readonly onBlur: () => void;
2578
+ /** Whether the browser sends Touch Events at all (`ontouchstart`). */
2579
+ protected sendsTouchEvents(): boolean;
2580
+ /**
2581
+ * Whether the host reads fingers from their pointer events: Pointer Events
2582
+ * input, or a window with no `ontouchstart` (touch emulation turned on
2583
+ * after load), as the move path does.
2584
+ */
2585
+ protected readsFingersFromPointerEvents(): boolean;
2586
+ /**
2587
+ * The lift of a contact the lost focus cancelled: its click is refused,
2588
+ * and a finger's touchend after it is cancelled.
2589
+ */
2590
+ protected refuseCancelledLift(event: PointerEvent): void;
2591
+ /** The app lost focus: UIKit cancels every touch in flight. */
2592
+ protected cancelEverything(time: number): void;
2593
+ }
2594
+ /** The gesture host of a document, created on first use. */
2595
+ export declare function getGestureHost(doc: Document): GestureHost;
2596
+ //#endregion
2597
+ //#region src/gestures/useGestureRecognizer.d.ts
2598
+ interface UseGestureRecognizerOptions {
2599
+ /**
2600
+ * Live toggle; turning it off mid-gesture cancels the gesture. That cancel
2601
+ * does not call `onGesture`: the code that turned it off already knows. A
2602
+ * recognizer that required this one to fail resolves just after and
2603
+ * reports as usual.
2604
+ * @default true
2605
+ */
2606
+ isEnabled?: MaybeRefOrGetter<boolean>;
2607
+ /** Let the host set touch-action (and long-press callout) styles. @default true */
2608
+ manageStyle?: MaybeRefOrGetter<boolean>;
2609
+ /**
2610
+ * The element is an action group, sibling actions a held pointer slides
2611
+ * across (`family:action-groups` FR5): the host serves it where the
2612
+ * primary pointer is fine too (`AttachOptions.actionGroup`).
2613
+ * @default false
2614
+ */
2615
+ actionGroup?: MaybeRefOrGetter<boolean>;
2616
+ }
2617
+ /**
2618
+ * Attach a recognizer to the element `target` names.
2619
+ *
2620
+ * @example
2621
+ * ```ts
2622
+ * const sheet = ref<HTMLElement | null>(null)
2623
+ * useGestureRecognizer(
2624
+ * sheet,
2625
+ * () => new PanGestureRecognizer({ direction: 'vertical' }),
2626
+ * (recognizer) => {
2627
+ * sheet.value!.style.transform = `translateY(${recognizer.translation().y}px)`
2628
+ * },
2629
+ * )
2630
+ * ```
2631
+ */
2632
+ export declare function useGestureRecognizer<R extends GestureRecognizer>(target: MaybeRefOrGetter<Element | null | undefined>, create: () => R, onGesture?: (recognizer: R) => void, options?: UseGestureRecognizerOptions): R;
2633
+ //#endregion
2634
+ //#region src/motion/bezier.d.ts
2635
+ /**
2636
+ * @file bezier.ts
2637
+ * @input Cubic-bézier control points [x1, y1, x2, y2]
2638
+ * @output Exports `cubicBezier`, the timing function CSS and Core Animation
2639
+ * define by those points (progress → eased progress)
2640
+ * @position Pure math under the animator (the Reduced Motion cross-fade runs
2641
+ * on Core Animation's named curves); no DOM, no React
2642
+ *
2643
+ * The curve runs from (0, 0) to (1, 1) with the two given control points;
2644
+ * x is time, y is progress. Solved for x by Newton's method with a bisection
2645
+ * fallback, the approach browser engines use for CSS `cubic-bezier()`.
2646
+ */
2647
+ type BezierPoints = readonly [number, number, number, number];
2648
+ /** The timing function for `points`: maps time progress to eased progress. */
2649
+ export declare function cubicBezier([x1, y1, x2, y2]: BezierPoints): (x: number) => number;
2650
+ //#endregion
2651
+ //#region src/motion/progress.d.ts
2652
+ /**
2653
+ * The curve of `f(driver(t))`, its velocity by the chain rule: a channel
2654
+ * following a path as its progress moves, or a companion following any
2655
+ * driving curve (a sheet's `y` mapped onto its scrim's opacity). The driver
2656
+ * is any MotionCurve, not only a progress from 0 to 1. A companion played on
2657
+ * another animator starts with its driver (`{at: start}`; see the file
2658
+ * header).
2659
+ */
2660
+ export declare function mapProgress(driver: MotionCurve, f: (value: number) => number): MotionCurve;
2661
+ //#endregion
2662
+ //#region src/motion/reducedMotion.d.ts
2663
+ /**
2664
+ * The fade to play under Reduce Motion. `duration` 0 means the change
2665
+ * completes at once; `easing` is a CSS timing function.
2666
+ */
2667
+ interface ReducedMotionFade {
2668
+ readonly duration: number;
2669
+ readonly easing: string;
2670
+ }
2671
+ /**
2672
+ * The Reduced Motion fade for a change to `element` now, for motion the
2673
+ * animator does not drive (two titles cross-fading with Web Animations):
2674
+ * null when motion is not reduced (play the normal motion), else an
2675
+ * opacity-only fade of 200 ms on a coarse pointer or for a touch release, or
2676
+ * duration 0 (at once) on any other pointer, on Core Animation's easeInOut;
2677
+ * the length is fixed.
2678
+ */
2679
+ export declare function reducedMotionFade(element?: Element | null, options?: {
2680
+ /** The change starts from the release of a touch drag (DR2). */
2681
+ touchRelease?: boolean;
2682
+ }): ReducedMotionFade | null;
2683
+ //#endregion
2684
+ //#region src/motion/roleValue.d.ts
2685
+ /** The three kinds of value a role can hold. */
2686
+ type MotionRoleKind = 'spring' | 'duration' | 'curve';
2687
+ /** Cubic-bézier control points `[x1, y1, x2, y2]`. */
2688
+ type MotionCurvePoints = readonly [number, number, number, number];
2689
+ //#endregion
2690
+ //#region src/motion/roles.d.ts
2691
+ /**
2692
+ * Reads a role value back from its CSS custom property. Returns null for an
2693
+ * empty or malformed value: the caller then uses the table's value.
2694
+ */
2695
+ export declare function parseMotionRoleValue(kind: 'spring', text: string): DurationBounce | null;
2696
+ export declare function parseMotionRoleValue(kind: 'duration', text: string): number | null;
2697
+ export declare function parseMotionRoleValue(kind: 'curve', text: string): MotionCurvePoints | null;
2698
+ export declare function parseMotionRoleValue(kind: MotionRoleKind, text: string): DurationBounce | number | MotionCurvePoints | null;
2699
+ /**
2700
+ * Reads a CSS easing, a keyword or a `cubic-bezier()`, as a curve role's value
2701
+ * is read. Returns null for any other easing, such as `steps()`.
2702
+ */
2703
+ export declare function parseCssEasing(text: string): MotionCurvePoints | null;
2704
+ //#endregion
2705
+ //#region src/motion/resolveMotion.d.ts
2706
+ /**
2707
+ * A motion role's value at the tempo of the theme `element` is in. Hand it a
2708
+ * spring or curve of a motion table, or a table group and a key (the way to
2709
+ * name a duration, which is a bare number):
2710
+ *
2711
+ * @example
2712
+ * ```
2713
+ * const spring = resolveMotion(sheet, springs.settle);
2714
+ * const fadeMs = resolveMotion(row, timing, 'stateChangeMs');
2715
+ * ```
2716
+ *
2717
+ * The element names where the motion plays. Anything that is not a role
2718
+ * comes back unchanged. So a spring written inline at a call site keeps
2719
+ * working, and a resolved spring is not scaled again.
2720
+ */
2721
+ export declare function resolveMotion<T extends SpringDescription>(element: Element | null | undefined, spring: T): T | SpringDescription;
2722
+ export declare function resolveMotion(element: Element | null | undefined, curve: MotionCurvePoints): MotionCurvePoints;
2723
+ export declare function resolveMotion<G extends object, K extends keyof G & string>(element: Element | null | undefined, group: G, key: K): G[K] extends number ? number : G[K] extends MotionCurvePoints ? MotionCurvePoints : G[K] | SpringDescription;
2724
+ //#endregion
2725
+ //#region src/motion/rubberBand.d.ts
2726
+ /**
2727
+ * @file rubberBand.ts
2728
+ * @input An overflow past an edge, the scroll view's dimension and UIKit's
2729
+ * rubber-band coefficient
2730
+ * @output Exports `rubberBand` (finger overflow → displayed overflow), its
2731
+ * inverse, its slope, and the clamp/unclamp pair over a [min, max] range
2732
+ * @position Pure math; no DOM, no React
2733
+ *
2734
+ * UIScrollView resists a drag past its content edge with
2735
+ * b = (1 − 1 ÷ (x·c ÷ d + 1))·d
2736
+ * where x is how far the finger has gone past the edge, d the scroll view's
2737
+ * size on that axis and c = 0.55 (uikit/scroll.ts records the sources). The
2738
+ * displayed overflow b approaches d but never reaches it, and its slope at
2739
+ * the edge is c: the first points of overflow move at 55 % of the finger.
2740
+ *
2741
+ * The inverse matters for spec:AST-094 FR6 (a finger catches any animation
2742
+ * mid-flight): a finger that lands on content still bouncing back has to
2743
+ * resume the drag from the finger position that would produce the overflow
2744
+ * on screen, or the content jumps.
2745
+ */
2746
+ /**
2747
+ * Displayed overflow for a finger `overflow` past the edge (signed: the sign
2748
+ * is kept). `dimension` is the scroll view's size on the axis.
2749
+ */
2750
+ export declare function rubberBand(overflow: number, dimension: number, coefficient?: number): number;
2751
+ /** The finger overflow that displays `displayed`; ±Infinity at ±dimension. */
2752
+ export declare function rubberBandInverse(displayed: number, dimension: number, coefficient?: number): number;
2753
+ /**
2754
+ * d(displayed) ÷ d(finger) at a finger overflow: what a finger velocity
2755
+ * becomes on screen while banding (c at the edge, falling toward 0).
2756
+ */
2757
+ export declare function rubberBandSlope(overflow: number, dimension: number, coefficient?: number): number;
2758
+ //#endregion
2759
+ //#region src/motion/uikit/gestures.d.ts
2760
+ /**
2761
+ * Every group in one object, for a reader that needs several. A reader of
2762
+ * one group imports it by name instead (`UIKIT_PAN`): object properties do
2763
+ * not tree-shake, so this object bundles every group
2764
+ * (`architecture:component-style-authoring` INV6).
2765
+ */
2766
+ export declare const UIKIT_GESTURES: {
2767
+ readonly tap: {
2768
+ /**
2769
+ * How far each finger may travel from where it landed before a tap
2770
+ * fails, as a distance.
2771
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2772
+ * with HID touches, Oct 23 2026: UITapGestureRecognizer
2773
+ * _allowableMovement 45; 44 pt taps, 46 pt fails, the same on the
2774
+ * diagonal
2775
+ */
2776
+ readonly allowableMovement: {
2777
+ readonly value: 45;
2778
+ readonly unit: "px";
2779
+ };
2780
+ /**
2781
+ * Longest interval between one tap lifting and the next landing.
2782
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2783
+ * with HID touches, Oct 23 2026: _maximumIntervalBetweenSuccessiveTaps
2784
+ * 0.35 s; 330 ms double-taps, 370 ms does not
2785
+ */
2786
+ readonly maximumIntervalBetweenTaps: {
2787
+ readonly value: 350;
2788
+ readonly unit: "ms";
2789
+ };
2790
+ /**
2791
+ * How far a later tap may land from the first one of the sequence.
2792
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2793
+ * with HID touches, Oct 23 2026: _allowableSeparation is unbounded and
2794
+ * the 45 pt movement rule applies between taps; 44 pt double-taps, 46
2795
+ * does not
2796
+ */
2797
+ readonly allowableSeparation: {
2798
+ readonly value: 45;
2799
+ readonly unit: "px";
2800
+ };
2801
+ /**
2802
+ * Longest a finger may stay down and still tap.
2803
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2804
+ * with HID touches, Oct 23 2026: maximumTapDuration 1.5 s; a 1.4 s hold
2805
+ * taps, 1.6 s does not
2806
+ */
2807
+ readonly maximumTapDuration: {
2808
+ readonly value: 1500;
2809
+ readonly unit: "ms";
2810
+ };
2811
+ };
2812
+ readonly longPress: {
2813
+ /**
2814
+ * UILongPressGestureRecognizer.minimumPressDuration default.
2815
+ * @source apple-docs
2816
+ * https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer/minimumpressduration
2817
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2818
+ * with HID touches, Oct 23 2026: _minimumPressDuration 0.5
2819
+ */
2820
+ readonly minimumPressDuration: {
2821
+ readonly value: 500;
2822
+ readonly unit: "ms";
2823
+ };
2824
+ /**
2825
+ * UILongPressGestureRecognizer.allowableMovement default, a distance.
2826
+ * @source apple-docs
2827
+ * https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer/allowablemovement
2828
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2829
+ * with HID touches, Oct 23 2026: a (7, 7) drift begins, (7.2, 7.2) fails
2830
+ */
2831
+ readonly allowableMovement: {
2832
+ readonly value: 10;
2833
+ readonly unit: "px";
2834
+ };
2835
+ };
2836
+ readonly pan: {
2837
+ /**
2838
+ * Travel before a pan begins, PER AXIS: |dx| or |dy| reaching it. The
2839
+ * translation is reset when the pan begins, so the hysteresis is not
2840
+ * part of it. Kept below the distance at which WebKit claims a drag for
2841
+ * scrolling, so a pan that must cancel the native scroll still sees
2842
+ * cancelable `touchmove`s.
2843
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2844
+ * with HID touches, Oct 23 2026: UIPanGestureRecognizer _hysteresis 10; x
2845
+ * and y began at 10.0, a diagonal at (10.67, 10.67); translation(in:) is
2846
+ * 0 at .began
2847
+ */
2848
+ readonly hysteresis: {
2849
+ readonly value: 10;
2850
+ readonly unit: "px";
2851
+ };
2852
+ };
2853
+ readonly swipe: {
2854
+ /**
2855
+ * Travel along the swipe direction before a swipe is recognized.
2856
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2857
+ * with HID touches, Oct 23 2026: UISwipeGestureRecognizer minimum primary
2858
+ * movement 50; recognized during the motion; 40 pt does not
2859
+ */
2860
+ readonly minimumDistance: {
2861
+ readonly value: 50;
2862
+ readonly unit: "px";
2863
+ };
2864
+ /**
2865
+ * Longest a swipe may take before it fails.
2866
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2867
+ * with HID touches, Oct 23 2026: UISwipeGestureRecognizer maximum
2868
+ * duration 0.5 s
2869
+ */
2870
+ readonly maximumDuration: {
2871
+ readonly value: 500;
2872
+ readonly unit: "ms";
2873
+ };
2874
+ /**
2875
+ * Travel across the swipe direction that fails it.
2876
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2877
+ * with HID touches, Oct 23 2026: UISwipeGestureRecognizer maximum
2878
+ * secondary movement 50
2879
+ */
2880
+ readonly maximumSecondaryMovement: {
2881
+ readonly value: 50;
2882
+ readonly unit: "px";
2883
+ };
2884
+ /**
2885
+ * How the minimum movement relaxes over time. Read, not modelled: a
2886
+ * 120 pt swipe over 0.8 s was recognized at 303 ms, below 50 pt of travel.
2887
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2888
+ * with HID touches, Oct 23 2026: UISwipeGestureRecognizer
2889
+ * rateOfMinimumMovementDecay 0.06 (not modelled)
2890
+ */
2891
+ readonly minimumMovementDecay: {
2892
+ readonly value: 0.06;
2893
+ readonly unit: "ratio";
2894
+ };
2895
+ };
2896
+ readonly pinch: {
2897
+ /**
2898
+ * Change of the distance between two fingers before a pinch begins. The
2899
+ * scale is then measured against the starting span moved by this much,
2900
+ * so it does not jump.
2901
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2902
+ * with HID touches, Oct 23 2026: UIPinchGestureRecognizer _hysteresis 8;
2903
+ * out from 120 began at 144 with scale 1.125 (= 144 / 128)
2904
+ */
2905
+ readonly hysteresis: {
2906
+ readonly value: 8;
2907
+ readonly unit: "px";
2908
+ };
2909
+ };
2910
+ readonly rotation: {
2911
+ /**
2912
+ * Rotation of the two-finger vector before a rotation begins.
2913
+ * @source GUESS — UIRotationGestureRecognizer has no scalar threshold among
2914
+ * its ivars; 5 degrees. The simulator HID cannot rotate two fingers: a
2915
+ * device run (or an XCUITest rotate) logging the angle at .began.
2916
+ * @measure M-G10
2917
+ */
2918
+ readonly hysteresis: {
2919
+ readonly value: 0.08726646259971647;
2920
+ readonly unit: "rad";
2921
+ };
2922
+ };
2923
+ readonly screenEdgePan: {
2924
+ /**
2925
+ * Width of the band at the screen edge a touch must land in.
2926
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2927
+ * with HID touches, Oct 23 2026: UIScreenEdgePanGestureRecognizer
2928
+ * _edgeRegionSize 40.2 on a 402 pt wide screen (10 % of it); edge pans
2929
+ * cannot begin from simulator HID
2930
+ */
2931
+ readonly edgeRegion: {
2932
+ readonly value: 40.2;
2933
+ readonly unit: "px";
2934
+ };
2935
+ /**
2936
+ * Travel before an edge pan begins.
2937
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2938
+ * with HID touches, Oct 23 2026: the screen-edge pan hysteresis ivar 15
2939
+ */
2940
+ readonly hysteresis: {
2941
+ readonly value: 15;
2942
+ readonly unit: "px";
2943
+ };
2944
+ };
2945
+ readonly control: {
2946
+ /**
2947
+ * How far outside its bounds a UIControl keeps a press inside: a finger
2948
+ * dragged out is still "inside" until it passes this margin.
2949
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
2950
+ * with HID touches, Oct 23 2026: UIButton (.system) stays inside up to 70
2951
+ * pt out, touchDragExit at 71, touchDragEnter at 69 coming back;
2952
+ * touchUpInside up to 70, touchUpOutside from 71
2953
+ */
2954
+ readonly trackingExpansion: {
2955
+ readonly value: 70;
2956
+ readonly unit: "px";
2957
+ };
2958
+ };
2959
+ readonly press: {
2960
+ /**
2961
+ * UIScrollView.delaysContentTouches: a touch in a scroller highlights after
2962
+ * this.
2963
+ * @source measured: Settings and Contacts, iOS 26.2 simulator, HID touches
2964
+ * filmed at 60 fps (utils/pressGesture.ts), Oct 6 2026
2965
+ */
2966
+ readonly contentTouchDelay: {
2967
+ readonly value: 150;
2968
+ readonly unit: "ms";
2969
+ };
2970
+ /**
2971
+ * A tap shorter than the delay shows the highlight at the lift for this
2972
+ * long.
2973
+ * @source measured: Settings and Contacts, iOS 26.2 simulator, HID touches
2974
+ * filmed at 60 fps (utils/pressGesture.ts), Oct 6 2026
2975
+ */
2976
+ readonly quickTapFlash: {
2977
+ readonly value: 100;
2978
+ readonly unit: "ms";
2979
+ };
2980
+ /**
2981
+ * Travel at which a press is a scroll, not a press.
2982
+ * @source measured: Mobile Safari 26.2, iOS 26.2 simulator, slow HID drag
2983
+ * on a scrollable page (1 pt steps): last cancelable touchmove at 10 px,
2984
+ * pointercancel and the first uncancelable touchmove at 11 px, Oct 23
2985
+ * 2026
2986
+ */
2987
+ readonly slop: {
2988
+ readonly value: 10;
2989
+ readonly unit: "px";
2990
+ };
2991
+ /**
2992
+ * A touch this soon after a finger-driven scroll moved is a brake, not a
2993
+ * press.
2994
+ * @source measured: Settings and Contacts, iOS 26.2 simulator, HID touches
2995
+ * filmed at 60 fps (utils/pressGesture.ts), Oct 6 2026
2996
+ */
2997
+ readonly scrollBrake: {
2998
+ readonly value: 150;
2999
+ readonly unit: "ms";
3000
+ };
3001
+ /**
3002
+ * How long after a finger was down a scroll can still be that finger's
3003
+ * momentum (the brake only counts scrolls a finger drove).
3004
+ * @source GUESS — The press model bound (utils/pressFeedback.ts): iOS
3005
+ * momentum runs for a second or two after the lift.
3006
+ * @measure M-G19
3007
+ */
3008
+ readonly momentumMemory: {
3009
+ readonly value: 3000;
3010
+ readonly unit: "ms";
3011
+ };
3012
+ };
3013
+ readonly menuPress: {
3014
+ /**
3015
+ * How far the finger may move on a button inside a scroll view during the
3016
+ * content-touch delay and still open the menu. It is the trigger's drift
3017
+ * allowance.
3018
+ * @source GUESS — Between the 12 pt that opened and the 14 pt that did not.
3019
+ * UIKit lab, iOS 26.2 simulator, iPhone 17 Pro, gesture-state hook, Oct
3020
+ * 23 2026 (M-MN1). On a button outside any scroll view, a 12 pt move
3021
+ * within 80 ms still opened the menu at about 151 ms. Moves of 14, 17, 20
3022
+ * and 25 pt opened nothing. The recognizer reads an allowableMovement of
3023
+ * 10.
3024
+ * @measure M-G21
3025
+ */
3026
+ readonly holdOpenSlop: {
3027
+ readonly value: 13;
3028
+ readonly unit: "px";
3029
+ };
3030
+ /**
3031
+ * After the menu opens under a still-held finger, the finger travels this
3032
+ * far before it starts picking. The distance is a straight line from the
3033
+ * first sample the menu receives after it opened. Until then nothing is
3034
+ * lit, and lifting acts on nothing.
3035
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3036
+ * iPhone 17 Pro, gesture-state hook, steps 150 ms apart, Oct 23 2026
3037
+ * (M-MN2): with the menu open under a held finger and a 1 pt first step,
3038
+ * moves of (0, 9) and (7, 7) picked nothing; (0, 10), (0, 11), (10, 0),
3039
+ * (9, 9) and (10, 10) picked; a 9 pt step followed by 3 pt more picked
3040
+ * nothing
3041
+ */
3042
+ readonly handoff: {
3043
+ readonly value: 10;
3044
+ readonly unit: "px";
3045
+ };
3046
+ };
3047
+ readonly velocity: {
3048
+ /**
3049
+ * UIPanGestureRecognizer.velocity(in:) is this times the newest event's
3050
+ * instantaneous velocity plus the rest times the previous event's
3051
+ * (instantaneous velocity: position change over timestamp change between
3052
+ * consecutive events, the touch-down counting as the first). The lift
3053
+ * does not update it, and a finger at rest sends no events, so UIKit
3054
+ * reports the last moving value after a pause; Astryx's release reads 0
3055
+ * once the finger has rested (`spec:AST-100` FR2).
3056
+ * @source measured: UIKit lab, iOS 26.2 simulator, ivar reads confirmed
3057
+ * with HID touches, Oct 23 2026: fitted to all 69 velocity(in:) values of
3058
+ * six HID streams (constant, accelerating, pauses before the lift) to 0.0
3059
+ * pt/s
3060
+ */
3061
+ readonly currentWeight: {
3062
+ readonly value: 0.2;
3063
+ readonly unit: "ratio";
3064
+ };
3065
+ /**
3066
+ * A scrolling surface's release (paging, a wheel) is this times the
3067
+ * newest pan value plus the rest times the previous one
3068
+ * (architecture:interaction-modality INV10).
3069
+ * @source GUESS — architecture:interaction-modality INV10 states
3070
+ * UIScrollView's release as 0.25 x the newest pan value + 0.75 x the
3071
+ * previous one.
3072
+ * @measure M-G14
3073
+ */
3074
+ readonly scrollReleaseWeight: {
3075
+ readonly value: 0.25;
3076
+ readonly unit: "ratio";
3077
+ };
3078
+ /**
3079
+ * A contact that has not moved for longer than this before it lifts
3080
+ * releases at 0 (spec:AST-100 FR2). Not a UIKit value: UIKit's filter
3081
+ * never decays, so it flings after a rest.
3082
+ * @source GUESS — Android VelocityTracker and Flutter VelocityTracker
3083
+ * treat a pointer that has not moved for 40 ms as stopped.
3084
+ * @measure M-G16
3085
+ */
3086
+ readonly stillness: {
3087
+ readonly value: 40;
3088
+ readonly unit: "ms";
3089
+ };
3090
+ };
3091
+ };
3092
+ //#endregion
3093
+ //#region src/motion/uikit/navigation.d.ts
3094
+ /**
3095
+ * @file navigation.ts
3096
+ * @input Nothing; data only
3097
+ * @output Exports `navigation`: UINavigationController's push / pop geometry,
3098
+ * starting velocity, dimming, transition clock and the interactive pop's
3099
+ * finish rule
3100
+ * @position The navigation domain of the UIKit constants table
3101
+ * (motion/uikit); its springs are `springs.navigationPush`,
3102
+ * `springs.navigationPop`, `springs.navigationInteractivePopFinish` and
3103
+ * `springs.navigationBarElements`
3104
+ *
3105
+ * On iOS 26.2 UIKit moves the cards by writing their positions into Core
3106
+ * Animation presentation modifiers every frame from the main thread; the
3107
+ * values below are fitted to those writes. The web version runs the same
3108
+ * curves on the compositor, which keeps them moving while the main thread is
3109
+ * busy.
3110
+ *
3111
+ * Every leaf carries one or more `@source`; webkit and GUESS values also carry
3112
+ * the `@measure` task that will confirm or replace them. uikit.test.ts
3113
+ * enforces both.
3114
+ */
3115
+ export declare const navigation: {
3116
+ /**
3117
+ * The push and pop springs start moving at this many travels per second
3118
+ * (3527 pt/s on a 402 pt card), not from rest.
3119
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3120
+ * iPhone 17 Pro, CAPresentationModifier (value, velocity) fit, Oct 23 2026
3121
+ */
3122
+ readonly pushVelocity: 8.773;
3123
+ /**
3124
+ * Where the card underneath ends, as a fraction of the container width:
3125
+ * it moves from 0 to −0.3 W while the incoming card moves from W to 0.
3126
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3127
+ * iPhone 17 Pro, CAPresentationModifier values, Oct 23 2026
3128
+ */
3129
+ readonly parallax: -0.3;
3130
+ /**
3131
+ * The dimming over the card underneath: black at this alpha, its opacity
3132
+ * going 0 → 1 on the push spring.
3133
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3134
+ * iPhone 17 Pro, _UIParallaxDimmingView read, Oct 23 2026
3135
+ */
3136
+ readonly dimmingAlpha: 0.1;
3137
+ /**
3138
+ * The transition context's duration, in ms; it paces completion callbacks
3139
+ * (a linear property animator), not the cards.
3140
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3141
+ * iPhone 17 Pro, transitionDuration read, Oct 23 2026
3142
+ */
3143
+ readonly transitionMs: 350;
3144
+ /**
3145
+ * The interactive pop finishes when progress + this × velocity passes
3146
+ * `interactivePopFinishThreshold` (progress in widths, velocity in widths
3147
+ * per second): seconds of projection.
3148
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3149
+ * iPhone 17 Pro, the pop decision method hooked over 61 controlled
3150
+ * releases: the rule matches 58; the 3 misses all finished where it says
3151
+ * cancel, Oct 23 2026
3152
+ */
3153
+ readonly interactivePopFinishProjection: 0.35;
3154
+ /**
3155
+ * The progress the projected release must pass to finish the pop (a still
3156
+ * finger at 0.475 cancels).
3157
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3158
+ * iPhone 17 Pro, the pop decision method over 61 releases, Oct 23 2026
3159
+ */
3160
+ readonly interactivePopFinishThreshold: 0.5;
3161
+ };
3162
+ //#endregion
3163
+ //#region src/motion/uikit/scroll.d.ts
3164
+ export declare const scroll: {
3165
+ readonly decelerationRate: {
3166
+ /**
3167
+ * Normal deceleration: the release velocity is multiplied by this every
3168
+ * millisecond, as a continuous exponential (UIScrollView keeps ln r,
3169
+ * −0.002002, and velocities in pt/ms). The scroll view's own
3170
+ * target for a release (`scrollViewWillEndDragging`) is
3171
+ * v · r ÷ (1 − r), within 1 %: WWDC18 803's projection function.
3172
+ * @source apple-docs https://developer.apple.com/documentation/uikit/uiscrollview/decelerationrate-swift.struct/normal
3173
+ * (the constant, not its number)
3174
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3175
+ * iPhone 17 Pro, rawValue read, Oct 23 2026 (also a new scroll view's
3176
+ * decelerationRate)
3177
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3178
+ * iPhone 17 Pro, deceleration ivars read mid-coast
3179
+ * (`_decelerationFactor` 0.998, `_decelerationLnFactorV` −0.002002, the
3180
+ * velocity decaying 0.4343 over 400 ms) and willEndDragging targets,
3181
+ * Oct 23 2026
3182
+ */
3183
+ readonly normal: 0.998;
3184
+ /**
3185
+ * Fast deceleration (`UIScrollView.DecelerationRate.fast`).
3186
+ * @source apple-docs https://developer.apple.com/documentation/uikit/uiscrollview/decelerationrate-swift.struct/fast
3187
+ * (the constant, not its number)
3188
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3189
+ * iPhone 17 Pro, rawValue read and `_decelerationFactor` 0.99 (ln
3190
+ * −0.01005) mid-coast, Oct 23 2026
3191
+ */
3192
+ readonly fast: 0.99;
3193
+ };
3194
+ readonly rubberBand: {
3195
+ /**
3196
+ * c in b = (1 − 1 ÷ (x·c ÷ d + 1))·d, d = the scroll view's size on the
3197
+ * axis, x = the finger's travel past the edge after the
3198
+ * pan's 10 pt hysteresis.
3199
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3200
+ * iPhone 17 Pro, UIScrollView offsets released 100 / 300 / 600 pt past
3201
+ * the edge of an 874 pt view: 47 / 135 / 236.67 against the formula's
3202
+ * 46.85 / 134.9 / 236.6, Oct 23 2026
3203
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3204
+ * iPhone 17 Pro, sheet drags hooked: UISheetPresentationController
3205
+ * passes `withRubberBandCoefficient: 0.55` on every drag, Oct 23 2026
3206
+ */
3207
+ readonly coefficient: 0.55;
3208
+ };
3209
+ /**
3210
+ * The spring that returns content released past an edge, and that catches
3211
+ * a coast hitting an edge (its velocity handed to the spring).
3212
+ * @source GUESS — critically damped as in I. Lobanov's UIScrollView
3213
+ * reimplementation (no oscillation at the bound); pace from SwiftUI's
3214
+ * `.smooth` default duration. Measured so far (iOS 26.2 simulator, Oct 23
3215
+ * 2026): back to the edge in about 0.5 s with no overshoot, but no single
3216
+ * spring from rest fits releases 47, 135 and 237 pt past the edge, so
3217
+ * UIKit's bounce is not a plain spring; the model is still to fit
3218
+ * @measure M-S3
3219
+ */
3220
+ readonly bounce: {
3221
+ readonly duration: 0.5;
3222
+ readonly bounce: 0;
3223
+ };
3224
+ /**
3225
+ * `delaysContentTouches`: how long a scroll view holds a touch-down from
3226
+ * its content while it decides whether the touch is a scroll (no highlight
3227
+ * flash on a quick scroll), in ms.
3228
+ * @source wwdc 2014-235 "Advanced Scrollviews and Touch Handling
3229
+ * Techniques": the touch-delay recognizer UIScrollView uses runs "a
3230
+ * pretty short timer … Let's say .15 seconds" (presenter's example value)
3231
+ * @source measured: Settings and Contacts, iOS 26.2, simulator driven with
3232
+ * real HID touches at 60 fps, recorded with the touch press model
3233
+ * (PRESS_ONSET_MS in packages/core/src/utils/pressGesture.ts, 2026-10-06)
3234
+ */
3235
+ readonly delaysContentTouchesMs: 150;
3236
+ /**
3237
+ * Scroll-to-top after a status-bar tap: not a spring. The offset
3238
+ * approaches the top as 1 − e^(−9.7 t) whatever the distance (done in about
3239
+ * 1.6 s for 500, 2000 or 8000 pt), which is a decay at this per-millisecond
3240
+ * rate (e^(−0.0097)) whose rest point is the top: a decay with a
3241
+ * starting velocity of 9.7 × the distance per second. A tap starts it, not
3242
+ * a throw, so under Reduce Motion it is a transition, not a coast: it
3243
+ * cross-fades to the top within 200 ms on a coarse pointer (DR2) and jumps
3244
+ * there on any other (DR3). Only momentum that continues a throw keeps
3245
+ * decaying under Reduce Motion (`design:reduced-motion` DR2, DEC-2), so a
3246
+ * component checks for Reduce Motion before it plays this decay.
3247
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3248
+ * iPhone 17 Pro, setContentOffset log after status-bar taps (starts 85–95
3249
+ * ms after the tap), Oct 23 2026
3250
+ */
3251
+ readonly scrollToTopRate: 0.99035;
3252
+ };
3253
+ //#endregion
3254
+ //#region src/motion/uikit/springs.d.ts
3255
+ /**
3256
+ * Push (programmatic or a row tap): the incoming card slides in from the
3257
+ * trailing edge, the outgoing card shifts by `navigation.parallax`. The
3258
+ * spring does not start from rest: it starts at
3259
+ * `navigation.pushVelocity` × the travel per second.
3260
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3261
+ * iPhone 17 Pro, time-free fit of the (value, velocity) pairs UIKit
3262
+ * writes to the cards' CAPresentationModifiers every frame (rms 5e-4 of
3263
+ * the travel), Oct 23 2026
3264
+ */
3265
+ export declare const NAVIGATION_PUSH_SPRING: {
3266
+ readonly response: 0.3;
3267
+ readonly dampingRatio: 1;
3268
+ };
3269
+ /**
3270
+ * Pop (back button or programmatic): identical to the push.
3271
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3272
+ * iPhone 17 Pro, CAPresentationModifier fit as for the push, Oct 23 2026
3273
+ */
3274
+ export declare const NAVIGATION_POP_SPRING: {
3275
+ readonly response: 0.3;
3276
+ readonly dampingRatio: 1;
3277
+ };
3278
+ /**
3279
+ * Interactive pop finishing or cancelling after the finger lifts, starting
3280
+ * from the finger's velocity; which one is `navigation.interactivePop*`.
3281
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3282
+ * iPhone 17 Pro, CAPresentationModifier fit over released swipes,
3283
+ * Oct 23 2026
3284
+ */
3285
+ export declare const NAVIGATION_INTERACTIVE_POP_FINISH_SPRING: {
3286
+ readonly response: 0.3;
3287
+ readonly dampingRatio: 0.85;
3288
+ };
3289
+ /**
3290
+ * Navigation bar elements (Liquid Glass) moving during a push or pop.
3291
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3292
+ * iPhone 17 Pro, UIView.animate(springDuration: 0.6, bounce: 0,
3293
+ * .beginFromCurrentState) calls hooked during transitions, Oct 23 2026
3294
+ */
3295
+ export declare const NAVIGATION_BAR_ELEMENTS_SPRING: {
3296
+ readonly duration: 0.6;
3297
+ readonly bounce: 0;
3298
+ };
3299
+ //#endregion
3300
+ //#region src/motion/uikit/timing.d.ts
3301
+ export declare const timing: {
3302
+ readonly press: {
3303
+ /**
3304
+ * Highlight onset once a press is believed: none, the highlight is
3305
+ * painted in the frame the touch is accepted (after
3306
+ * `scroll.delaysContentTouchesMs` inside a scroller).
3307
+ * @source measured: Settings and Contacts, iOS 26.2, simulator driven
3308
+ * with real HID touches at 60 fps (touch press model,
3309
+ * packages/core/src/utils/pressGesture.ts, 2026-10-06)
3310
+ */
3311
+ readonly highlightInMs: 0;
3312
+ /**
3313
+ * A tap released before the onset delay still flashes the highlight at
3314
+ * full strength for this long before fading.
3315
+ * @source measured: Settings and Contacts, iOS 26.2, simulator driven
3316
+ * with real HID touches at 60 fps (PRESS_FLASH_MS,
3317
+ * packages/core/src/utils/pressGesture.ts, 2026-10-06)
3318
+ */
3319
+ readonly flashMs: 100;
3320
+ /**
3321
+ * Highlight fade after release: UIKit's deselect cross-fade. Reference
3322
+ * only, not played: a press release plays the theme's exit motion tokens
3323
+ * (`--duration-exit`, `--ease-exit`).
3324
+ * @source measured: Settings and Contacts, iOS 26.2, simulator driven
3325
+ * with real HID touches at 60 fps (touch press model,
3326
+ * packages/core/src/utils/pressGesture.ts, 2026-10-06)
3327
+ */
3328
+ readonly highlightOutMs: 200;
3329
+ /**
3330
+ * The highlight fade's curve after release: an ease-out that spends the
3331
+ * whole clock fading (strength about 0.2 at the midpoint). Reference only,
3332
+ * not played: a press release plays the theme's `--ease-exit`.
3333
+ * @source GUESS — the release curve the touch press model shipped with,
3334
+ * chosen to read as UIKit's deselect cross-fade, not read from UIKit
3335
+ * @measure M-PR1
3336
+ */
3337
+ readonly highlightOutCurve: readonly [0, 0, 0.2, 1];
3338
+ /**
3339
+ * A touch on a scroller that moved this recently brakes it instead of
3340
+ * pressing.
3341
+ * @source measured: Settings and Contacts, iOS 26.2, simulator driven
3342
+ * with real HID touches at 60 fps (PRESS_SCROLL_BRAKE_MS,
3343
+ * packages/core/src/utils/pressGesture.ts, 2026-10-06)
3344
+ */
3345
+ readonly scrollBrakeMs: 150;
3346
+ /**
3347
+ * UIButton (filled configuration) release: the label cross-fade and the
3348
+ * background color both run 0.25 s on `curves.move`.
3349
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3350
+ * iPhone 17 Pro, CAAnimation read (CATransition fade and backgroundColor),
3351
+ * Oct 23 2026
3352
+ */
3353
+ readonly buttonReleaseMs: 250;
3354
+ };
3355
+ readonly curves: {
3356
+ /**
3357
+ * `CAMediaTimingFunctionName.default`: "the timing of … most system
3358
+ * animations" that are not springs.
3359
+ * @source apple-docs https://developer.apple.com/documentation/quartzcore/camediatimingfunctionname/default
3360
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3361
+ * iPhone 17 Pro, CAMediaTimingFunction read from UIView.animate,
3362
+ * Oct 23 2026
3363
+ */
3364
+ readonly viewChange: readonly [0.25, 0.1, 0.25, 1];
3365
+ readonly move: readonly [0.42, 0, 0.58, 1];
3366
+ /**
3367
+ * `easeIn`.
3368
+ * @source apple-docs https://developer.apple.com/documentation/quartzcore/camediatimingfunctionname/easein
3369
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3370
+ * iPhone 17 Pro, CAMediaTimingFunction read from UIView.animate,
3371
+ * Oct 23 2026
3372
+ */
3373
+ readonly exit: readonly [0.42, 0, 1, 1];
3374
+ /**
3375
+ * `easeOut`.
3376
+ * @source apple-docs https://developer.apple.com/documentation/quartzcore/camediatimingfunctionname/easeout
3377
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3378
+ * iPhone 17 Pro, CAMediaTimingFunction read from UIView.animate,
3379
+ * Oct 23 2026
3380
+ */
3381
+ readonly entrance: readonly [0, 0, 0.58, 1];
3382
+ };
3383
+ /**
3384
+ * `UINavigationController.hideShowBarDuration`, in ms.
3385
+ * @source apple-docs https://developer.apple.com/documentation/uikit/uinavigationcontroller/hideshowbarduration
3386
+ * (the constant, not its value)
3387
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3388
+ * iPhone 17 Pro, read, Oct 23 2026
3389
+ */
3390
+ readonly navigationBarHideShowMs: 200;
3391
+ /**
3392
+ * The duration the keyboard notifications report
3393
+ * (UIKeyboardAnimationDurationUserInfoKey, with curve 7), show and hide
3394
+ * alike, in ms. The frame follows `springs.keyboard`, cut at this time.
3395
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3396
+ * iPhone 17 Pro, UIKeyboardWillShow / WillHide / WillChangeFrame read,
3397
+ * Oct 23 2026
3398
+ */
3399
+ readonly keyboardNotificationMs: 383.3;
3400
+ /**
3401
+ * Core Animation's implicit animation duration
3402
+ * (`CATransaction.animationDuration()`), in ms.
3403
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
3404
+ * iPhone 17 Pro, read, Oct 23 2026
3405
+ */
3406
+ readonly stateChangeMs: 250;
3407
+ readonly reducedMotionCrossFadeMs: 200;
3408
+ };
3409
+ //#endregion
3410
+ //#region src/utils/coarsePointer.d.ts
3411
+ /**
3412
+ * @file coarsePointer.ts
3413
+ * @input A window
3414
+ * @output Exports isCoarsePointer, matchesMediaQuery, watchCoarsePointer and
3415
+ * watchMediaQuery: whether the primary pointer is coarse (TOUCH_QUERY) or
3416
+ * any media query matches, and when either changes
3417
+ * @position The coarse-pointer gate of packages/core/src/gestures and of
3418
+ * the press controller (pressFeedback.ts): touch-only work registers only
3419
+ * while it holds. useMediaQuery and the presentation resolvers read and
3420
+ * watch through matchesMediaQuery and watchMediaQuery
3421
+ *
3422
+ * Under a coarse primary pointer, a phone's touch work stays registered: the
3423
+ * gesture host's page listeners, the page hold and the finger scroll. Under a
3424
+ * fine one, recognizers still attach, and the host listens on the page only
3425
+ * during a press (AST-094). The answer can change while the page is open (a
3426
+ * tablet docking a mouse), so a holder watches it.
3427
+ *
3428
+ * SYNC: When modified, update coarsePointer.test.ts.
3429
+ */
3430
+ /** Whether the primary pointer of `view` is coarse now. */
3431
+ export declare function isCoarsePointer(view: Window | null | undefined): boolean;
3432
+ //#endregion
3433
+ //#region src/utils/isRtlElement.d.ts
3434
+ /**
3435
+ * @file isRtlElement.ts
3436
+ * @input DOM element (nullable)
3437
+ * @output Exports isRtlElement helper resolving an element's computed text
3438
+ * direction
3439
+ * @position Internal hook utility; used by useListFocus and useGridFocus to
3440
+ * auto-detect RTL for arrow-key navigation (same getComputedStyle precedent
3441
+ * as Resizable's ResizeHandle drag deltas).
3442
+ */
3443
+ /**
3444
+ * Whether `el` renders right-to-left, per its computed `direction`.
3445
+ *
3446
+ * SSR-safe: returns false when `el` is null or no DOM is available. Callers
3447
+ * should invoke this lazily (on keydown, not on render) so getComputedStyle
3448
+ * runs only when a horizontal arrow key is actually handled.
3449
+ */
3450
+ export declare function isRtlElement(el: HTMLElement | null): boolean;
3451
+ //#endregion
3452
+ //#region src/utils/touchQueries.d.ts
3453
+ /**
3454
+ * @file touchQueries.ts
3455
+ * @input Nothing: plain strings
3456
+ * @output TOUCH_QUERY, the media query for a coarse primary pointer; and
3457
+ * IOS_SUPPORTS_QUERY with isIosWebKit, the iOS WebKit engine check
3458
+ * @position The dependency-free half of touchPresentation.ts, for code that
3459
+ * must load without React or the theme: the motion foundation, which
3460
+ * Node-side specs and browser proofs load without a StyleX compile.
3461
+ * touchPresentation.ts re-exports it beside the hook and the parts that
3462
+ * read the theme.
3463
+ */
3464
+ /** The primary pointer is coarse: touch behaviours. */
3465
+ export declare const TOUCH_QUERY = "(pointer: coarse)";
3466
+ //#endregion
3467
+ export { type AnimateOptions, type GestureEventContext, type GestureTouch, type MotionCurve, type Animator as MotionEngine, type AnimatorOptions as MotionEngineOptions, type MotionHandle, type PanGestureRecognizerOptions, type PointerKind, type SpringDescription, type SpringTransition, type UseFingerScrollOptions, observeResize, useFingerScroll };