react-native-gtkx 0.2.0-alpha.2 → 0.3.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (340) hide show
  1. package/README.md +5 -2
  2. package/dist/aliases/index.d.ts +84 -0
  3. package/dist/aliases/index.js +208 -0
  4. package/dist/aliases/index.js.map +1 -0
  5. package/dist/animated/index.d.ts +2 -0
  6. package/dist/animated/index.js +5 -0
  7. package/dist/animated/index.js.map +1 -1
  8. package/dist/animated/types.d.ts +1 -0
  9. package/dist/animated/types.js.map +1 -1
  10. package/dist/animated/value-animation.js +17 -4
  11. package/dist/animated/value-animation.js.map +1 -1
  12. package/dist/apis/host.gtkx.js +9 -12
  13. package/dist/apis/host.gtkx.js.map +1 -1
  14. package/dist/apis/index.d.ts +4 -2
  15. package/dist/apis/index.js +2 -0
  16. package/dist/apis/index.js.map +1 -1
  17. package/dist/apis/keyboard.d.ts +60 -0
  18. package/dist/apis/keyboard.js +63 -0
  19. package/dist/apis/keyboard.js.map +1 -0
  20. package/dist/apis/log-box.d.ts +15 -0
  21. package/dist/apis/log-box.js +46 -0
  22. package/dist/apis/log-box.js.map +1 -0
  23. package/dist/apis/platform.d.ts +18 -1
  24. package/dist/apis/platform.js.map +1 -1
  25. package/dist/common/index.d.ts +0 -1
  26. package/dist/common/index.js +24 -1
  27. package/dist/common/index.js.map +1 -1
  28. package/dist/components/animated.d.ts +70 -6
  29. package/dist/components/animated.js +559 -46
  30. package/dist/components/animated.js.map +1 -1
  31. package/dist/components/driven-size.d.ts +27 -0
  32. package/dist/components/driven-size.js +85 -0
  33. package/dist/components/driven-size.js.map +1 -0
  34. package/dist/components/find-node-handle.d.ts +11 -0
  35. package/dist/components/find-node-handle.js +53 -0
  36. package/dist/components/find-node-handle.js.map +1 -0
  37. package/dist/components/flat-list.d.ts +3 -2
  38. package/dist/components/flat-list.js.map +1 -1
  39. package/dist/components/frame-scheduler.d.ts +16 -0
  40. package/dist/components/frame-scheduler.js +37 -0
  41. package/dist/components/frame-scheduler.js.map +1 -0
  42. package/dist/components/image.d.ts +6 -1
  43. package/dist/components/image.js +15 -4
  44. package/dist/components/image.js.map +1 -1
  45. package/dist/components/index.d.ts +7 -5
  46. package/dist/components/index.js +5 -3
  47. package/dist/components/index.js.map +1 -1
  48. package/dist/components/measure.d.ts +51 -1
  49. package/dist/components/measure.js +101 -2
  50. package/dist/components/measure.js.map +1 -1
  51. package/dist/components/pressable.d.ts +61 -1
  52. package/dist/components/pressable.js +151 -4
  53. package/dist/components/pressable.js.map +1 -1
  54. package/dist/components/rect-store.d.ts +58 -0
  55. package/dist/components/rect-store.js +124 -3
  56. package/dist/components/rect-store.js.map +1 -1
  57. package/dist/components/root.js +6 -1
  58. package/dist/components/root.js.map +1 -1
  59. package/dist/components/scroll-phase.d.ts +35 -0
  60. package/dist/components/scroll-phase.js +26 -0
  61. package/dist/components/scroll-phase.js.map +1 -0
  62. package/dist/components/scroll-view.d.ts +39 -3
  63. package/dist/components/scroll-view.js +378 -43
  64. package/dist/components/scroll-view.js.map +1 -1
  65. package/dist/components/text-input.js +9 -25
  66. package/dist/components/text-input.js.map +1 -1
  67. package/dist/components/text.d.ts +6 -2
  68. package/dist/components/text.js +43 -8
  69. package/dist/components/text.js.map +1 -1
  70. package/dist/components/use-focus.d.ts +27 -0
  71. package/dist/components/use-focus.js +116 -0
  72. package/dist/components/use-focus.js.map +1 -0
  73. package/dist/components/use-layout-child.d.ts +13 -1
  74. package/dist/components/use-layout-child.js +188 -5
  75. package/dist/components/use-layout-child.js.map +1 -1
  76. package/dist/components/view.d.ts +5 -2
  77. package/dist/components/view.js +18 -13
  78. package/dist/components/view.js.map +1 -1
  79. package/dist/components/virtualized-list.d.ts +45 -5
  80. package/dist/components/virtualized-list.js +90 -24
  81. package/dist/components/virtualized-list.js.map +1 -1
  82. package/dist/components/wheel-scroll-session.d.ts +7 -0
  83. package/dist/components/wheel-scroll-session.js +53 -0
  84. package/dist/components/wheel-scroll-session.js.map +1 -0
  85. package/dist/components/widget-retention.d.ts +35 -0
  86. package/dist/components/widget-retention.js +169 -0
  87. package/dist/components/widget-retention.js.map +1 -0
  88. package/dist/contracts.d.ts +4 -0
  89. package/dist/contracts.js.map +1 -1
  90. package/dist/dnd/context.d.ts +69 -0
  91. package/dist/dnd/context.js +149 -0
  92. package/dist/dnd/context.js.map +1 -0
  93. package/dist/dnd/draggable.d.ts +59 -0
  94. package/dist/dnd/draggable.js +149 -0
  95. package/dist/dnd/draggable.js.map +1 -0
  96. package/dist/dnd/droppable.d.ts +24 -0
  97. package/dist/dnd/droppable.js +74 -0
  98. package/dist/dnd/droppable.js.map +1 -0
  99. package/dist/dnd/gtk-controllers.d.ts +39 -0
  100. package/dist/dnd/gtk-controllers.js +110 -0
  101. package/dist/dnd/gtk-controllers.js.map +1 -0
  102. package/dist/dnd/index.d.ts +6 -0
  103. package/dist/dnd/index.js +31 -0
  104. package/dist/dnd/index.js.map +1 -0
  105. package/dist/dnd/order.d.ts +7 -0
  106. package/dist/dnd/order.js +20 -0
  107. package/dist/dnd/order.js.map +1 -0
  108. package/dist/dnd/payload.d.ts +14 -0
  109. package/dist/dnd/payload.js +41 -0
  110. package/dist/dnd/payload.js.map +1 -0
  111. package/dist/dnd/sortable.d.ts +49 -0
  112. package/dist/dnd/sortable.js +307 -0
  113. package/dist/dnd/sortable.js.map +1 -0
  114. package/dist/dnd/types.d.ts +290 -0
  115. package/dist/dnd/types.js +25 -0
  116. package/dist/dnd/types.js.map +1 -0
  117. package/dist/gesture-handler-compat/builder.d.ts +251 -0
  118. package/dist/gesture-handler-compat/builder.js +513 -0
  119. package/dist/gesture-handler-compat/builder.js.map +1 -0
  120. package/dist/gesture-handler-compat/composition.d.ts +23 -0
  121. package/dist/gesture-handler-compat/composition.js +111 -0
  122. package/dist/gesture-handler-compat/composition.js.map +1 -0
  123. package/dist/gesture-handler-compat/deciders.d.ts +3 -0
  124. package/dist/gesture-handler-compat/deciders.js +47 -0
  125. package/dist/gesture-handler-compat/deciders.js.map +1 -0
  126. package/dist/gesture-handler-compat/detector-runtime.d.ts +44 -0
  127. package/dist/gesture-handler-compat/detector-runtime.js +374 -0
  128. package/dist/gesture-handler-compat/detector-runtime.js.map +1 -0
  129. package/dist/gesture-handler-compat/detector.d.ts +22 -0
  130. package/dist/gesture-handler-compat/detector.js +104 -0
  131. package/dist/gesture-handler-compat/detector.js.map +1 -0
  132. package/dist/gesture-handler-compat/fling.d.ts +24 -0
  133. package/dist/gesture-handler-compat/fling.js +123 -0
  134. package/dist/gesture-handler-compat/fling.js.map +1 -0
  135. package/dist/gesture-handler-compat/force-touch.d.ts +13 -0
  136. package/dist/gesture-handler-compat/force-touch.js +40 -0
  137. package/dist/gesture-handler-compat/force-touch.js.map +1 -0
  138. package/dist/gesture-handler-compat/hooks.d.ts +157 -0
  139. package/dist/gesture-handler-compat/hooks.js +268 -0
  140. package/dist/gesture-handler-compat/hooks.js.map +1 -0
  141. package/dist/gesture-handler-compat/hover.d.ts +2 -0
  142. package/dist/gesture-handler-compat/hover.js +22 -0
  143. package/dist/gesture-handler-compat/hover.js.map +1 -0
  144. package/dist/gesture-handler-compat/index.d.ts +98 -0
  145. package/dist/gesture-handler-compat/index.js +255 -0
  146. package/dist/gesture-handler-compat/index.js.map +1 -0
  147. package/dist/gesture-handler-compat/long-press.d.ts +6 -0
  148. package/dist/gesture-handler-compat/long-press.js +21 -0
  149. package/dist/gesture-handler-compat/long-press.js.map +1 -0
  150. package/dist/gesture-handler-compat/manual.d.ts +2 -0
  151. package/dist/gesture-handler-compat/manual.js +18 -0
  152. package/dist/gesture-handler-compat/manual.js.map +1 -0
  153. package/dist/gesture-handler-compat/native.d.ts +7 -0
  154. package/dist/gesture-handler-compat/native.js +34 -0
  155. package/dist/gesture-handler-compat/native.js.map +1 -0
  156. package/dist/gesture-handler-compat/orchestrator.d.ts +77 -0
  157. package/dist/gesture-handler-compat/orchestrator.js +284 -0
  158. package/dist/gesture-handler-compat/orchestrator.js.map +1 -0
  159. package/dist/gesture-handler-compat/pan.d.ts +23 -0
  160. package/dist/gesture-handler-compat/pan.js +116 -0
  161. package/dist/gesture-handler-compat/pan.js.map +1 -0
  162. package/dist/gesture-handler-compat/recognizer.d.ts +268 -0
  163. package/dist/gesture-handler-compat/recognizer.js +1056 -0
  164. package/dist/gesture-handler-compat/recognizer.js.map +1 -0
  165. package/dist/gesture-handler-compat/relations.d.ts +43 -0
  166. package/dist/gesture-handler-compat/relations.js +128 -0
  167. package/dist/gesture-handler-compat/relations.js.map +1 -0
  168. package/dist/gesture-handler-compat/tap.d.ts +6 -0
  169. package/dist/gesture-handler-compat/tap.js +29 -0
  170. package/dist/gesture-handler-compat/tap.js.map +1 -0
  171. package/dist/gesture-handler-compat/touchpad.d.ts +41 -0
  172. package/dist/gesture-handler-compat/touchpad.js +64 -0
  173. package/dist/gesture-handler-compat/touchpad.js.map +1 -0
  174. package/dist/gesture-handler-compat/types.d.ts +441 -0
  175. package/dist/gesture-handler-compat/types.js +167 -0
  176. package/dist/gesture-handler-compat/types.js.map +1 -0
  177. package/dist/gtk/controllers.d.ts +39 -0
  178. package/dist/gtk/controllers.js +92 -0
  179. package/dist/gtk/controllers.js.map +1 -0
  180. package/dist/gtk/index.d.ts +2 -1
  181. package/dist/gtk/index.js +7 -1
  182. package/dist/gtk/index.js.map +1 -1
  183. package/dist/gtkx/bridge/geometry.js +6 -4
  184. package/dist/gtkx/bridge/geometry.js.map +1 -1
  185. package/dist/gtkx/bridge/index.d.ts +5 -3
  186. package/dist/gtkx/bridge/index.js +6 -3
  187. package/dist/gtkx/bridge/index.js.map +1 -1
  188. package/dist/gtkx/bridge/slot-portal.js.map +1 -1
  189. package/dist/gtkx/bridge/use-signal.js +1 -1
  190. package/dist/gtkx/bridge/use-signal.js.map +1 -1
  191. package/dist/gtkx/bridge/view-box.d.ts +56 -0
  192. package/dist/gtkx/bridge/view-box.js +394 -9
  193. package/dist/gtkx/bridge/view-box.js.map +1 -1
  194. package/dist/gtkx/bridge/widget-css.d.ts +17 -0
  195. package/dist/gtkx/bridge/widget-css.js +72 -0
  196. package/dist/gtkx/bridge/widget-css.js.map +1 -0
  197. package/dist/index.d.ts +3 -3
  198. package/dist/index.js +2 -2
  199. package/dist/index.js.map +1 -1
  200. package/dist/layout/driven-size.d.ts +12 -0
  201. package/dist/layout/driven-size.js +70 -0
  202. package/dist/layout/driven-size.js.map +1 -0
  203. package/dist/layout/engine.d.ts +17 -1
  204. package/dist/layout/engine.js +3 -20
  205. package/dist/layout/engine.js.map +1 -1
  206. package/dist/layout/node.d.ts +13 -0
  207. package/dist/layout/node.js +14 -0
  208. package/dist/layout/node.js.map +1 -1
  209. package/dist/layout/yoga.d.ts +3 -2
  210. package/dist/layout/yoga.js +5 -2
  211. package/dist/layout/yoga.js.map +1 -1
  212. package/dist/mcp/data/generated.d.ts +257 -60
  213. package/dist/mcp/data/generated.js +306 -62
  214. package/dist/mcp/data/generated.js.map +1 -1
  215. package/dist/metro/index.d.ts +10 -0
  216. package/dist/metro/index.js +21 -12
  217. package/dist/metro/index.js.map +1 -1
  218. package/dist/navigation/sidebar.d.ts +16 -0
  219. package/dist/navigation/sidebar.js +65 -1
  220. package/dist/navigation/sidebar.js.map +1 -1
  221. package/dist/reanimated-compat/animated-ref.d.ts +32 -0
  222. package/dist/reanimated-compat/animated-ref.js +57 -0
  223. package/dist/reanimated-compat/animated-ref.js.map +1 -0
  224. package/dist/reanimated-compat/animation.d.ts +177 -0
  225. package/dist/reanimated-compat/animation.js +540 -0
  226. package/dist/reanimated-compat/animation.js.map +1 -0
  227. package/dist/reanimated-compat/color.d.ts +28 -0
  228. package/dist/reanimated-compat/color.js +249 -0
  229. package/dist/reanimated-compat/color.js.map +1 -0
  230. package/dist/reanimated-compat/decay.d.ts +39 -0
  231. package/dist/reanimated-compat/decay.js +96 -0
  232. package/dist/reanimated-compat/decay.js.map +1 -0
  233. package/dist/reanimated-compat/easing.d.ts +30 -0
  234. package/dist/reanimated-compat/easing.js +76 -0
  235. package/dist/reanimated-compat/easing.js.map +1 -0
  236. package/dist/reanimated-compat/hooks.d.ts +14 -0
  237. package/dist/reanimated-compat/hooks.js +217 -0
  238. package/dist/reanimated-compat/hooks.js.map +1 -0
  239. package/dist/reanimated-compat/index.d.ts +258 -0
  240. package/dist/reanimated-compat/index.js +464 -0
  241. package/dist/reanimated-compat/index.js.map +1 -0
  242. package/dist/reanimated-compat/interpolation.d.ts +18 -0
  243. package/dist/reanimated-compat/interpolation.js +122 -0
  244. package/dist/reanimated-compat/interpolation.js.map +1 -0
  245. package/dist/reanimated-compat/layout-animation-config.d.ts +43 -0
  246. package/dist/reanimated-compat/layout-animation-config.js +78 -0
  247. package/dist/reanimated-compat/layout-animation-config.js.map +1 -0
  248. package/dist/reanimated-compat/layout-animation-presets.d.ts +117 -0
  249. package/dist/reanimated-compat/layout-animation-presets.js +498 -0
  250. package/dist/reanimated-compat/layout-animation-presets.js.map +1 -0
  251. package/dist/reanimated-compat/layout-animation-runtime.d.ts +21 -0
  252. package/dist/reanimated-compat/layout-animation-runtime.js +311 -0
  253. package/dist/reanimated-compat/layout-animation-runtime.js.map +1 -0
  254. package/dist/reanimated-compat/layout-animation-view.d.ts +27 -0
  255. package/dist/reanimated-compat/layout-animation-view.js +266 -0
  256. package/dist/reanimated-compat/layout-animation-view.js.map +1 -0
  257. package/dist/reanimated-compat/layout-animation.d.ts +171 -0
  258. package/dist/reanimated-compat/layout-animation.js +469 -0
  259. package/dist/reanimated-compat/layout-animation.js.map +1 -0
  260. package/dist/reanimated-compat/layout-transitions.d.ts +83 -0
  261. package/dist/reanimated-compat/layout-transitions.js +350 -0
  262. package/dist/reanimated-compat/layout-transitions.js.map +1 -0
  263. package/dist/reanimated-compat/mutable.d.ts +29 -0
  264. package/dist/reanimated-compat/mutable.js +139 -0
  265. package/dist/reanimated-compat/mutable.js.map +1 -0
  266. package/dist/reanimated-compat/props.d.ts +18 -0
  267. package/dist/reanimated-compat/props.js +111 -0
  268. package/dist/reanimated-compat/props.js.map +1 -0
  269. package/dist/reanimated-compat/scroll-handler.d.ts +119 -0
  270. package/dist/reanimated-compat/scroll-handler.js +274 -0
  271. package/dist/reanimated-compat/scroll-handler.js.map +1 -0
  272. package/dist/reanimated-compat/scroll-offset.d.ts +12 -0
  273. package/dist/reanimated-compat/scroll-offset.js +104 -0
  274. package/dist/reanimated-compat/scroll-offset.js.map +1 -0
  275. package/dist/reanimated-compat/style.d.ts +90 -0
  276. package/dist/reanimated-compat/style.js +452 -0
  277. package/dist/reanimated-compat/style.js.map +1 -0
  278. package/dist/reanimated-compat/test-timers.d.ts +28 -0
  279. package/dist/reanimated-compat/test-timers.js +136 -0
  280. package/dist/reanimated-compat/test-timers.js.map +1 -0
  281. package/dist/reanimated-compat/threads.d.ts +13 -0
  282. package/dist/reanimated-compat/threads.js +41 -0
  283. package/dist/reanimated-compat/threads.js.map +1 -0
  284. package/dist/reanimated-compat/tracking.d.ts +41 -0
  285. package/dist/reanimated-compat/tracking.js +106 -0
  286. package/dist/reanimated-compat/tracking.js.map +1 -0
  287. package/dist/reanimated-compat/updater-animations.d.ts +36 -0
  288. package/dist/reanimated-compat/updater-animations.js +273 -0
  289. package/dist/reanimated-compat/updater-animations.js.map +1 -0
  290. package/dist/responder/system.d.ts +80 -7
  291. package/dist/responder/system.js +143 -23
  292. package/dist/responder/system.js.map +1 -1
  293. package/dist/responder/use-responder.d.ts +11 -0
  294. package/dist/responder/use-responder.js +225 -6
  295. package/dist/responder/use-responder.js.map +1 -1
  296. package/dist/runner/host-dev.js +1 -1
  297. package/dist/runner/host-dev.js.map +1 -1
  298. package/dist/runner/host.js +1 -1
  299. package/dist/runner/host.js.map +1 -1
  300. package/dist/runner/index.js +3 -3
  301. package/dist/runner/index.js.map +1 -1
  302. package/dist/sea/gtkx-config-module.js +1 -1
  303. package/dist/sea/gtkx-config-module.js.map +1 -1
  304. package/dist/style/absolute-insets.d.ts +26 -0
  305. package/dist/style/absolute-insets.js +113 -0
  306. package/dist/style/absolute-insets.js.map +1 -0
  307. package/dist/style/animated-size.d.ts +25 -0
  308. package/dist/style/animated-size.js +225 -0
  309. package/dist/style/animated-size.js.map +1 -0
  310. package/dist/style/colors.d.ts +17 -0
  311. package/dist/style/colors.js +25 -6
  312. package/dist/style/colors.js.map +1 -1
  313. package/dist/style/imperative-css.d.ts +21 -0
  314. package/dist/style/imperative-css.js +63 -0
  315. package/dist/style/imperative-css.js.map +1 -0
  316. package/dist/style/index.d.ts +2 -1
  317. package/dist/style/index.js +2 -1
  318. package/dist/style/index.js.map +1 -1
  319. package/dist/style/split-style.js +5 -0
  320. package/dist/style/split-style.js.map +1 -1
  321. package/dist/testing/index.js.map +1 -1
  322. package/dist/unsupported-export.d.ts +8 -0
  323. package/dist/unsupported-export.js +66 -0
  324. package/dist/unsupported-export.js.map +1 -0
  325. package/dist/vite/index.d.ts +21 -8
  326. package/dist/vite/index.js +127 -82
  327. package/dist/vite/index.js.map +1 -1
  328. package/dist/vitest/index.d.ts +2 -2
  329. package/dist/vitest/index.js.map +1 -1
  330. package/dist/worklets-compat/index.d.ts +4 -0
  331. package/dist/worklets-compat/index.js +28 -0
  332. package/dist/worklets-compat/index.js.map +1 -0
  333. package/dist/worklets-compat/surface.d.ts +110 -0
  334. package/dist/worklets-compat/surface.js +153 -0
  335. package/dist/worklets-compat/surface.js.map +1 -0
  336. package/package.json +25 -9
  337. package/types.d.ts +9 -0
  338. package/dist/common/list.d.ts +0 -82
  339. package/dist/common/list.js +0 -166
  340. package/dist/common/list.js.map +0 -1
