UNPKG

1.14 kBTypeScriptView Raw
1import { MutableRefObject } from 'react';
2export declare type PlayableMediaTag = {
3 play: () => void;
4 id: string;
5};
6export declare type TimelineContextValue = {
7 frame: number;
8 playing: boolean;
9 rootId: string;
10 playbackRate: number;
11 imperativePlaying: MutableRefObject<boolean>;
12 setPlaybackRate: (u: React.SetStateAction<number>) => void;
13 audioAndVideoTags: MutableRefObject<PlayableMediaTag[]>;
14};
15export declare type SetTimelineContextValue = {
16 setFrame: (u: React.SetStateAction<number>) => void;
17 setPlaying: (u: React.SetStateAction<boolean>) => void;
18};
19export declare const TimelineContext: import("react").Context<TimelineContextValue>;
20export declare const SetTimelineContext: import("react").Context<SetTimelineContextValue>;
21export declare const useTimelinePosition: () => number;
22export declare const useTimelineSetFrame: () => (u: React.SetStateAction<number>) => void;
23declare type PlayingReturnType = readonly [
24 boolean,
25 (u: React.SetStateAction<boolean>) => void,
26 MutableRefObject<boolean>
27];
28export declare const usePlayingState: () => PlayingReturnType;
29export {};