@sigx/lynx-motion 0.1.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.
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Convenience wrapper: animate(sv, target, { type: 'spring', ...opts }).
3
+ * Returns the completion promise rather than the full controls handle —
4
+ * use `animate()` directly if you need cancellation.
5
+ */
6
+
7
+ import type { SharedValue } from '@sigx/lynx';
8
+
9
+ import { animate, type SpringOptions } from './animate.js';
10
+
11
+ export function withSpring(
12
+ sv: SharedValue<number>,
13
+ target: number,
14
+ options: SpringOptions = {},
15
+ ): Promise<void> {
16
+ 'main thread';
17
+ return animate(sv, target, { ...options, type: 'spring' }).finished;
18
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Convenience wrapper: animate(sv, target, { type: 'tween', ...opts }).
3
+ * Returns the completion promise rather than the full controls handle —
4
+ * use `animate()` directly if you need cancellation.
5
+ *
6
+ * Duration is in seconds (default 0.3). Ease defaults to `easeOut`.
7
+ */
8
+
9
+ import type { SharedValue } from '@sigx/lynx';
10
+
11
+ import { animate, type TimingOptions } from './animate.js';
12
+
13
+ export function withTiming(
14
+ sv: SharedValue<number>,
15
+ target: number,
16
+ options: TimingOptions = {},
17
+ ): Promise<void> {
18
+ 'main thread';
19
+ return animate(sv, target, { ...options, type: 'tween' }).finished;
20
+ }