@ghia/native 0.0.0-stage → 0.11.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 (212) hide show
  1. package/LICENSE +201 -0
  2. package/browser.mjs +7 -0
  3. package/dist/aria.d.ts +72 -0
  4. package/dist/aria.d.ts.map +1 -0
  5. package/dist/aria.js +2 -0
  6. package/dist/aria.js.map +1 -0
  7. package/dist/automation/client.d.ts +243 -0
  8. package/dist/automation/client.d.ts.map +1 -0
  9. package/dist/automation/client.js +801 -0
  10. package/dist/automation/client.js.map +1 -0
  11. package/dist/automation/index.d.ts +5 -0
  12. package/dist/automation/index.d.ts.map +1 -0
  13. package/dist/automation/index.js +4 -0
  14. package/dist/automation/index.js.map +1 -0
  15. package/dist/automation/protocol.d.ts +309 -0
  16. package/dist/automation/protocol.d.ts.map +1 -0
  17. package/dist/automation/protocol.js +320 -0
  18. package/dist/automation/protocol.js.map +1 -0
  19. package/dist/blob-images.d.ts +32 -0
  20. package/dist/blob-images.d.ts.map +1 -0
  21. package/dist/blob-images.js +55 -0
  22. package/dist/blob-images.js.map +1 -0
  23. package/dist/bounds.d.ts +61 -0
  24. package/dist/bounds.d.ts.map +1 -0
  25. package/dist/bounds.js +85 -0
  26. package/dist/bounds.js.map +1 -0
  27. package/dist/clipboard-global.d.ts +11 -0
  28. package/dist/clipboard-global.d.ts.map +1 -0
  29. package/dist/clipboard-global.js +2 -0
  30. package/dist/clipboard-global.js.map +1 -0
  31. package/dist/clipboard.d.ts +19 -0
  32. package/dist/clipboard.d.ts.map +1 -0
  33. package/dist/clipboard.js +41 -0
  34. package/dist/clipboard.js.map +1 -0
  35. package/dist/cpu-throttle.d.ts +6 -0
  36. package/dist/cpu-throttle.d.ts.map +1 -0
  37. package/dist/cpu-throttle.js +42 -0
  38. package/dist/cpu-throttle.js.map +1 -0
  39. package/dist/events/data-transfer.d.ts +23 -0
  40. package/dist/events/data-transfer.d.ts.map +1 -0
  41. package/dist/events/data-transfer.js +97 -0
  42. package/dist/events/data-transfer.js.map +1 -0
  43. package/dist/events/dispatch.d.ts +144 -0
  44. package/dist/events/dispatch.d.ts.map +1 -0
  45. package/dist/events/dispatch.js +241 -0
  46. package/dist/events/dispatch.js.map +1 -0
  47. package/dist/events/drag.d.ts +21 -0
  48. package/dist/events/drag.d.ts.map +1 -0
  49. package/dist/events/drag.js +111 -0
  50. package/dist/events/drag.js.map +1 -0
  51. package/dist/events/event-props.d.ts +19 -0
  52. package/dist/events/event-props.d.ts.map +1 -0
  53. package/dist/events/event-props.js +104 -0
  54. package/dist/events/event-props.js.map +1 -0
  55. package/dist/events/keyboard-defaults.d.ts +18 -0
  56. package/dist/events/keyboard-defaults.d.ts.map +1 -0
  57. package/dist/events/keyboard-defaults.js +121 -0
  58. package/dist/events/keyboard-defaults.js.map +1 -0
  59. package/dist/events/listeners.d.ts +18 -0
  60. package/dist/events/listeners.d.ts.map +1 -0
  61. package/dist/events/listeners.js +49 -0
  62. package/dist/events/listeners.js.map +1 -0
  63. package/dist/events/route.d.ts +17 -0
  64. package/dist/events/route.d.ts.map +1 -0
  65. package/dist/events/route.js +36 -0
  66. package/dist/events/route.js.map +1 -0
  67. package/dist/events/types.d.ts +269 -0
  68. package/dist/events/types.d.ts.map +1 -0
  69. package/dist/events/types.js +2 -0
  70. package/dist/events/types.js.map +1 -0
  71. package/dist/events/window-target.d.ts +120 -0
  72. package/dist/events/window-target.d.ts.map +1 -0
  73. package/dist/events/window-target.js +311 -0
  74. package/dist/events/window-target.js.map +1 -0
  75. package/dist/eyedropper.d.ts +33 -0
  76. package/dist/eyedropper.d.ts.map +1 -0
  77. package/dist/eyedropper.js +66 -0
  78. package/dist/eyedropper.js.map +1 -0
  79. package/dist/focus.d.ts +18 -0
  80. package/dist/focus.d.ts.map +1 -0
  81. package/dist/focus.js +26 -0
  82. package/dist/focus.js.map +1 -0
  83. package/dist/fonts.d.ts +12 -0
  84. package/dist/fonts.d.ts.map +1 -0
  85. package/dist/fonts.js +17 -0
  86. package/dist/fonts.js.map +1 -0
  87. package/dist/forms.d.ts +10 -0
  88. package/dist/forms.d.ts.map +1 -0
  89. package/dist/forms.js +9 -0
  90. package/dist/forms.js.map +1 -0
  91. package/dist/host-runtime.d.ts +108 -0
  92. package/dist/host-runtime.d.ts.map +1 -0
  93. package/dist/host-runtime.js +213 -0
  94. package/dist/host-runtime.js.map +1 -0
  95. package/dist/host.d.ts +2403 -0
  96. package/dist/host.d.ts.map +1 -0
  97. package/dist/host.js +30 -0
  98. package/dist/host.js.map +1 -0
  99. package/dist/idle-gc.d.ts +36 -0
  100. package/dist/idle-gc.d.ts.map +1 -0
  101. package/dist/idle-gc.js +70 -0
  102. package/dist/idle-gc.js.map +1 -0
  103. package/dist/keyframes.d.ts +108 -0
  104. package/dist/keyframes.d.ts.map +1 -0
  105. package/dist/keyframes.js +107 -0
  106. package/dist/keyframes.js.map +1 -0
  107. package/dist/layout-animation.d.ts +38 -0
  108. package/dist/layout-animation.d.ts.map +1 -0
  109. package/dist/layout-animation.js +41 -0
  110. package/dist/layout-animation.js.map +1 -0
  111. package/dist/match-media.d.ts +62 -0
  112. package/dist/match-media.d.ts.map +1 -0
  113. package/dist/match-media.js +272 -0
  114. package/dist/match-media.js.map +1 -0
  115. package/dist/media-query.d.ts +21 -0
  116. package/dist/media-query.d.ts.map +1 -0
  117. package/dist/media-query.js +599 -0
  118. package/dist/media-query.js.map +1 -0
  119. package/dist/motion-bindings.d.ts +36 -0
  120. package/dist/motion-bindings.d.ts.map +1 -0
  121. package/dist/motion-bindings.js +107 -0
  122. package/dist/motion-bindings.js.map +1 -0
  123. package/dist/motion-config.d.ts +20 -0
  124. package/dist/motion-config.d.ts.map +1 -0
  125. package/dist/motion-config.js +51 -0
  126. package/dist/motion-config.js.map +1 -0
  127. package/dist/motion-span.d.ts +57 -0
  128. package/dist/motion-span.d.ts.map +1 -0
  129. package/dist/motion-span.js +150 -0
  130. package/dist/motion-span.js.map +1 -0
  131. package/dist/motion-value.d.ts +269 -0
  132. package/dist/motion-value.d.ts.map +1 -0
  133. package/dist/motion-value.js +941 -0
  134. package/dist/motion-value.js.map +1 -0
  135. package/dist/motion-variants.d.ts +190 -0
  136. package/dist/motion-variants.d.ts.map +1 -0
  137. package/dist/motion-variants.js +249 -0
  138. package/dist/motion-variants.js.map +1 -0
  139. package/dist/mutations.d.ts +65 -0
  140. package/dist/mutations.d.ts.map +1 -0
  141. package/dist/mutations.js +320 -0
  142. package/dist/mutations.js.map +1 -0
  143. package/dist/nativeview.d.ts +10 -0
  144. package/dist/nativeview.d.ts.map +1 -0
  145. package/dist/nativeview.js +92 -0
  146. package/dist/nativeview.js.map +1 -0
  147. package/dist/observers.d.ts +92 -0
  148. package/dist/observers.d.ts.map +1 -0
  149. package/dist/observers.js +579 -0
  150. package/dist/observers.js.map +1 -0
  151. package/dist/presence.d.ts +63 -0
  152. package/dist/presence.d.ts.map +1 -0
  153. package/dist/presence.js +54 -0
  154. package/dist/presence.js.map +1 -0
  155. package/dist/renderer-state.d.ts +155 -0
  156. package/dist/renderer-state.d.ts.map +1 -0
  157. package/dist/renderer-state.js +302 -0
  158. package/dist/renderer-state.js.map +1 -0
  159. package/dist/reorder.d.ts +63 -0
  160. package/dist/reorder.d.ts.map +1 -0
  161. package/dist/reorder.js +303 -0
  162. package/dist/reorder.js.map +1 -0
  163. package/dist/runtime.d.ts +23 -0
  164. package/dist/runtime.d.ts.map +1 -0
  165. package/dist/runtime.js +157 -0
  166. package/dist/runtime.js.map +1 -0
  167. package/dist/screen.d.ts +8 -0
  168. package/dist/screen.d.ts.map +1 -0
  169. package/dist/screen.js +16 -0
  170. package/dist/screen.js.map +1 -0
  171. package/dist/scroll.d.ts +79 -0
  172. package/dist/scroll.d.ts.map +1 -0
  173. package/dist/scroll.js +170 -0
  174. package/dist/scroll.js.map +1 -0
  175. package/dist/style-images.d.ts +20 -0
  176. package/dist/style-images.d.ts.map +1 -0
  177. package/dist/style-images.js +57 -0
  178. package/dist/style-images.js.map +1 -0
  179. package/dist/svg.d.ts +16 -0
  180. package/dist/svg.d.ts.map +1 -0
  181. package/dist/svg.js +119 -0
  182. package/dist/svg.js.map +1 -0
  183. package/dist/testing.d.ts +811 -0
  184. package/dist/testing.d.ts.map +1 -0
  185. package/dist/testing.js +1187 -0
  186. package/dist/testing.js.map +1 -0
  187. package/dist/text-match.d.ts +8 -0
  188. package/dist/text-match.d.ts.map +1 -0
  189. package/dist/text-match.js +10 -0
  190. package/dist/text-match.js.map +1 -0
  191. package/dist/text-selection.d.ts +34 -0
  192. package/dist/text-selection.d.ts.map +1 -0
  193. package/dist/text-selection.js +23 -0
  194. package/dist/text-selection.js.map +1 -0
  195. package/dist/universal-style.d.ts +22 -0
  196. package/dist/universal-style.d.ts.map +1 -0
  197. package/dist/universal-style.js +58 -0
  198. package/dist/universal-style.js.map +1 -0
  199. package/dist/web-animations.d.ts +300 -0
  200. package/dist/web-animations.d.ts.map +1 -0
  201. package/dist/web-animations.js +1032 -0
  202. package/dist/web-animations.js.map +1 -0
  203. package/dist/webview.d.ts +39 -0
  204. package/dist/webview.d.ts.map +1 -0
  205. package/dist/webview.js +26 -0
  206. package/dist/webview.js.map +1 -0
  207. package/gpuix-native.darwin-arm64.node +4 -0
  208. package/index.cjs +789 -0
  209. package/index.d.ts +2603 -0
  210. package/index.js +729 -0
  211. package/package.json +94 -3
  212. package/README.md +0 -3
