import { TimelineCommandResult, TimelineReadonly, TimelineTrackGeometryOptions, TimelineTrackRect, Track } from "@techsquidtv/canvas-timeline-core"; //#region src/hooks/tracks/useTimelineTrack.d.ts /** * Result returned by `useTimelineTrack`. * * @remarks * * The result is scoped to one track row and includes both state flags and * row-level commands. It also includes `rect`, which is aligned with canvas * track geometry for DOM overlays, resize handles, and track header layouts. * * * @see {@link useTimelineTrackHeader} * @see {@link useTimelineTracks} */ interface UseTimelineTrackResult { /** Requested track id. */ trackId: string; /** Current track, or null when the id is missing. */ track: TimelineReadonly | null; /** Zero-based track index, or -1 when the track is missing. */ trackIndex: number; /** Viewport row rectangle matching canvas track geometry. */ rect: Readonly | null; /** Whether the requested track exists. */ exists: boolean; /** App-defined track kind, or null when the track is missing. */ kind: string | null; /** User-facing track name, when set. */ name: string | undefined; /** Optional track group id. */ groupId: string | undefined; /** Expanded row height in pixels, matching canvas geometry. */ height: number; /** Whether the track itself is selected. */ selected: boolean; /** Whether the track participates in active layer and media lookup. */ visible: boolean; /** Whether the track is muted. */ muted: boolean; /** Whether the track is locked for editing. */ locked: boolean; /** Whether the track is targeted for edit operations. */ targeted: boolean; /** Whether the track row is collapsed. */ collapsed: boolean; /** Selects this track. */ selectTrack: () => TimelineCommandResult; /** Renames this track, or clears its app-defined name. */ renameTrack: (name: string | undefined) => TimelineCommandResult; /** Moves this track to a final zero-based row index. */ moveTrack: (toIndex: number) => TimelineCommandResult; /** Sets this row's collapsed state. */ setCollapsed: (collapsed: boolean) => TimelineCommandResult; /** Toggles this row's collapsed state. */ toggleCollapse: () => TimelineCommandResult; /** Toggles this track's output visibility. */ toggleVisibility: () => TimelineCommandResult; /** Sets this track's output visibility. */ setVisible: (visible: boolean) => TimelineCommandResult; /** Toggles this track's muted state. */ toggleMute: () => TimelineCommandResult; /** Sets this track's muted state. */ setMuted: (muted: boolean) => TimelineCommandResult; /** Toggles this track's locked state. */ toggleLock: () => TimelineCommandResult; /** Sets this track's locked state. */ setLocked: (locked: boolean) => TimelineCommandResult; /** Sets this track's expanded display height in pixels. */ setTrackHeight: (height: number) => TimelineCommandResult; /** Toggles this track's edit-targeted state. */ toggleTrackTarget: () => TimelineCommandResult; /** Sets this track's edit-targeted state. */ setTrackTarget: (targeted: boolean) => TimelineCommandResult; /** Assigns this track to a group, or clears its group. */ setTrackGroup: (groupId: string | undefined) => TimelineCommandResult; } /** * Accesses one timeline track with canvas-aligned row geometry and commands. * * @remarks * * Use this hook when a component owns controls for one specific row: mute, * visibility, lock, targeted state, grouping, or row height. It returns safe * no-op failure commands when the track id is missing, so header components can * remain mounted while project data changes. * * @param trackId - Track id to read and update. * @param options - Optional track geometry overrides matching the renderer. * @returns Track row state, canvas-aligned geometry, and row-scoped commands. * * @example * ```tsx * import { useTimelineTrack } from '@techsquidtv/canvas-timeline-react'; * * export function TrackMuteButton({ trackId }: { trackId: string }) { * const track = useTimelineTrack(trackId); * * return ( * * ); * } * ``` * * @see {@link useTimelineTracks} * @see {@link useTimelineTrackHeader} * @see {@link https://canvastimeline.com/docs/tracks-and-clips | Tracks and clips} */ declare function useTimelineTrack(trackId: string, options?: TimelineTrackGeometryOptions): UseTimelineTrackResult; //#endregion export { UseTimelineTrackResult, useTimelineTrack }; //# sourceMappingURL=useTimelineTrack.d.mts.map