import { Dispatch, FunctionComponent, ReactNode } from 'react'; export declare type actionType = 'show_timeline_marker' | 'show_overlay' | 'hide_overlay' | 'reshow_overlay' | 'set_variable' | 'increment_variable' | 'create_timer' | 'start_timer' | 'pause_timer' | 'adjust_timer' | 'skip_timer' | 'delete_action' | 'show_midroll'; export declare type animateinType = 'fade_in' | 'slide_from_top' | 'slide_from_bottom' | 'slide_from_left' | 'slide_from_right' | 'none'; export declare type animateoutType = 'fade_out' | 'slide_to_top' | 'slide_to_bottom' | 'slide_to_left' | 'slide_to_right' | 'none'; interface ActionCallBase { id: string; type: actionType; offset: number; } export interface OverlayPosition { bottom?: number; top?: number; vcenter?: number; left?: number; right?: number; hcenter?: number; } export declare type OverlayActionCall = ShowOverlayActionCall | HideOverlayActionCall | ReshowOverlayActionCall; export interface ShowOverlayActionCall extends ActionCallBase { type: 'show_overlay'; data: ShowOverlayActionCallData; } interface HideOverlayActionCall extends ActionCallBase { type: 'hide_overlay'; data: { custom_id: string; animateout_duration: number; animateout_type: animateoutType; }; } interface ReshowOverlayActionCall extends ActionCallBase { type: 'reshow_overlay'; data: { custom_id: string; }; } export interface ShowOverlayActionCallData { custom_id: string; svg_url?: string; position: OverlayPosition; size: { height: number; width?: number; } | { height?: number; width: number; } | { height: number; width: number; }; animatein_type?: animateinType; animateout_type?: animateoutType; animatein_duration?: number; animateout_duration?: number; duration?: number; repeat_interval?: number; opacity?: number; delay?: number; variables?: string[]; ad_data?: AdOverlayActionCallData; } export interface ShowOverlayActionCallData { custom_id: string; animateout_type?: animateoutType; animateout_duration?: number; variables?: string[]; } export interface AdOverlayActionCallData { ad_unit_path: string; ad_targeting?: Record; ad_slot_refresh_rate?: number; } export interface MarkerActionCall extends ActionCallBase { type: 'show_timeline_marker'; data: MarkerActionCallData; } export interface MarkerActionCallData { color: string; label: string; seek_offset?: number; } export interface DeleteActionCall extends ActionCallBase { type: 'delete_action'; data: DeleteActionData; } export interface DeleteActionData { action_id: string; } export interface MidrollActionCall extends ActionCallBase { type: 'show_midroll'; data: MidrollActionData; } interface MidrollActionData { tag: string; prefetch_offset?: number; } export declare type VariableActionCall = IncrementVariableActionCall | DecrementVariableActionCall; export interface IncrementVariableActionCall extends ActionCallBase { type: 'set_variable'; data: SetVariableActionData; } export interface DecrementVariableActionCall extends ActionCallBase { type: 'increment_variable'; data: { name: string; amount: number; }; } interface SetVariableActionData { name: string; type: 'double' | 'long' | 'string'; value: string | number; double_precision?: number; } export interface CreateTimerActionCall extends ActionCallBase { type: 'create_timer'; data: TimerActionCallData; } interface StartTimerActionCall extends ActionCallBase { type: 'start_timer'; data: { name: string; }; } interface PauseTimerActionCall extends ActionCallBase { type: 'pause_timer'; data: { name: string; }; } interface AdjustTimerActionCall extends ActionCallBase { type: 'adjust_timer'; data: { name: string; value: number; }; } interface SkipTimerActionCall extends ActionCallBase { type: 'skip_timer'; data: { name: string; value: number; }; } export declare type TimerActionCall = CreateTimerActionCall | StartTimerActionCall | PauseTimerActionCall | AdjustTimerActionCall | SkipTimerActionCall; interface TimerActionCallData { name: string; format?: TimeType; direction?: 'up' | 'down'; start_value?: number; step?: number; cap_value?: number; value?: number; } export declare type TimeType = 'ms' | 's'; export declare type ActionCall = OverlayActionCall | MarkerActionCall | VariableActionCall | TimerActionCall | DeleteActionCall | MidrollActionCall; export declare type AnnotationsFetcher = ({ id, }: { id: string; }) => Promise<{ data: { actions: ActionCall[]; }; errors: never; }>; export interface AnnotationsStore { timeoutId: number; currentId: string; actions: ActionCall[]; preloadedImages: { [key: string]: string; }; cancelledActions: string[]; markers: MarkerActionCall[]; overlays: OverlayActionCall[]; variables: VariableActionCall[]; timers: TimerActionCall[]; } export declare type StoreAction = { type: 'setActions'; actions: ActionCall[]; } | { type: 'dispose'; } | { type: 'preloadOverlayImage'; overlayID: string; contents: string; }; export declare const AnnotationsContext: import("react").Context<{ state: AnnotationsStore; dispatch: (_a: StoreAction) => void; }>; export declare const AnnotationsContextProvider: FunctionComponent<{ children: ReactNode; }>; export declare function useAnnotationsStore(): AnnotationsStore; export declare function useDispatch(): Dispatch; export declare function useVariables(): ActionCall[]; export declare function useTimers(): ActionCall[]; export declare function useMarkers(): MarkerActionCall[]; export declare function useOverlays(): OverlayActionCall[]; export declare function sortActionsByPriorities(a: { offset: number; type: string; }, b: { offset: number; type: string; }): number; export {};