@@ -0,0 +1,269 @@
1
+ import type { BoxShadow, MotionCurve, MotionEase, MotionKeyframes, MotionSpringDurationTransition, MotionSpringPhysicsTransition, MotionTransition, SvgMotionTransition, MotionValueHost, NativeRenderer } from "./host.js";
2
+ /** A renderer that owns a motion value graph. */
3
+ export type MotionValueRenderer = NativeRenderer & MotionValueHost;
4
+ /**
5
+ * What a motion value can hold: a number, a colour string, a CSS length string
6
+ * (`"50%"`, `"2em"`, `"calc(100% - 20px)"`), a multi-value string of those
7
+ * (`"0.5em 0.75em"`, `"10px / 20px"`, `"red blue"`), a list of numbers, a
8
+ * `fontVariationSettings` string, a CSS angle (`"45deg"`, `"0.25turn"`, `"1rad"`, `"100grad"`), a CSS transform list
9
+ * (`"translateX(10px) rotate(45deg)"`, `"none"`), or box shadows. Lengths of different units animate as the two parts of
10
+ * a `calc()`, and a multi-value string animates component by component. Bound to a shorthand
11
+ * (`padding`, `margin`, `inset`, `gap`, `borderWidth`, `borderColor`,
12
+ * `borderRadius`) it gives each side, axis or corner its own component, and
13
+ * `get()` reads it back as px, percentages and `calc()`s, colours as `rgba()`.
14
+ *
15
+ * An angle drives the angle keys (`rotate`, `rotateX`, `rotateY`, `rotateZ`, `skew`, `skewX`, `skewY`) like a number of degrees and is held in
16
+ * degrees: `"0.5turn"` reads back as `"180deg"`. A number and an angle mix in degrees, so `0` animated to `"1turn"`
17
+ * passes `"180deg"` halfway (Motion mixes them to `NaN`). Bound to another key, an angle is skipped. A transform list
18
+ * bound to `transform` is the list of a motion component, and Motion's other transform keys beside it are ignored; two
19
+ * lists blend as a CSS transition does.
20
+ */
21
+ export type MotionData = number | string | number[] | BoxShadow | BoxShadow[];
22
+ /** `motionValue(0)` is a `MotionValue<number>`, not a `MotionValue<0>`. */
23
+ export type Widen<Data> = Data extends number ? number : Data extends string ? string : Data;
24
+ /** A spring transition without its `type`. */
25
+ export type MotionSpringConfig = Omit<MotionSpringPhysicsTransition, "type"> | Omit<MotionSpringDurationTransition, "type">;
26
+ export type MotionTransformOptions = {
27
+ /** Hold the output at its ends outside the input range. Defaults to true. */
28
+ clamp?: boolean;
29
+ /** One easing for every segment, or one per segment. */
30
+ ease?: MotionEase | MotionEase[];
31
+ };
32
+ export type MotionValueEvents<Data extends MotionData> = {
33
+ /**
34
+ * The value changed. For a bound value this arrives with the frame that
35
+ * sampled the change, not inside the call that made it.
36
+ */
37
+ change: (value: Data) => void;
38
+ animationStart: () => void;
39
+ animationComplete: () => void;
40
+ };
41
+ export type AnimationPlaybackState = "idle" | "running" | "paused" | "finished";
42
+ /**
43
+ * What `animate` returns for a value, as Motion's `animate` does. Times are in seconds.
44
+ *
45
+ * Calls made before the value is bound to a renderer, when the animation has not started,
46
+ * apply when it does. Once the animation is stopped, cancelled or replaced by another one, its
47
+ * controls do nothing and read as they were, with state `"idle"`.
48
+ */
49
+ export interface AnimationPlaybackControls {
50
+ /**
51
+ * Seconds since the animation began, the delay not counted in what it reads: it is 0 during the
52
+ * delay. Assigning it seeks, and the assigned time counts the delay, so seeking to 0.4 in an
53
+ * animation delayed by 0.5 is still inside the delay. It is not held at the end: an animation
54
+ * that finished keeps the time of the frame that found it done, and a seek past the end reads
55
+ * back as set. A running animation goes on from there, a held one stays, a finished one is
56
+ * held there and is not finished again.
57
+ */
58
+ time: number;
59
+ /**
60
+ * The pace: 2 is twice as fast, negative runs backwards to the first keyframe. 0 holds the
61
+ * animation, which stays `"running"`, and it stays held at any other speed until `play()`.
62
+ */
63
+ speed: number;
64
+ /**
65
+ * One iteration, without the delay or the repeats. A spring lasts until it is at rest,
66
+ * `Infinity` if that takes more than 20 seconds.
67
+ */
68
+ readonly duration: number;
69
+ /** `duration` and the delay. */
70
+ readonly iterationDuration: number;
71
+ /**
72
+ * Where the animation's clock started, in milliseconds on the renderer's clock since its origin
73
+ * (the `nowMs` of the test renderer's `clock*` calls): Motion's absolute base is
74
+ * `performance.now()`, so only differences between two times are comparable. It moves where
75
+ * Motion moves it: `play()`, a `time` set while running, a change of `speed`. `null` before the
76
+ * value is bound, once the animation finished, and after `stop()` and `cancel()`.
77
+ */
78
+ readonly startTime: number | null;
79
+ /**
80
+ * `"running"` from the start, the delay included and at speed 0; `"paused"` after `pause()`;
81
+ * `"finished"` at the end and after `complete()`; `"idle"` after `stop()` and `cancel()`, and
82
+ * once another animation replaced this one.
83
+ */
84
+ readonly state: AnimationPlaybackState;
85
+ /** Ends the animation where it is, for good. `finished` stays pending. */
86
+ stop(): void;
87
+ /**
88
+ * Ends the animation and puts the value back on its first keyframe, or leaves it on the last
89
+ * if the animation had finished. `finished` stays pending until `play()` runs it again.
90
+ */
91
+ cancel(): void;
92
+ /** Jumps to the end and finishes: `finished` resolves. */
93
+ complete(): void;
94
+ /**
95
+ * Continues from where `pause()` held the animation. A finished animation starts again, from
96
+ * its end if the speed is negative, and `finished` is a new promise. After `cancel()` it starts
97
+ * again from the first keyframe, at the speed it had; after `stop()` it does nothing.
98
+ */
99
+ play(): void;
100
+ /** Holds the value and the time. The value keeps `isAnimating()` and its velocity is 0. */
101
+ pause(): void;
102
+ /**
103
+ * Hands the animation's clock to a timeline, as Motion's `scroll()` does: the frame loop stops
104
+ * driving the animation (it stays `"running"` unless the timeline pauses it), and
105
+ * `timeline.observe(controls)` gets the controls to set `time` on. What `observe` returns is
106
+ * called when the animation is stopped, or the value is stopped, jumped or animated again.
107
+ * Attached before the value is bound, it is observed when the animation starts. `play()` gives
108
+ * the clock back. Returns a function that stops the animation.
109
+ */
110
+ attachTimeline(timeline: AnimationTimeline): () => void;
111
+ }
112
+ /** What `attachTimeline` takes: Motion's `{ observe }`. */
113
+ export interface AnimationTimeline {
114
+ observe(animation: AnimationPlaybackControlsWithThen): () => void;
115
+ }
116
+ export interface AnimationPlaybackControlsWithThen extends AnimationPlaybackControls, PromiseLike<void> {
117
+ /**
118
+ * Resolves when the animation finishes by itself or `complete()` ends it. It never rejects, and
119
+ * a stopped, cancelled or replaced animation leaves it pending.
120
+ */
121
+ readonly finished: Promise<void>;
122
+ }
123
+ /**
124
+ * What `animate` takes for a value: one target, or keyframes. A `null` stands
125
+ * for the keyframe before it, or for the value's own value when it comes
126
+ * first. An array is keyframes unless it is itself a value of the kind the
127
+ * source holds: a `number[]` target of a list-of-numbers value, or a
128
+ * `BoxShadow[]` target of a shadow value. Keyframes of those kinds are lists of
129
+ * lists.
130
+ */
131
+ export type MotionTarget<Data extends MotionData> = MotionKeyframes<Data>;
132
+ export type NumberAnimationOptions = {
133
+ /** The renderer that samples the animation. */
134
+ host: MotionValueRenderer;
135
+ onUpdate?: (value: number) => void;
136
+ };
137
+ /**
138
+ * JSON has no `Infinity`, so an infinite repeat goes to the renderer as the
139
+ * string it accepts. The motion components send their transitions the same way.
140
+ */
141
+ export declare function wireTransition(transition: MotionCurve): MotionCurve;
142
+ export declare function wireTransition(transition: MotionCurve | undefined): MotionCurve | undefined;
143
+ /**
144
+ * `wireTransition` for what a `motion.*` component takes: the repeat of the
145
+ * curve at the top, of `default`, and of each property's own.
146
+ */
147
+ export declare function wireMotionTransition<Transition extends MotionTransition | SvgMotionTransition>(transition: Transition | undefined): Transition | undefined;
148
+ /** Finds how long an animation lasts without a renderer. The native addon's `measureMotionAnimation`. */
149
+ export type AnimationMeasurer = (from: MotionData, target: MotionTarget<MotionData>, transition: MotionCurve | undefined) => {
150
+ duration: number;
151
+ iterationDuration: number;
152
+ };
153
+ /** Called by the entry points that load the native addon, as `registerKeyframesValidator` is. */
154
+ export declare function registerAnimationMeasurer(measure: AnimationMeasurer): void;
155
+ type ComputedTrigger = "change" | "animationComplete";
156
+ type Definition = {
157
+ kind: "source";
158
+ } | {
159
+ kind: "spring";
160
+ config: MotionSpringConfig;
161
+ } | {
162
+ kind: "transform";
163
+ input: MotionValue<number>;
164
+ inputRange: number[];
165
+ outputRange: MotionData[];
166
+ options?: MotionTransformOptions;
167
+ } | {
168
+ kind: "follower";
169
+ source: MotionValue<MotionData>;
170
+ config: MotionSpringConfig;
171
+ } | {
172
+ kind: "computed";
173
+ compute: () => MotionData;
174
+ triggers: ComputedTrigger[];
175
+ };
176
+ type ListenerKind = "change" | "animationStart" | "animationComplete";
177
+ export declare class MotionValue<Data extends MotionData = MotionData> {
178
+ #private;
179
+ readonly id: number;
180
+ /** Use `motionValue`, `transformValue`, `springValue`, `computedValue` or `velocityValue`. */
181
+ constructor(definition: Definition, initial?: Data);
182
+ /** The renderer this value is bound to, if any. */
183
+ get host(): MotionValueRenderer | undefined;
184
+ /**
185
+ * The current value. Bound, it is read from the renderer at its clock. A
186
+ * transform and a spring follower have no state of their own, so they can
187
+ * only be read while bound.
188
+ */
189
+ get(): Data;
190
+ /**
191
+ * Writes the value. It does not stop a running animation: call `stop()`
192
+ * first to take the value from the animation. On a spring it moves the
193
+ * target.
194
+ */
195
+ set(value: Data): void;
196
+ /** Writes the value, ending any animation and dropping its velocity. */
197
+ jump(value: Data): void;
198
+ /** Units per second, for a value that holds a number. A value that is not bound has none. */
199
+ getVelocity(): number;
200
+ /** Whether an animation drives the value: it stays true after the controls' `stop()` and `cancel()`. */
201
+ isAnimating(): boolean;
202
+ /** Ends an animation where it is, keeping the speed for the next one. */
203
+ stop(): void;
204
+ /**
205
+ * Animates from where the value is, with the speed it has. Before the value
206
+ * is bound the animation waits, and starts from the value at that point.
207
+ * Only a `motionValue()` animates: a spring is moved with `set()`. The controls
208
+ * it returns have the names and semantics of Motion's.
209
+ */
210
+ animate(target: MotionTarget<Data>, transition?: MotionCurve): AnimationPlaybackControlsWithThen;
211
+ /**
212
+ * Makes `animate()` jump to its target, finishing on the next frame as a
213
+ * zero-length animation does, for as long as the returned release is not
214
+ * called. The adapters call it for a value that a reduced-motion
215
+ * `motion.*` element binds to `width`, `height` or an inset.
216
+ */
217
+ reduceMotion(): () => void;
218
+ on<Event extends ListenerKind>(event: Event, callback: MotionValueEvents<Data>[Event]): () => void;
219
+ /**
220
+ * Binds the value to a renderer, creating its native node on the first
221
+ * bind. Returns the release. The node goes when every binding is released
222
+ * and no listener is left; the value keeps its state in JS.
223
+ */
224
+ bind(renderer: NativeRenderer): () => void;
225
+ /**
226
+ * Drops the value: its node is disposed whatever still binds it, its
227
+ * listeners are removed and any animation ends. Every later call throws.
228
+ */
229
+ destroy(): void;
230
+ }
231
+ /** A value that is written with `set` and `jump` or animated. */
232
+ export declare function motionValue<Data extends MotionData>(initial: Data): MotionValue<Widen<Data>>;
233
+ export declare function isMotionValue(value: unknown): value is MotionValue;
234
+ /**
235
+ * Maps a number value through `inputRange` and `outputRange`, natively: it is
236
+ * sampled at the same instant as its input. The input range is ascending or
237
+ * descending and may repeat a value, which is a step. The output holds
238
+ * numbers, colours or shadows. A bad range is reported when the value is bound.
239
+ */
240
+ export declare function transformValue<Data extends MotionData>(input: MotionValue<number>, inputRange: number[], outputRange: Data[], options?: MotionTransformOptions): MotionValue<Widen<Data>>;
241
+ /**
242
+ * A spring that follows `source`, or, given a plain value, a spring with a
243
+ * target of its own that `set` moves.
244
+ */
245
+ export declare function springValue<Data extends MotionData>(source: MotionValue<Data>, config?: MotionSpringConfig): MotionValue<Data>;
246
+ export declare function springValue<Data extends MotionData>(initial: Data, config?: MotionSpringConfig): MotionValue<Widen<Data>>;
247
+ /**
248
+ * A value computed in JS from the motion values `compute` reads with `get()`.
249
+ * It is not native-linked: it follows their change events and writes a source,
250
+ * so it trails them by a frame, and it only updates while it is bound.
251
+ * Unbound, `get()` runs `compute`.
252
+ */
253
+ export declare function computedValue<Data extends MotionData>(compute: () => Data): MotionValue<Widen<Data>>;
254
+ /**
255
+ * The velocity of a number value, in units per second. Like `computedValue`
256
+ * it is JS-derived and not native-linked: it reads `getVelocity()` of the
257
+ * source on each of its changes, and again when its animation completes.
258
+ */
259
+ export declare function velocityValue(source: MotionValue<number>): MotionValue<number>;
260
+ /** Animates `value`. Returns the controls of the animation; `finished` resolves when it finishes. */
261
+ export declare function animate<Data extends MotionData>(value: MotionValue<Data>, target: MotionTarget<Data>, transition?: MotionCurve): AnimationPlaybackControlsWithThen;
262
+ /**
263
+ * Animates a number on `options.host`, reporting each frame to `onUpdate`.
264
+ * The temporary value is destroyed when the animation ends in any way, so the
265
+ * controls do nothing after that.
266
+ */
267
+ export declare function animate(from: number, to: MotionTarget<number>, options: MotionCurve & NumberAnimationOptions): AnimationPlaybackControlsWithThen;
268
+ export {};
269
+ //# sourceMappingURL=motion-value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion-value.d.ts","sourceRoot":"","sources":["../js/motion-value.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,eAAe,EACf,8BAA8B,EAC9B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