{"version":3,"file":"useTimelineState.mjs","names":[],"sources":["../../../src/hooks/core/useTimelineState.ts"],"sourcesContent":["import { useTimelineSelector } from '#react/hooks/core/useTimelineSelector';\nimport type { TimelineStateSnapshot } from '@techsquidtv/canvas-timeline-core';\n/**\n * Reads the current synchronized {@link TimelineStateSnapshot} snapshot.\n *\n * @remarks\n *\n * Use `useTimelineState` for low-frequency product chrome that needs a broad\n * view of timeline content, viewport, playback, markers, or edit feedback\n * without calling engine methods. The returned snapshot updates when\n * {@link TimelineProvider} receives engine state events.\n *\n * Prefer narrower hooks when a component only needs one live value. For example,\n * use {@link useTimelinePlayheadTime} for playback readouts and\n * {@link useTimelineViewport} for viewport controls. See\n * {@link https://canvastimeline.com/docs/react-hooks | React editor hooks} for\n * the hook selection guide.\n *\n * @returns The latest `TimelineStateSnapshot` snapshot published by `TimelineProvider`.\n *\n * @example\n * ```tsx\n * import { useTimelineState } from '@techsquidtv/canvas-timeline-react';\n *\n * export function TimelineStatus() {\n *   const state = useTimelineState();\n *\n *   return (\n *     <dl>\n *       <dt>Tracks</dt>\n *       <dd>{state.tracks.length}</dd>\n *       <dt>Playback</dt>\n *       <dd>{state.playing ? 'Playing' : 'Paused'}</dd>\n *       <dt>Zoom</dt>\n *       <dd>{state.zoomScale}px/s</dd>\n *     </dl>\n *   );\n * }\n * ```\n *\n * @see {@link TimelineStateSnapshot}\n * @see {@link TimelineProvider}\n * @see {@link useTimelinePlayheadTime}\n * @see {@link useTimelineViewport}\n */\nexport function useTimelineState(): TimelineStateSnapshot {\n  return useTimelineSelector((state) => state);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,SAAgB,mBAA0C;CACxD,OAAO,qBAAqB,UAAU,KAAK;AAC7C"}