import type { Range } from '@zakodium/nmr-types'; import type { CSSProperties, MouseEvent, PropsWithChildren } from 'react'; import type { ExclusionZone } from '../../data/types/data1d/ExclusionZone.js'; interface BaseSource { id: string; spectrumID?: string; } interface ExclusionZoneSource { zone: ExclusionZone; spectrumID: string; } interface HighlightEventSourceMap { PEAK: BaseSource; INTEGRAL: BaseSource; SIGNAL: never; SIGNAL_1D: BaseSource & { rangeId: string; }; RANGE: BaseSource; RANGE_PEAK: BaseSource; ZONE: { id: string; }; BASELINE_ZONE: { id: string; }; PHASE_CORRECTION_TRACE: { id: string; }; EXCLUSION_ZONE: ExclusionZoneSource; MATRIX_GENERATION_EXCLUSION_ZONE: ExclusionZoneSource; MULTIPLE_ANALYSIS_ZONE: { colKey: string; }; DATABASE: { ranges: Range[]; jcampURL: string; baseURL: string; }; ATOM: never; UNKNOWN: never; } export type HighlightEventSource = { [K in keyof HighlightEventSourceMap]: HighlightEventSourceMap[K] extends never ? { type: K; extra?: never; } : { type: K; extra: HighlightEventSourceMap[K]; }; }[keyof HighlightEventSourceMap]; export type HighlightEventSourceType = keyof HighlightEventSourceMap; export type HighlightEventSourceExtra = HighlightEventSourceMap[T]; export declare function isHighlightEventSource(source: HighlightEventSource, ...types: T[]): source is Extract; type HighlightActions = 'HIDE' | 'SHOW' | 'SET_PERMANENT' | 'UNSET_PERMANENT'; interface HighlightState { highlights: Record; highlighted: string[]; highlightedPermanently: string[]; sourceData: HighlightEventSource | null; } interface HighlightPayload { convertedHighlights: string[]; id?: number | string; sourceData?: HighlightEventSource | null; } interface HighlightContextValue { highlight: HighlightState; externalHighlightedIds: ReadonlySet; dispatch: (props: { type: HighlightActions; payload?: HighlightPayload; }) => void; remove: () => void; } export declare function HighlightProvider(props: PropsWithChildren<{ highlightedIds?: readonly string[]; }>): import("react").JSX.Element; export declare function useHighlightData(): HighlightContextValue; /** * @param highlights * @param sourceData */ export declare function useHighlight(highlights: Array, sourceData?: HighlightEventSource | null): { isActive: boolean; defaultActiveStyle: CSSProperties; onHover: { onMouseEnter: () => void; onMouseLeave: () => void; }; onClick: (e: MouseEvent) => void; show: () => void; hide: () => void; isActivePermanently: boolean; click: (e: MouseEvent) => void; add: (id: number | string) => void; remove: (id: number | string) => void; }; export {}; //# sourceMappingURL=index.d.ts.map