/** * Shared "flash this pin/region" timing driver for the `anchor.selected` bridge event. * Every canvas renderer uses this to give "Go to file" visible feedback once it's panned * the view onto the right spot. Renderer-specific visuals (color, scale, DOM class, * material) live in each canvas; this only owns the on/off timing. */ export function pulse(cycles: number, intervalMs: number, onPhase: (on: boolean) => void, onDone: () => void): void { let i = 0 const step = (): void => { onPhase(i % 2 === 0) i++ if (i < cycles * 2) setTimeout(step, intervalMs) else onDone() } step() }