etudes 28.2.2 → 29.0.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
+ * Easing function that produces a constant speed animation.
3
+ *
4
+ * @param t A value in the range `[0, 1]` representing the normalized time of
5
+ * the animation.
6
+ *
7
+ * @returns The eased value corresponding to `t`.
8
+ */
9
+ export declare function linear(t: number): number;
10
+ /**
11
+ * Easing function that accelerates into the middle and decelerates out of it.
12
+ *
13
+ * @param t A value in the range `[0, 1]` representing the normalized time of
14
+ * the animation.
15
+ *
16
+ * @returns The eased value corresponding to `t`.
17
+ */
18
+ export declare function easeInOut(t: number): number;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Type describing the options of {@link useAnimatedValue}.
3
+ */
4
+ export type UseAnimatedValueOptions = {
5
+ /**
6
+ * Duration of the animation in milliseconds.
7
+ */
8
+ duration: number;
9
+ /**
10
+ * Easing function mapping `t` in `[0, 1]` to an eased value. Defaults to
11
+ * linear.
12
+ */
13
+ easing?: (t: number) => number;
14
+ };
15
+ /**
16
+ * Type describing the output of {@link useAnimatedValue}.
17
+ */
18
+ export type UseAnimatedValueOutput = {
19
+ /**
20
+ * The current value (updated each animation frame).
21
+ */
22
+ value: number;
23
+ /**
24
+ * Snaps the value immediately, cancelling any in-flight animation.
25
+ */
26
+ setValue: (value: number) => void;
27
+ /**
28
+ * Animates the value from its current state to `target` over the configured
29
+ * duration, cancelling any in-flight animation.
30
+ */
31
+ animateTo: (target: number) => void;
32
+ /**
33
+ * Cancels any in-flight animation, freezing the value at its current state.
34
+ */
35
+ cancel: () => void;
36
+ };
37
+ /**
38
+ * Hook for animating a numeric value over time using `requestAnimationFrame`.
39
+ *
40
+ * @param initialValue The initial value.
41
+ * @param options See {@link UseAnimatedValueOptions}.
42
+ *
43
+ * @returns See {@link UseAnimatedValueOutput}.
44
+ */
45
+ export declare function useAnimatedValue(initialValue: number, { duration, easing, }: UseAnimatedValueOptions): UseAnimatedValueOutput;
@@ -43,7 +43,7 @@ export declare namespace PanoramaSlider {
43
43
  * used to automatically calculate the FOV if `fov` prop is not specified.
44
44
  * If it is, this prop is ignored.
45
45
  */
46
- viewportSize?: Size;
46
+ viewportSize?: Size.Size;
47
47
  } & Panorama.Props;
48
48
  /**
49
49
  * Component for the active indicator of a {@link PanoramaSlider}.