@unrulysystems/native-motion-core 0.1.0-alpha.0

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 (326) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/LICENSE +21 -0
  3. package/README.md +48 -0
  4. package/dist/clock.cjs +71 -0
  5. package/dist/clock.d.cts +23 -0
  6. package/dist/clock.d.ts +23 -0
  7. package/dist/clock.js +66 -0
  8. package/dist/collect-reads.cjs +68 -0
  9. package/dist/collect-reads.d.cts +23 -0
  10. package/dist/collect-reads.d.ts +23 -0
  11. package/dist/collect-reads.js +62 -0
  12. package/dist/component/boundedArray.cjs +74 -0
  13. package/dist/component/boundedArray.d.cts +25 -0
  14. package/dist/component/boundedArray.d.ts +25 -0
  15. package/dist/component/boundedArray.js +68 -0
  16. package/dist/component/index.cjs +57 -0
  17. package/dist/component/index.d.cts +12 -0
  18. package/dist/component/index.d.ts +12 -0
  19. package/dist/component/index.js +22 -0
  20. package/dist/component/orchestration.cjs +129 -0
  21. package/dist/component/orchestration.d.cts +66 -0
  22. package/dist/component/orchestration.d.ts +66 -0
  23. package/dist/component/orchestration.js +124 -0
  24. package/dist/component/resolve.cjs +104 -0
  25. package/dist/component/resolve.d.cts +11 -0
  26. package/dist/component/resolve.d.ts +11 -0
  27. package/dist/component/resolve.js +97 -0
  28. package/dist/component/transition.cjs +352 -0
  29. package/dist/component/transition.d.cts +33 -0
  30. package/dist/component/transition.d.ts +33 -0
  31. package/dist/component/transition.js +339 -0
  32. package/dist/component/types.cjs +114 -0
  33. package/dist/component/types.d.cts +60 -0
  34. package/dist/component/types.d.ts +60 -0
  35. package/dist/component/types.js +111 -0
  36. package/dist/component/validate.cjs +1015 -0
  37. package/dist/component/validate.d.cts +37 -0
  38. package/dist/component/validate.d.ts +37 -0
  39. package/dist/component/validate.js +1002 -0
  40. package/dist/component/variants.cjs +333 -0
  41. package/dist/component/variants.d.cts +106 -0
  42. package/dist/component/variants.d.ts +106 -0
  43. package/dist/component/variants.js +321 -0
  44. package/dist/config/constants.cjs +41 -0
  45. package/dist/config/constants.d.cts +29 -0
  46. package/dist/config/constants.d.ts +29 -0
  47. package/dist/config/constants.js +38 -0
  48. package/dist/delay.cjs +72 -0
  49. package/dist/delay.d.cts +26 -0
  50. package/dist/delay.d.ts +26 -0
  51. package/dist/delay.js +70 -0
  52. package/dist/derived.cjs +143 -0
  53. package/dist/derived.d.cts +41 -0
  54. package/dist/derived.d.ts +41 -0
  55. package/dist/derived.js +139 -0
  56. package/dist/driver/index.cjs +22 -0
  57. package/dist/driver/index.d.cts +7 -0
  58. package/dist/driver/index.d.ts +7 -0
  59. package/dist/driver/index.js +14 -0
  60. package/dist/driver/keyframeTiming.cjs +130 -0
  61. package/dist/driver/keyframeTiming.d.cts +18 -0
  62. package/dist/driver/keyframeTiming.d.ts +18 -0
  63. package/dist/driver/keyframeTiming.js +124 -0
  64. package/dist/driver/keyframeTimingConfig.cjs +24 -0
  65. package/dist/driver/keyframeTimingConfig.d.cts +5 -0
  66. package/dist/driver/keyframeTimingConfig.d.ts +5 -0
  67. package/dist/driver/keyframeTimingConfig.js +22 -0
  68. package/dist/driver/prepare.cjs +459 -0
  69. package/dist/driver/prepare.d.cts +4 -0
  70. package/dist/driver/prepare.d.ts +4 -0
  71. package/dist/driver/prepare.js +454 -0
  72. package/dist/driver/reference.cjs +762 -0
  73. package/dist/driver/reference.d.cts +53 -0
  74. package/dist/driver/reference.d.ts +53 -0
  75. package/dist/driver/reference.js +757 -0
  76. package/dist/driver/step.cjs +55 -0
  77. package/dist/driver/step.d.cts +9 -0
  78. package/dist/driver/step.d.ts +9 -0
  79. package/dist/driver/step.js +52 -0
  80. package/dist/driver/tiers.cjs +40 -0
  81. package/dist/driver/tiers.d.cts +2 -0
  82. package/dist/driver/tiers.d.ts +2 -0
  83. package/dist/driver/tiers.js +37 -0
  84. package/dist/driver/types.cjs +9 -0
  85. package/dist/driver/types.d.cts +68 -0
  86. package/dist/driver/types.d.ts +68 -0
  87. package/dist/driver/types.js +8 -0
  88. package/dist/external-animation-ledger.cjs +1250 -0
  89. package/dist/external-animation-ledger.d.cts +416 -0
  90. package/dist/external-animation-ledger.d.ts +416 -0
  91. package/dist/external-animation-ledger.js +1243 -0
  92. package/dist/gesture/directionLock.cjs +25 -0
  93. package/dist/gesture/directionLock.d.cts +8 -0
  94. package/dist/gesture/directionLock.d.ts +8 -0
  95. package/dist/gesture/directionLock.js +21 -0
  96. package/dist/gesture/dragConfig.cjs +634 -0
  97. package/dist/gesture/dragConfig.d.cts +298 -0
  98. package/dist/gesture/dragConfig.d.ts +298 -0
  99. package/dist/gesture/dragConfig.js +624 -0
  100. package/dist/gesture/elastic.cjs +44 -0
  101. package/dist/gesture/elastic.d.cts +4 -0
  102. package/dist/gesture/elastic.d.ts +4 -0
  103. package/dist/gesture/elastic.js +39 -0
  104. package/dist/gesture/handoffSession.cjs +161 -0
  105. package/dist/gesture/handoffSession.d.cts +35 -0
  106. package/dist/gesture/handoffSession.d.ts +35 -0
  107. package/dist/gesture/handoffSession.js +158 -0
  108. package/dist/gesture/index.cjs +37 -0
  109. package/dist/gesture/index.d.cts +12 -0
  110. package/dist/gesture/index.d.ts +12 -0
  111. package/dist/gesture/index.js +11 -0
  112. package/dist/gesture/projection.cjs +95 -0
  113. package/dist/gesture/projection.d.cts +7 -0
  114. package/dist/gesture/projection.d.ts +7 -0
  115. package/dist/gesture/projection.js +87 -0
  116. package/dist/gesture/session.cjs +162 -0
  117. package/dist/gesture/session.d.cts +29 -0
  118. package/dist/gesture/session.d.ts +29 -0
  119. package/dist/gesture/session.js +158 -0
  120. package/dist/gesture/types.cjs +5 -0
  121. package/dist/gesture/types.d.cts +13 -0
  122. package/dist/gesture/types.d.ts +13 -0
  123. package/dist/gesture/types.js +4 -0
  124. package/dist/gesture/viewportConstraints.cjs +38 -0
  125. package/dist/gesture/viewportConstraints.d.cts +6 -0
  126. package/dist/gesture/viewportConstraints.d.ts +6 -0
  127. package/dist/gesture/viewportConstraints.js +34 -0
  128. package/dist/graph.cjs +226 -0
  129. package/dist/graph.d.cts +2 -0
  130. package/dist/graph.d.ts +2 -0
  131. package/dist/graph.js +223 -0
  132. package/dist/index.cjs +140 -0
  133. package/dist/index.d.cts +33 -0
  134. package/dist/index.d.ts +33 -0
  135. package/dist/index.js +70 -0
  136. package/dist/inertia.cjs +214 -0
  137. package/dist/inertia.d.cts +53 -0
  138. package/dist/inertia.d.ts +53 -0
  139. package/dist/inertia.js +212 -0
  140. package/dist/instant.cjs +66 -0
  141. package/dist/instant.d.cts +16 -0
  142. package/dist/instant.d.ts +16 -0
  143. package/dist/instant.js +63 -0
  144. package/dist/internal-driver.cjs +81 -0
  145. package/dist/internal-driver.d.cts +19 -0
  146. package/dist/internal-driver.d.ts +19 -0
  147. package/dist/internal-driver.js +35 -0
  148. package/dist/keyframes.cjs +191 -0
  149. package/dist/keyframes.d.cts +13 -0
  150. package/dist/keyframes.d.ts +13 -0
  151. package/dist/keyframes.js +188 -0
  152. package/dist/layout/commitDetector.cjs +67 -0
  153. package/dist/layout/commitDetector.d.cts +21 -0
  154. package/dist/layout/commitDetector.d.ts +21 -0
  155. package/dist/layout/commitDetector.js +64 -0
  156. package/dist/layout/compose.cjs +67 -0
  157. package/dist/layout/compose.d.cts +30 -0
  158. package/dist/layout/compose.d.ts +30 -0
  159. package/dist/layout/compose.js +65 -0
  160. package/dist/layout/constants.cjs +13 -0
  161. package/dist/layout/constants.d.cts +6 -0
  162. package/dist/layout/constants.d.ts +6 -0
  163. package/dist/layout/constants.js +10 -0
  164. package/dist/layout/identity.cjs +700 -0
  165. package/dist/layout/identity.d.cts +67 -0
  166. package/dist/layout/identity.d.ts +67 -0
  167. package/dist/layout/identity.js +698 -0
  168. package/dist/layout/index.cjs +36 -0
  169. package/dist/layout/index.d.cts +18 -0
  170. package/dist/layout/index.d.ts +18 -0
  171. package/dist/layout/index.js +13 -0
  172. package/dist/layout/measure.cjs +81 -0
  173. package/dist/layout/measure.d.cts +43 -0
  174. package/dist/layout/measure.d.ts +43 -0
  175. package/dist/layout/measure.js +78 -0
  176. package/dist/layout/projection.cjs +99 -0
  177. package/dist/layout/projection.d.cts +23 -0
  178. package/dist/layout/projection.d.ts +23 -0
  179. package/dist/layout/projection.js +97 -0
  180. package/dist/layout/scroll.cjs +27 -0
  181. package/dist/layout/scroll.d.cts +13 -0
  182. package/dist/layout/scroll.d.ts +13 -0
  183. package/dist/layout/scroll.js +24 -0
  184. package/dist/layout/session.cjs +207 -0
  185. package/dist/layout/session.d.cts +73 -0
  186. package/dist/layout/session.d.ts +73 -0
  187. package/dist/layout/session.js +205 -0
  188. package/dist/layout/tree.cjs +826 -0
  189. package/dist/layout/tree.d.cts +70 -0
  190. package/dist/layout/tree.d.ts +70 -0
  191. package/dist/layout/tree.js +823 -0
  192. package/dist/layout/types.cjs +36 -0
  193. package/dist/layout/types.d.cts +31 -0
  194. package/dist/layout/types.d.ts +31 -0
  195. package/dist/layout/types.js +35 -0
  196. package/dist/motion-arc.cjs +184 -0
  197. package/dist/motion-arc.d.cts +78 -0
  198. package/dist/motion-arc.d.ts +78 -0
  199. package/dist/motion-arc.js +183 -0
  200. package/dist/motion-mix.cjs +205 -0
  201. package/dist/motion-mix.d.cts +3 -0
  202. package/dist/motion-mix.d.ts +3 -0
  203. package/dist/motion-mix.js +202 -0
  204. package/dist/motion-value-driver-port.cjs +636 -0
  205. package/dist/motion-value-driver-port.d.cts +406 -0
  206. package/dist/motion-value-driver-port.d.ts +406 -0
  207. package/dist/motion-value-driver-port.js +627 -0
  208. package/dist/motion-value.cjs +189 -0
  209. package/dist/motion-value.d.cts +51 -0
  210. package/dist/motion-value.d.ts +51 -0
  211. package/dist/motion-value.js +185 -0
  212. package/dist/presence/controller.cjs +657 -0
  213. package/dist/presence/controller.d.cts +6 -0
  214. package/dist/presence/controller.d.ts +6 -0
  215. package/dist/presence/controller.js +652 -0
  216. package/dist/presence/index.cjs +19 -0
  217. package/dist/presence/index.d.cts +4 -0
  218. package/dist/presence/index.d.ts +4 -0
  219. package/dist/presence/index.js +12 -0
  220. package/dist/presence/machine.cjs +50 -0
  221. package/dist/presence/machine.d.cts +10 -0
  222. package/dist/presence/machine.d.ts +10 -0
  223. package/dist/presence/machine.js +46 -0
  224. package/dist/presence/types.cjs +6 -0
  225. package/dist/presence/types.d.cts +32 -0
  226. package/dist/presence/types.d.ts +32 -0
  227. package/dist/presence/types.js +5 -0
  228. package/dist/repeat.cjs +311 -0
  229. package/dist/repeat.d.cts +174 -0
  230. package/dist/repeat.d.ts +174 -0
  231. package/dist/repeat.js +300 -0
  232. package/dist/spring.cjs +128 -0
  233. package/dist/spring.d.cts +18 -0
  234. package/dist/spring.d.ts +18 -0
  235. package/dist/spring.js +125 -0
  236. package/dist/subscriptions.cjs +74 -0
  237. package/dist/subscriptions.d.cts +19 -0
  238. package/dist/subscriptions.d.ts +19 -0
  239. package/dist/subscriptions.js +69 -0
  240. package/dist/subset/index.cjs +23 -0
  241. package/dist/subset/index.d.cts +6 -0
  242. package/dist/subset/index.d.ts +6 -0
  243. package/dist/subset/index.js +13 -0
  244. package/dist/subset/normalize.cjs +90 -0
  245. package/dist/subset/normalize.d.cts +10 -0
  246. package/dist/subset/normalize.d.ts +10 -0
  247. package/dist/subset/normalize.js +85 -0
  248. package/dist/subset/registry.cjs +259 -0
  249. package/dist/subset/registry.d.cts +25 -0
  250. package/dist/subset/registry.d.ts +25 -0
  251. package/dist/subset/registry.js +256 -0
  252. package/dist/subset/resolve.cjs +98 -0
  253. package/dist/subset/resolve.d.cts +24 -0
  254. package/dist/subset/resolve.d.ts +24 -0
  255. package/dist/subset/resolve.js +90 -0
  256. package/dist/timing.cjs +206 -0
  257. package/dist/timing.d.cts +17 -0
  258. package/dist/timing.d.ts +17 -0
  259. package/dist/timing.js +201 -0
  260. package/dist/transformTemplate.cjs +219 -0
  261. package/dist/transformTemplate.d.cts +29 -0
  262. package/dist/transformTemplate.d.ts +29 -0
  263. package/dist/transformTemplate.js +215 -0
  264. package/dist/transition.cjs +231 -0
  265. package/dist/transition.d.cts +89 -0
  266. package/dist/transition.d.ts +89 -0
  267. package/dist/transition.js +223 -0
  268. package/dist/types.cjs +4 -0
  269. package/dist/types.d.cts +175 -0
  270. package/dist/types.d.ts +175 -0
  271. package/dist/types.js +3 -0
  272. package/dist/value-types/color.cjs +220 -0
  273. package/dist/value-types/color.d.cts +19 -0
  274. package/dist/value-types/color.d.ts +19 -0
  275. package/dist/value-types/color.js +218 -0
  276. package/dist/value-types/complex.cjs +160 -0
  277. package/dist/value-types/complex.d.cts +19 -0
  278. package/dist/value-types/complex.d.ts +19 -0
  279. package/dist/value-types/complex.js +155 -0
  280. package/dist/value-types/constants.cjs +15 -0
  281. package/dist/value-types/constants.d.cts +6 -0
  282. package/dist/value-types/constants.d.ts +6 -0
  283. package/dist/value-types/constants.js +12 -0
  284. package/dist/value-types/discrete.cjs +62 -0
  285. package/dist/value-types/discrete.d.cts +4 -0
  286. package/dist/value-types/discrete.d.ts +4 -0
  287. package/dist/value-types/discrete.js +56 -0
  288. package/dist/value-types/index.cjs +59 -0
  289. package/dist/value-types/index.d.cts +14 -0
  290. package/dist/value-types/index.d.ts +14 -0
  291. package/dist/value-types/index.js +24 -0
  292. package/dist/value-types/measure-resolve.cjs +325 -0
  293. package/dist/value-types/measure-resolve.d.cts +91 -0
  294. package/dist/value-types/measure-resolve.d.ts +91 -0
  295. package/dist/value-types/measure-resolve.js +313 -0
  296. package/dist/value-types/mix.cjs +90 -0
  297. package/dist/value-types/mix.d.cts +27 -0
  298. package/dist/value-types/mix.d.ts +27 -0
  299. package/dist/value-types/mix.js +85 -0
  300. package/dist/value-types/named-colors.cjs +61 -0
  301. package/dist/value-types/named-colors.d.cts +2 -0
  302. package/dist/value-types/named-colors.d.ts +2 -0
  303. package/dist/value-types/named-colors.js +58 -0
  304. package/dist/value-types/numeric.cjs +86 -0
  305. package/dist/value-types/numeric.d.cts +16 -0
  306. package/dist/value-types/numeric.d.ts +16 -0
  307. package/dist/value-types/numeric.js +79 -0
  308. package/dist/worklet-layout/config/constants.js +39 -0
  309. package/dist/worklet-layout/layout/constants.js +11 -0
  310. package/dist/worklet-layout/layout/identity.js +699 -0
  311. package/dist/worklet-layout/layout/projection.js +98 -0
  312. package/dist/worklet-layout/layout/session.js +206 -0
  313. package/dist/worklet-layout/layout/tree.js +824 -0
  314. package/dist/worklet-layout/layout/types.js +36 -0
  315. package/dist/worklet-layout/spring.js +125 -0
  316. package/dist/worklet-layout/timing.js +201 -0
  317. package/dist/worklet-layout/transition.js +223 -0
  318. package/dist/worklet-layout.cjs +47 -0
  319. package/dist/worklet-layout.d.cts +15 -0
  320. package/dist/worklet-layout.d.ts +15 -0
  321. package/dist/worklet-layout.js +28 -0
  322. package/dist/wrap.cjs +7 -0
  323. package/dist/wrap.d.cts +1 -0
  324. package/dist/wrap.d.ts +1 -0
  325. package/dist/wrap.js +4 -0
  326. package/package.json +45 -0
