• Custom React hook that creates a vevet timeline instance.

    This hook initializes a timeline with the specified properties and sets up event callbacks for timeline events such as start, progress, and end. It provides functions to control the playback of the timeline.

    Example

    const MyComponent = () => {
    const { play, pause, reset } = useTimeline({
    easing: EaseInBounce,
    duration: 1000,
    onStart: () => console.log('Timeline started'),
    onProgress: (data) => console.log('Progress:', data),
    onEnd: () => console.log('Timeline ended'),
    });

    return (
    <div>
    <button onClick={play}>Play</button>
    <button onClick={pause}>Pause</button>
    <button onClick={reset}>Reset</button>
    </div>
    );
    };

    Parameters

    Returns {
        pause: (() => undefined | void);
        play: (() => undefined | void);
        reset: (() => undefined | void);
        reverse: (() => undefined | void);
        timeline: undefined | Timeline<IStaticProps, IChangeableProps, ICallbacksTypes>;
    }

    • pause: (() => undefined | void)
        • (): undefined | void
        • Returns undefined | void

    • play: (() => undefined | void)
        • (): undefined | void
        • Returns undefined | void

    • reset: (() => undefined | void)
        • (): undefined | void
        • Returns undefined | void

    • reverse: (() => undefined | void)
        • (): undefined | void
        • Returns undefined | void

    • timeline: undefined | Timeline<IStaticProps, IChangeableProps, ICallbacksTypes>