export interface ClusterNode { name: string; height: number; children?: ClusterNode[]; } export interface ClusterResult { tree: ClusterNode; order: number[]; clustersGivenK: number[][][]; } export type NumericVector = ArrayLike; /** * A progress report from a run. `current`/`total` are raw counts rather than a * preformatted percentage so callers can drive a determinate progress bar; they * are both 0 for the 'init' phase, which has no meaningful denominator and * should render as indeterminate. `message` is an unformatted phase label — it * carries no percentage, so append one from `current`/`total` if you want it. */ export interface ClusterProgress { phase: 'init' | 'distance' | 'clustering'; message: string; current: number; total: number; } export interface ClusterOptions { data: NumericVector[]; sampleLabels?: string[]; onProgress?: (progress: ClusterProgress) => void; checkCancellation?: () => void; } export interface ClusterObjectOptions { data: Record; onProgress?: (progress: ClusterProgress) => void; checkCancellation?: () => void; }