@@ -0,0 +1,406 @@
1
+ import type { Clock, MotionGraph, MotionValue } from "./types.cjs";
2
+ export type DirectPublicInitializerProvenance = {
3
+ readonly kind: 'finite-number';
4
+ } | {
5
+ readonly kind: 'ineligible';
6
+ readonly reason: 'non-finite-number' | 'non-number';
7
+ };
8
+ export type MotionValueDriverCreation = {
9
+ readonly kind: 'direct-public';
10
+ readonly initializer: DirectPublicInitializerProvenance;
11
+ } | {
12
+ readonly kind: 'unrecognized';
13
+ };
14
+ export type MotionValueDriverBindingEligibility = {
15
+ readonly kind: 'eligible';
16
+ readonly creationKind: 'direct-public';
17
+ readonly initializerProvenance: 'finite-number';
18
+ readonly currentValue: number;
19
+ } | {
20
+ readonly kind: 'ineligible';
21
+ readonly reason: 'not-direct-public' | 'initializer-not-finite-number' | 'current-not-finite-number';
22
+ };
23
+ export type PrimitiveNumericHistory = {
24
+ readonly kind: 'single-sample';
25
+ readonly currentValue: number;
26
+ readonly currentTimestampMs: number;
27
+ } | {
28
+ readonly kind: 'finite-difference';
29
+ readonly currentValue: number;
30
+ readonly previousValue: number;
31
+ readonly currentTimestampMs: number;
32
+ readonly previousTimestampMs: number;
33
+ };
34
+ export type CachedNumericHistory = {
35
+ readonly kind: 'unavailable';
36
+ } | PrimitiveNumericHistory;
37
+ /**
38
+ * Collector-silent raw state supplied by the creating/owning runtime. Attaching the private port
39
+ * must not call public `get()` (which participates in dependency collection), and an attach with no
40
+ * authored sample history must not manufacture a timestamp from the current clock.
41
+ */
42
+ export interface CollectorSilentMotionValueRawSnapshot<T> {
43
+ readonly kind: 'collector-silent-motion-value-raw-snapshot';
44
+ readonly currentValue: T;
45
+ readonly history: CachedNumericHistory;
46
+ readonly directOperationEpoch: number;
47
+ readonly authoritativeSequence: number;
48
+ }
49
+ export interface PrimitiveMotionValueSnapshot {
50
+ readonly kind: 'numeric-motion-value-snapshot';
51
+ readonly snapshotSequence: number;
52
+ readonly directOperationEpoch: number;
53
+ readonly authoritativeSequence: number;
54
+ readonly history: PrimitiveNumericHistory;
55
+ }
56
+ export type TransportedSampleOrigin = 'ui-frame' | 'js-local-frame' | 'js-fallback-frame' | 'js-pending-update' | 'js-orphan-drain-frame';
57
+ interface TransportedMotionValueEntryIdentity {
58
+ readonly channelId: number;
59
+ readonly origin: TransportedSampleOrigin;
60
+ readonly authoritativeSequence: number;
61
+ }
62
+ export interface TransportedExecutionGeneratorSample extends TransportedMotionValueEntryIdentity {
63
+ readonly kind: 'generator-sample';
64
+ readonly executionId: number;
65
+ readonly directOperationEpoch: number;
66
+ readonly executionLease: number;
67
+ readonly writeSequence: number;
68
+ readonly history: PrimitiveNumericHistory;
69
+ readonly completion: {
70
+ readonly kind: 'unarmed';
71
+ } | {
72
+ readonly kind: 'armed';
73
+ readonly completionSequence: number;
74
+ readonly lifecycleEventSequence: number;
75
+ };
76
+ }
77
+ export type TokenlessMotionValueTaskKind = 'instant-target' | 'equal-reassertion' | 'carrier' | 'idle-direct-write';
78
+ export interface TransportedTokenlessTaskWrite extends TransportedMotionValueEntryIdentity {
79
+ readonly kind: 'tokenless-task-write';
80
+ readonly taskKind: TokenlessMotionValueTaskKind;
81
+ readonly taskSequence: number;
82
+ readonly writeSequence: number;
83
+ readonly history: PrimitiveNumericHistory;
84
+ }
85
+ export type TransportedTaskCallbackKind = 'transition-on-update' | 'transition-on-complete' | 'animation-complete';
86
+ interface TransportedTokenlessTaskCallbackIdentity extends TransportedMotionValueEntryIdentity {
87
+ readonly kind: 'tokenless-task-callback';
88
+ readonly taskKind: 'instant-target';
89
+ readonly taskSequence: number;
90
+ /**
91
+ * Task delivery is tokenless, but callback-time cache adoption is not. These guards describe
92
+ * the candidate history only; rejecting it must never suppress the immutable callback event.
93
+ */
94
+ readonly candidateDirectOperationEpoch: number;
95
+ readonly candidateWriteSequence: number;
96
+ readonly eventSequence: number;
97
+ readonly history: PrimitiveNumericHistory;
98
+ }
99
+ export type TransportedTokenlessTaskCallback = (TransportedTokenlessTaskCallbackIdentity & {
100
+ readonly callbackKind: 'transition-on-update' | 'transition-on-complete';
101
+ readonly completionSequence?: never;
102
+ }) | (TransportedTokenlessTaskCallbackIdentity & {
103
+ readonly callbackKind: 'animation-complete';
104
+ readonly completionSequence: number;
105
+ });
106
+ /** One update-ordered mailbox entry: execution samples plus every tokenless task/write class. */
107
+ export type TransportedMotionValueSample = TransportedExecutionGeneratorSample | TransportedTokenlessTaskWrite | TransportedTokenlessTaskCallback;
108
+ export interface PrimitiveTransitionEvent {
109
+ readonly kind: 'transition-on-update' | 'transition-on-complete';
110
+ readonly channelId: number;
111
+ readonly executionId: number;
112
+ readonly directOperationEpoch: number;
113
+ readonly executionLease: number;
114
+ readonly writeSequence: number;
115
+ readonly eventSequence: number;
116
+ readonly history: PrimitiveNumericHistory;
117
+ }
118
+ export interface MotionValueLifecycleTerminalEvent {
119
+ readonly kind: 'animation-complete';
120
+ readonly channelId: number;
121
+ readonly executionId: number;
122
+ readonly directOperationEpoch: number;
123
+ readonly executionLease: number;
124
+ readonly writeSequence: number;
125
+ readonly eventSequence: number;
126
+ readonly completionSequence: number;
127
+ readonly history: PrimitiveNumericHistory;
128
+ }
129
+ export type DirectMotionValueOperation = {
130
+ readonly kind: 'set';
131
+ readonly commandSequence: number;
132
+ readonly value: number;
133
+ } | {
134
+ readonly kind: 'jump';
135
+ readonly commandSequence: number;
136
+ readonly value: number;
137
+ } | {
138
+ readonly kind: 'stop';
139
+ readonly commandSequence: number;
140
+ } | {
141
+ readonly kind: 'destroy';
142
+ readonly commandSequence: number;
143
+ } | {
144
+ readonly kind: 'start';
145
+ readonly commandSequence: number;
146
+ readonly executionId: number;
147
+ };
148
+ /**
149
+ * Private public-control-slot identity. The physical execution is retained elsewhere: clearing
150
+ * this slot changes `isAnimating()` only and must never imply that its execution was stopped.
151
+ */
152
+ export type MotionValuePublicControlSlotState = {
153
+ readonly kind: 'empty';
154
+ } | {
155
+ readonly kind: 'installed';
156
+ readonly controlId: number;
157
+ readonly executionId: number;
158
+ };
159
+ export interface MotionValuePublicControlSlotInstallation {
160
+ readonly controlId: number;
161
+ readonly executionId: number;
162
+ /** Stops only this installed control when a direct public stop/jump reaches it. */
163
+ readonly stopPhysicalExecution: () => void;
164
+ }
165
+ export type MotionValueDriverPortInvariant = 'rehydrated-public-control-slot-installation-required' | 'rehydrated-public-control-slot-installation-unexpected' | 'rehydrated-public-control-slot-reference-mismatch' | 'value-not-graph-motion-value' | 'direct-operation-kind-unrecognized' | 'transported-sample-kind-unrecognized';
166
+ export declare const MOTION_VALUE_DRIVER_PORT_INVARIANT: "NATIVE_MOTION_CORE_MOTION_VALUE_DRIVER_PORT_INVARIANT";
167
+ /** Typed fail-closed refusal for an unusable restored public-control slot. */
168
+ export declare class MotionValueDriverPortInvariantError extends Error {
169
+ readonly code: "NATIVE_MOTION_CORE_MOTION_VALUE_DRIVER_PORT_INVARIANT";
170
+ readonly invariant: MotionValueDriverPortInvariant;
171
+ constructor(invariant: MotionValueDriverPortInvariant);
172
+ }
173
+ export interface MotionValuePublicControlSlotReceipt {
174
+ readonly kind: 'public-control-slot-updated';
175
+ readonly publicControlSlot: MotionValuePublicControlSlotState;
176
+ readonly physicalExecution: 'retained';
177
+ }
178
+ export interface MotionValueDriverPortState {
179
+ readonly channelId: number;
180
+ readonly rawCurrentValue: unknown;
181
+ readonly history: CachedNumericHistory;
182
+ readonly directOperationEpoch: number;
183
+ readonly authoritativeSequence: number;
184
+ readonly currentExecutionId: number | null;
185
+ readonly executionLease: number;
186
+ readonly publicControlSlot: MotionValuePublicControlSlotState;
187
+ readonly acceptedWriteSequence: number;
188
+ readonly demandedWriteSequence: number;
189
+ readonly deliveredEventWatermark: number;
190
+ readonly synchronousSnapshotReadCount: number;
191
+ readonly outboundOriginCommandCount: number;
192
+ }
193
+ export interface MotionValueDriverPortObservation {
194
+ readonly channelId: number;
195
+ readonly creationKind: MotionValueDriverCreation['kind'];
196
+ readonly initializerProvenance: 'finite-number' | 'non-finite-number' | 'non-number' | 'unrecognized';
197
+ readonly currentValueKind: 'finite-number' | 'non-finite-number' | 'non-number';
198
+ readonly cachedCurrentValue: number | null;
199
+ readonly cachedPreviousValue: number | null;
200
+ readonly cachedCurrentTimestampMs: number | null;
201
+ readonly cachedPreviousTimestampMs: number | null;
202
+ readonly directOperationEpoch: number;
203
+ readonly authoritativeSequence: number;
204
+ readonly currentExecutionId: number | null;
205
+ readonly executionLease: number;
206
+ readonly publicControlSlotControlId: number | null;
207
+ readonly publicControlSlotExecutionId: number | null;
208
+ readonly acceptedWriteSequence: number;
209
+ readonly demandedWriteSequence: number;
210
+ readonly deliveredEventWatermark: number;
211
+ readonly synchronousSnapshotReadCount: number;
212
+ readonly outboundOriginCommandCount: number;
213
+ }
214
+ export interface TokenlessCallbackReplaySuppression {
215
+ readonly kind: 'event-replay-rejected';
216
+ readonly reason: 'stale-event-sequence';
217
+ readonly callbackKind: TransportedTaskCallbackKind;
218
+ readonly callbackDelivery: 'suppressed-replay';
219
+ readonly candidateCache: 'unchanged';
220
+ readonly progress: 'unchanged';
221
+ readonly originEcho: 'suppressed';
222
+ }
223
+ export type TransportedSampleApplication = {
224
+ readonly kind: 'applied';
225
+ readonly finiteDifferenceVelocity: number;
226
+ readonly changeNotification: 'emitted' | 'suppressed-equal-value' | 'suppressed-no-observer';
227
+ readonly derivedDependents: 'marked-dirty' | 'unchanged';
228
+ readonly derivedFrame: 'requested' | 'not-requested';
229
+ readonly originEcho: 'suppressed';
230
+ } | {
231
+ readonly kind: 'rejected';
232
+ readonly reason: 'stale-direct-operation-epoch' | 'stale-execution-lease' | 'stale-write-sequence';
233
+ readonly armedCompletion: 'retained' | 'not-armed';
234
+ readonly originEcho: 'suppressed';
235
+ } | {
236
+ readonly kind: 'callback-delivered';
237
+ readonly callbackKind: TransportedTaskCallbackKind;
238
+ readonly callbackDelivery: 'required';
239
+ readonly candidateCache: 'adopted' | 'rejected-stale-direct-operation-epoch' | 'rejected-stale-write-sequence';
240
+ readonly originEcho: 'suppressed';
241
+ } | TokenlessCallbackReplaySuppression;
242
+ export interface DirectMotionValueOperationReceipt {
243
+ readonly kind: 'direct-operation-begun';
244
+ readonly operation: DirectMotionValueOperation['kind'];
245
+ readonly directOperationEpoch: number;
246
+ readonly outboundOriginCommand: 'required' | 'not-required';
247
+ }
248
+ export interface SynchronousSnapshotAdoption {
249
+ readonly kind: 'synchronous-snapshot-adopted';
250
+ readonly callbackDelivery: 'silent';
251
+ readonly demandedWriteSequence: 'unchanged';
252
+ readonly publicControlSlot: 'unchanged';
253
+ }
254
+ export interface SynchronousSnapshotRejection {
255
+ readonly kind: 'synchronous-snapshot-rejected';
256
+ readonly reason: 'stale-direct-operation-epoch' | 'stale-authoritative-sequence';
257
+ readonly callbackDelivery: 'silent';
258
+ readonly demandedWriteSequence: 'unchanged';
259
+ readonly publicControlSlot: 'unchanged';
260
+ }
261
+ export type GuardedSynchronousSnapshotAdoption = SynchronousSnapshotAdoption | SynchronousSnapshotRejection;
262
+ export type TransportedTerminalApplication = {
263
+ readonly kind: 'candidate-adopted';
264
+ readonly callbackDelivery: 'required';
265
+ readonly armedCompletion: 'retained';
266
+ } | {
267
+ readonly kind: 'event-replay-rejected';
268
+ readonly reason: 'stale-event-sequence';
269
+ readonly callbackDelivery: 'suppressed-replay';
270
+ readonly armedCompletion: 'retained';
271
+ } | {
272
+ readonly kind: 'candidate-cache-rejected';
273
+ readonly reason: 'stale-direct-operation-epoch' | 'stale-execution-lease' | 'stale-write-sequence';
274
+ readonly callbackDelivery: 'required';
275
+ readonly armedCompletion: 'retained';
276
+ };
277
+ /**
278
+ * Drain-local progress writer used when a transported sample crosses arbitrary user callbacks.
279
+ * State adoption is irreversible even when a later observer throws; the owning drain finalizes
280
+ * its delivered watermark without replaying that write (REQ-VALUE-015).
281
+ */
282
+ export type TransportedSampleIrreversibleSubphase = 'cache-history-adopted' | 'change-observer-delivered' | 'dependent-dirtying-complete';
283
+ export type TransportedSampleProgressEntry = {
284
+ readonly channelId: number;
285
+ readonly entryKind: 'generator-sample';
286
+ readonly executionId: number;
287
+ readonly deliverySequence: number;
288
+ } | {
289
+ readonly channelId: number;
290
+ readonly entryKind: 'tokenless-task-write';
291
+ readonly taskKind: TokenlessMotionValueTaskKind;
292
+ readonly taskSequence: number;
293
+ readonly deliverySequence: number;
294
+ } | {
295
+ readonly channelId: number;
296
+ readonly entryKind: 'transition-terminal';
297
+ readonly callbackKind: 'transition-on-update' | 'transition-on-complete';
298
+ readonly executionId: number;
299
+ readonly deliverySequence: number;
300
+ } | {
301
+ readonly channelId: number;
302
+ readonly entryKind: 'lifecycle-terminal';
303
+ readonly callbackKind: 'animation-complete';
304
+ readonly executionId: number;
305
+ readonly deliverySequence: number;
306
+ } | {
307
+ readonly channelId: number;
308
+ readonly entryKind: 'tokenless-task-callback';
309
+ readonly taskKind: 'instant-target';
310
+ readonly callbackKind: TransportedTaskCallbackKind;
311
+ readonly taskSequence: number;
312
+ readonly deliverySequence: number;
313
+ };
314
+ export interface TransportedSampleProgressState {
315
+ readonly activeEntry: TransportedSampleProgressEntry | null;
316
+ readonly lastIrreversibleSubphase: TransportedSampleIrreversibleSubphase | null;
317
+ readonly deliveredWriteWatermark: number;
318
+ readonly deliveredEventWatermark: number;
319
+ readonly retentionFinalization: 'pending' | 'finalized';
320
+ }
321
+ export interface TransportedSampleProgressWriter {
322
+ beginEntry(entry: TransportedSampleProgressEntry): void;
323
+ markIrreversibleSubphase(subphase: TransportedSampleIrreversibleSubphase): void;
324
+ finalizeDeliveredWriteWatermarkAndRetention(channelId: number, deliveredWriteWatermark: number): void;
325
+ finalizeDeliveredEventWatermarkAndRetention(channelId: number, deliveredEventWatermark: number): void;
326
+ clearEntry(): void;
327
+ observe(): TransportedSampleProgressState;
328
+ }
329
+ export interface LocalFrameEventPort {
330
+ observe(): LocalFrameEventPortObservation;
331
+ stageTransitionOnUpdate(event: PrimitiveTransitionEvent): void;
332
+ stageTransitionOnComplete(event: PrimitiveTransitionEvent): void;
333
+ drainTransitionEvents(): readonly PrimitiveTransitionEvent[];
334
+ guardAndAdoptTransitionTerminalCandidateCacheAtMailboxPosition(event: PrimitiveTransitionEvent, mailboxPosition: number, progress: TransportedSampleProgressWriter): TransportedTerminalApplication;
335
+ guardAndAdoptLifecycleTerminalCandidateCacheAtMailboxPosition(event: MotionValueLifecycleTerminalEvent, mailboxPosition: number, progress: TransportedSampleProgressWriter): TransportedTerminalApplication;
336
+ }
337
+ /**
338
+ * Serializable local-frame event state. Native owns scheduling and mailbox allocation; CORE owns
339
+ * only the deterministic event ordering/candidate-cache transition represented by this record.
340
+ */
341
+ export interface LocalFrameEventPortState {
342
+ readonly stagedTransitionEvents: readonly PrimitiveTransitionEvent[];
343
+ readonly drainedEventSequences: readonly number[];
344
+ readonly lastGuardedMailboxPosition: number | null;
345
+ }
346
+ export interface LocalFrameEventPortObservation {
347
+ readonly stagedTransitionEventCount: number;
348
+ readonly stagedEventSequences: readonly number[];
349
+ readonly drainedEventSequences: readonly number[];
350
+ readonly lastGuardedMailboxPosition: number | null;
351
+ }
352
+ export interface CreateLocalFrameEventPortOptions {
353
+ readonly initialState?: LocalFrameEventPortState;
354
+ /** The exact value port whose cache/replay guard runs at this event's mailbox position. */
355
+ readonly candidateCacheGuard: MotionValueTerminalCandidateCacheGuard;
356
+ }
357
+ export type MotionValueDriverPortOperation = 'evaluate-binding-eligibility' | 'begin-direct-operation' | 'install-public-control-slot' | 'clear-public-control-slot-token-blind' | 'apply-transported-sample' | 'adopt-synchronous-snapshot' | 'read-cached-velocity' | 'apply-transition-terminal' | 'apply-lifecycle-terminal' | 'local-frame-stage-transition-on-update' | 'local-frame-stage-transition-on-complete' | 'local-frame-drain-transition-events' | 'local-frame-guard-transition-terminal-candidate-cache' | 'local-frame-guard-lifecycle-terminal-candidate-cache';
358
+ export declare const MOTION_VALUE_DRIVER_PORT_UNIMPLEMENTED: "NATIVE_MOTION_CORE_MOTION_VALUE_DRIVER_PORT_UNIMPLEMENTED";
359
+ export declare class MotionValueDriverPortUnimplementedError extends Error {
360
+ readonly code: "NATIVE_MOTION_CORE_MOTION_VALUE_DRIVER_PORT_UNIMPLEMENTED";
361
+ readonly operation: MotionValueDriverPortOperation;
362
+ constructor(operation: MotionValueDriverPortOperation);
363
+ }
364
+ export interface MotionValueTerminalCandidateCacheGuard {
365
+ applyTransitionTerminal(event: PrimitiveTransitionEvent, mailboxPosition: number, progress: TransportedSampleProgressWriter): TransportedTerminalApplication;
366
+ applyLifecycleTerminal(event: MotionValueLifecycleTerminalEvent, mailboxPosition: number, progress: TransportedSampleProgressWriter): TransportedTerminalApplication;
367
+ }
368
+ export interface MotionValueDriverPort<T> extends MotionValueTerminalCandidateCacheGuard {
369
+ readonly value: MotionValue<T>;
370
+ observe(): MotionValueDriverPortObservation;
371
+ evaluateBindingEligibility(currentValue: unknown): MotionValueDriverBindingEligibility;
372
+ beginDirectOperation(operation: DirectMotionValueOperation): DirectMotionValueOperationReceipt;
373
+ installPublicControlSlot(installation: MotionValuePublicControlSlotInstallation): MotionValuePublicControlSlotReceipt;
374
+ clearPublicControlSlotTokenBlind(causedByExecutionId: number): MotionValuePublicControlSlotReceipt;
375
+ applyTransportedSample(sample: TransportedMotionValueSample, progress: TransportedSampleProgressWriter): TransportedSampleApplication;
376
+ adoptSynchronousSnapshot(snapshot: PrimitiveMotionValueSnapshot): GuardedSynchronousSnapshotAdoption;
377
+ readCachedVelocity(atTimestampMs: number): number;
378
+ applyTransitionTerminal(event: PrimitiveTransitionEvent, mailboxPosition: number, progress: TransportedSampleProgressWriter): TransportedTerminalApplication;
379
+ applyLifecycleTerminal(event: MotionValueLifecycleTerminalEvent, mailboxPosition: number, progress: TransportedSampleProgressWriter): TransportedTerminalApplication;
380
+ }
381
+ export interface CreateMotionValueDriverPortOptions<T> {
382
+ readonly value: MotionValue<T>;
383
+ readonly clock: Clock;
384
+ readonly channelId: number;
385
+ readonly rawSnapshot: CollectorSilentMotionValueRawSnapshot<T>;
386
+ readonly initialState?: MotionValueDriverPortState;
387
+ /**
388
+ * Required when `initialState.publicControlSlot` is installed. The primitive state intentionally
389
+ * carries only stable ids; this non-serializable companion restores the exact stop capability.
390
+ */
391
+ readonly initialPublicControlSlotInstallation?: MotionValuePublicControlSlotInstallation;
392
+ }
393
+ /**
394
+ * The one private direct-public creation seam used by native `useMotionValue`. It returns the exact
395
+ * graph object and records immutable initializer provenance without widening the public graph API.
396
+ */
397
+ export declare function createDirectPublicMotionValue<T>(graph: MotionGraph, initial: T): MotionValue<T>;
398
+ /**
399
+ * Private mount-time routing predicate for the identity channel. It reads only the immutable
400
+ * creation brand plus the caller's collector-silent mount snapshot; behavioral eligibility remains
401
+ * owned by `MotionValueDriverPort.evaluateBindingEligibility` once the canonical port is attached.
402
+ */
403
+ export declare function isDirectPublicNumericMotionValue(value: MotionValue<unknown>, currentValue: unknown): value is MotionValue<number>;
404
+ export declare function createLocalFrameEventPort(options: CreateLocalFrameEventPortOptions): LocalFrameEventPort;
405
+ export declare function createMotionValueDriverPort<T>(options: CreateMotionValueDriverPortOptions<T>): MotionValueDriverPort<T>;
406
+ export {};