UNPKG

chart-0714

Version:

Professional trading chart library with advanced customization for trading journal apps

22 lines (21 loc) 773 B
import { Candle } from '../../types'; import { UnifiedCoordinateSystem } from '../UnifiedCoordinateSystem'; export interface SnapPoint { x: number; y: number; type: 'high' | 'low' | 'open' | 'close'; price: number; time: number; index: number; } export declare class DrawingSnapManager { private isMagneticMode; private currentSnapPoint; private onSnapChange?; setMagneticMode(enabled: boolean): void; getMagneticMode(): boolean; setSnapChangeCallback(callback: (snap: SnapPoint | null) => void): void; private updateSnapPoint; findSnapPoint(mouseX: number, mouseY: number, candles: Candle[], coordSystem: UnifiedCoordinateSystem, threshold?: number): SnapPoint | null; getCurrentSnapPoint(): SnapPoint | null; }