/*! * @thednp/tween hooks for React v0.1.5 (https://github.com/thednp/tween) * Copyright 2026 © thednp * Licensed under MIT (https://github.com/thednp/tween/blob/master/LICENSE) */ "use strict"; import { Timeline, Tween, TweenProps } from "@thednp/tween"; //#region src/react/miniStore.d.ts /** * A hook that creates (once per component) a reactive store for the * given initial values and subscribes the component to its changes, * forcing a re-render via a version-toggle signal. * * @template T - The type of the state object * @param initialValue - The initial values object * @returns The reactive state object */ declare function useMiniStore(initialValue: T): T; //#endregion //#region src/react/index.d.ts /** * Hook for updating values with Tween. * * **NOTE**: - configuration must be wrapped in `useEffect` or `eventListener`. * This has two important aspects: never configure or start update loop in SSR * and only configure or start the loop when component is mounted in the client. * * @param initialValues - Initial tween values * @returns [store, tween] Tuple of reactive store and Tween instance * @example * const App = () => { * const [state, tween] = useTween({ x: 0, y: 0 }) * * useEffect(() => { * tween.to({ x: 100, y: 100 }).start() * }, []) * * return ( *
* ); * } */ declare const useTween: (initialValues: T) => readonly [T, Tween]; /** * Hook for sequencing values update with Timeline. * * **NOTE**: - configuration must be wrapped in `useEffect` or `eventListener`. * This has two important aspects: never configure or start update loop in SSR * and only configure or start the loop when component is mounted in the client. * * @param initialValues - Initial tween values * @returns [store, timeline] Tuple of reactive store and Timeline instance * @example * const App = () => { * const [state, timeline] = useTimeline({ x: 0, y: 0 }) * * useEffect(() => { * timeline.to({ x: 100, y: 100 }).play() * }, []) * * return ( *
* ); * } */ declare function useTimeline(initialValues: T): readonly [T, Timeline]; //#endregion export { Timeline, Tween, useMiniStore, useTimeline, useTween }; //# sourceMappingURL=react.d.mts.map