@@ -0,0 +1,268 @@
1
+ import type { GestureResponderEvent } from "../responder/types";
2
+ import type { Orchestrator, Participant } from "./orchestrator";
3
+ import { type GestureHitSlop, type GestureKind, type RecognizerConfig } from "./types";
4
+ export type Rect = {
5
+ x: number;
6
+ y: number;
7
+ width: number;
8
+ height: number;
9
+ };
10
+ /**
11
+ * What the recognizer needs from the world it is mounted in: where its view
12
+ * is, and how to take the interaction when no touch event is in flight.
13
+ */
14
+ export type RecognizerEnvironment = {
15
+ /**
16
+ * The gesture's own view in WINDOW coordinates, or null before it is laid
17
+ * out. Window coordinates because that is the space RN's `pageX`/`pageY`
18
+ * are in, so no conversion sits between a touch and a bounds test.
19
+ */
20
+ boundsInWindow: () => Rect | null;
21
+ /**
22
+ * Ask for the responder outside a touch event. Returns whether it was
23
+ * granted. See `ResponderSystem.requestResponder`.
24
+ */
25
+ requestResponder: () => boolean;
26
+ /**
27
+ * The JS-only arbitration registry this gesture takes part in. Injected
28
+ * rather than imported so a test can drive one loop in isolation, exactly
29
+ * as the responder system is injected rather than imported.
30
+ */
31
+ orchestrator: Orchestrator;
32
+ };
33
+ /** The read-only view of the runtime the predicates are allowed to see. */
34
+ export type RecognizerView = {
35
+ /** Measured from the point of ACTIVATION once there is one; see `Runtime`. */
36
+ translationX: number;
37
+ translationY: number;
38
+ /**
39
+ * Straight-line travel from the PRESS, which outlives activation.
40
+ *
41
+ * `LongPress` needs this and translation will not do: it activates on a
42
+ * timer, translation is re-based to the activation point, and upstream's
43
+ * `maxDist` is measured from the press for the whole gesture — so a hold
44
+ * that drifted 8px before the timer and 8px after it has travelled 16, not
45
+ * twice-nearly-nothing.
46
+ */
47
+ distanceFromPress: number;
48
+ velocityX: number;
49
+ velocityY: number;
50
+ /** Whether this press's own timer has already fired. */
51
+ timerElapsed: boolean;
52
+ /** Pointers down now, and the most this interaction has ever had at once. */
53
+ pointerCount: number;
54
+ maxPointerCount: number;
55
+ /** Completed press-release cycles, including the one being decided. */
56
+ taps: number;
57
+ /**
58
+ * `Pinch`: the scale since GTK recognized the gesture, 1 at the start.
59
+ * `Rotation`: radians since it did, 0 at the start and positive clockwise.
60
+ *
61
+ * Both are 1 and 0 for every pointer-driven kind, so a predicate that reads
62
+ * them on the wrong kind gets the identity rather than a lie.
63
+ */
64
+ scale: number;
65
+ rotation: number;
66
+ /**
67
+ * `ForceTouch`: the pressure, normalised to `[0, 1]`.
68
+ *
69
+ * 0 for every other kind — an input with no pressure axis reports no
70
+ * pressure, and a predicate reading this on the wrong kind gets the number
71
+ * that is true rather than one that looks plausible.
72
+ */
73
+ force: number;
74
+ };
75
+ /**
76
+ * The timer a recognizer arms on every press, and what its firing means.
77
+ *
78
+ * All three kinds want one and they disagree only about the outcome: `Pan`'s
79
+ * `activateAfterLongPress` and `LongPress`'s `minDuration` mature the gesture,
80
+ * `Tap`'s `maxDuration` is a deadline that kills it.
81
+ */
82
+ export type RecognizerTimer = {
83
+ delay: number;
84
+ elapsed: "activate" | "fail";
85
+ };
86
+ /** What lifting the pointer means to a gesture that is still BEGAN. */
87
+ export type ReleaseOutcome = {
88
+ kind: "activate";
89
+ } | {
90
+ kind: "fail";
91
+ }
92
+ /** Not over — wait this long for another press, then fail. */
93
+ | {
94
+ kind: "await";
95
+ delay: number;
96
+ }
97
+ /**
98
+ * Nothing at all: stay BEGAN, with no timer and no decision.
99
+ *
100
+ * `Manual` alone, and it is upstream's documented rule for it — "it will not
101
+ * fail when all the pointers are lifted from the screen". A gesture the app
102
+ * drives has no business being failed by a lift the app did not ask about.
103
+ */
104
+ | {
105
+ kind: "hold";
106
+ };
107
+ /**
108
+ * What a recognizer kind contributes: predicates over the current state of
109
+ * one press. Everything else — the state progression, the callbacks, the
110
+ * responder plumbing, the bounds tests, the timer — is shared, which is what
111
+ * makes `Tap` and `LongPress` an afternoon rather than a second machine.
112
+ *
113
+ * Only `shouldFail` and `shouldActivate` are required, and `Pan` implements
114
+ * exactly those two: the rest exist because `Tap` activates on a RELEASE and
115
+ * `LongPress` can be cancelled after it is already ACTIVE, and neither shape
116
+ * was reachable from a pair of movement predicates.
117
+ */
118
+ export type RecognizerDecider = {
119
+ /**
120
+ * Which kind this is.
121
+ *
122
+ * Carried by the decider because the decider IS what tells the kinds apart,
123
+ * and because the arbitration loop needs exactly one fact about a gesture
124
+ * beyond its relations: whether it is `Gesture.Native()`, the one kind that
125
+ * can cancel an already-active gesture.
126
+ */
127
+ kind: GestureKind;
128
+ shouldFail: (view: RecognizerView, config: RecognizerConfig) => boolean;
129
+ shouldActivate: (view: RecognizerView, config: RecognizerConfig) => boolean;
130
+ /** Absent means "no timer", which is `Pan` without `activateAfterLongPress`. */
131
+ timer?: (config: RecognizerConfig) => RecognizerTimer | null;
132
+ /** Absent means an ACTIVE gesture is only ever ended by the pointer. */
133
+ shouldCancelWhileActive?: (view: RecognizerView, config: RecognizerConfig) => boolean;
134
+ /** Absent means a lift while BEGAN is the end of it, which is `Pan`'s rule. */
135
+ onRelease?: (view: RecognizerView, config: RecognizerConfig) => ReleaseOutcome;
136
+ /**
137
+ * Whether activating means taking the responder. Absent means yes, which is
138
+ * every recognizer that decides the interaction is React Native's.
139
+ *
140
+ * `Native` is the one that says no, and it is not an optimisation: taking
141
+ * the responder is what makes the platform declare `CLAIMED` and suspend
142
+ * every enclosing `GtkScrolledWindow`'s kinetics
143
+ * (`responder/use-responder.ts`). A gesture whose entire meaning is "the
144
+ * native widget is handling this" cannot be the thing that stops the native
145
+ * widget from handling it.
146
+ *
147
+ * A recognizer that does not claim runs off the touch props alone — they
148
+ * fire regardless of responder status, which is the same seam the BEGAN
149
+ * phase already uses. It never receives `onResponderMove`, so its updates
150
+ * come from `onTouchMove` and its ending from `onTouchEnd`/`onTouchCancel`.
151
+ */
152
+ claimsResponder?: boolean;
153
+ /**
154
+ * Activating IS the whole gesture: end it, successfully, in the same breath.
155
+ *
156
+ * `Fling` alone, and it is upstream's own shape rather than a shortcut —
157
+ * `FlingGestureHandler.activate()` is overridden to call `this.end()`
158
+ * immediately after `super.activate()`. A fling is a verdict about a motion
159
+ * that has already happened, so there is nothing left to report once it is
160
+ * reached: BEGAN -> ACTIVE -> END, synchronously, with `onStart` and `onEnd`
161
+ * one after the other and no `onUpdate` between them.
162
+ */
163
+ endsOnActivate?: boolean;
164
+ /**
165
+ * Which entry surface drives this kind. Absent means `"pointer"`.
166
+ *
167
+ * The one structural concession this module makes, and it is about where
168
+ * events COME FROM rather than about what happens to them. Three kinds of
169
+ * input are simply not in the pointer stream:
170
+ *
171
+ * - `"touchpad"` — `Pinch`/`Rotation`, fed by
172
+ * `GtkGestureZoom`/`GtkGestureRotate`, because a touchpad pinch presses
173
+ * no button and so opens no GTK sequence and no responder session;
174
+ * - `"hover"` — `Hover`, fed by `GtkEventControllerMotion`, because a
175
+ * pointer that is merely OVER a view has pressed nothing either, and
176
+ * RN's touch props fire only from a press;
177
+ * - `"stylus"` — `ForceTouch`, fed by `GtkGestureStylus`, because pressure
178
+ * is a tablet axis and `wl_pointer` has none.
179
+ *
180
+ * Everything downstream of the entry point is this same machine: the same
181
+ * states, the same callbacks, the same payload, the same `tryActivate` and
182
+ * the same relation maps. There is no second arbitration path.
183
+ *
184
+ * Exactly one surface is live per recognizer. A non-pointer kind's
185
+ * touch/responder props are empty, so a mouse press cannot begin a pinch or
186
+ * a hover; a `"pointer"` kind's controller channel is inert, so a pinch
187
+ * cannot begin a pan.
188
+ */
189
+ source?: "pointer" | "touchpad" | "hover" | "stylus";
190
+ };
191
+ /**
192
+ * RNGH's `checkHitSlop`, restated: build the acceptable box in the view's own
193
+ * coordinates, then test the pointer's offset into the view against it.
194
+ *
195
+ * Every side is "outward is positive", so a NEGATIVE value shrinks the box —
196
+ * the capability RN's own View `hitSlop` does not have. Explicit sides
197
+ * override `horizontal`/`vertical`, and `width`/`height` then anchor the
198
+ * opposite edge to whichever side was named.
199
+ *
200
+ * The plain-number spelling is normalised into the four sides up front.
201
+ * Upstream's web path does not do this and silently ignores a number, which
202
+ * is a bug rather than a semantic worth reproducing — its own native paths
203
+ * normalise exactly this way.
204
+ */
205
+ export declare const hitSlopRect: (bounds: Rect, hitSlop: GestureHitSlop | undefined) => Rect;
206
+ /**
207
+ * One frame from whichever GTK controller feeds a non-pointer kind, in the
208
+ * terms the recognizer reads.
209
+ *
210
+ * ONE sample type for three sources rather than three, because what the
211
+ * machine needs from all of them is the same short list and only two fields
212
+ * differ per kind. `scale` and `rotation` are CUMULATIVE since GTK recognized
213
+ * the gesture, which is what `gtk_gesture_zoom_get_scale_delta` ("the zooming
214
+ * difference since the gesture was recognized, hence the starting point is
215
+ * considered 1:1") and `gtk_gesture_rotate_get_angle_delta` already are — the
216
+ * same shape as upstream's own accumulators, so nothing is re-derived on the
217
+ * way in.
218
+ */
219
+ export type ControllerSample = {
220
+ /**
221
+ * Where the gesture is, in the gesture VIEW's own coordinates.
222
+ *
223
+ * A pinch's bounding-box centre, a hover's pointer, a stylus tip: three
224
+ * names for the position the payload's `x`/`y`, `focalX`/`focalY` and
225
+ * `anchorX`/`anchorY` are all filled from, which is why they are one pair
226
+ * of fields and not three.
227
+ */
228
+ x: number;
229
+ y: number;
230
+ /** `Pinch`: 1 at the start of the gesture, above 1 for a spread. */
231
+ scale?: number;
232
+ /** `Rotation`: 0 at the start; radians, positive clockwise. */
233
+ rotation?: number;
234
+ /** `ForceTouch`: pressure normalised to `[0, 1]`. */
235
+ force?: number;
236
+ /** Pointers GTK reported. A touchpad pinch is always two; a hover is one. */
237
+ pointers: number;
238
+ };
239
+ /**
240
+ * The non-pointer entry surface, for the kinds GTK feeds rather than the
241
+ * pointer stream. Null on every pointer kind — see `RecognizerDecider.source`.
242
+ */
243
+ export type ControllerChannel = {
244
+ begin: (sample: ControllerSample) => void;
245
+ update: (sample: ControllerSample) => void;
246
+ end: () => void;
247
+ cancel: () => void;
248
+ };
249
+ export type Recognizer = {
250
+ /** The responder props to put on the gesture's view. Empty for a controller kind. */
251
+ handlers: Record<string, (event: GestureResponderEvent) => boolean | void>;
252
+ /**
253
+ * Where `GtkGestureZoom`/`GtkGestureRotate`/`GtkEventControllerMotion`/
254
+ * `GtkGestureStylus` deliver, or null for a pointer kind.
255
+ */
256
+ controller: ControllerChannel | null;
257
+ /** This gesture's seat in the arbitration loop. */
258
+ participant: Participant;
259
+ /** Cancels any pending timer and leaves the loop; called on unmount. */
260
+ dispose: () => void;
261
+ };
262
+ /**
263
+ * Builds the machine. `readConfig` is called on every event rather than
264
+ * captured, so a re-render that hands the detector a fresh gesture object —
265
+ * which is what both spellings produce, every render — takes effect without
266
+ * swapping the handler set mid-drag.
267
+ */
268
+ export declare const createRecognizer: (handlerTag: number, decider: RecognizerDecider, readConfig: () => RecognizerConfig, env: RecognizerEnvironment) => Recognizer;