import type { SmoothieChart } from 'smoothie'; /** * Draw a single frame of a chart, the same way the chart's own animation loop would. * * Mirrors the body of `SmoothieChart.prototype.start()`'s animate callback, including its * `nonRealtimeData` handling. Note that `chart.render()` applies the chart's stream delay * (`chart.delay`) itself, so no time argument is passed here. */ export declare function renderChartFrame(chart: SmoothieChart): void; export type RenderCoordinatorOptions = { /** * Maximum frame rate, in frames per second. `0` renders at the display refresh rate. * * Charts' own `limitFPS` options still apply on top of this. */ fps?: number; /** While `true`, charts stay registered but no frames are rendered. */ paused?: boolean; }; /** * Drives any number of SmoothieCharts from a single `requestAnimationFrame` loop. * * Charts are expected to already be bound to their canvas (i.e. `streamTo()` has set * `chart.canvas` and `chart.delay`) but not self-animating (`chart.stop()`). * * The loop only runs while at least one chart is registered, not paused, and the document * is visible; it hard-stops otherwise and resumes cleanly (no frame-rate-limit catch-up). */ export declare class RenderCoordinator { private registry; private frame?; private fps; private paused; private lastFrameTime?; private watchingVisibility; constructor(options?: RenderCoordinatorOptions); /** * Add a chart to the coordinated loop, or update its per-chart options if already added. * Starts the loop if it isn't running. */ register(chart: SmoothieChart, options?: { paused?: boolean; }): void; /** Remove a chart from the coordinated loop. Stops the loop when the last chart leaves. */ unregister(chart: SmoothieChart): void; has(chart: SmoothieChart): boolean; get size(): number; /** Cap the frame rate, or `0` to render at the display refresh rate. Applies from the next frame. */ setFps(fps: number): void; /** Freeze/unfreeze all registered charts. Registrations are kept while paused. */ setPaused(paused: boolean): void; /** Whether frames should currently be rendered */ private get active(); /** Reconcile the animation loop and visibility listener with the current state */ private sync; private handleVisibilityChange; private tick; private renderAll; } /** * The default coordinator that all charts register with when no `` overrides it. * * Exposed so the frame rate can be capped (`globalCoordinator.setFps()`) or all default-coordinated * charts paused (`globalCoordinator.setPaused()`) without wrapping the app in a provider. */ export declare const globalCoordinator: RenderCoordinator;