/** * Performs a binary search to find the index of the datum closest to the right to the given value. * @param value - The value to search for. * @param datums - The array of data to search over. It is required that the datums are sorted by the value returned by `getDatumValue`. * @param getDatumValue - Function to extract the value from a datum. * @returns The index of the closest datum to the right of the value. */ export declare function binarySearch(value: number, datums: T[], getDatumValue: (datum: T) => number): number; /** * Finds the boundaries (start and end indices) of the cluster in the datums array that contains the given index. Only the values that share the same cluster value as the datum at the given index will be considered part of the cluster. * @param index - The index to start searching from. * @param datums - The array of data. * @param getClusterValue - Function to extract the cluster value from a datum. * @returns The start and end indices of the cluster, or [-1, -1] if index is out of bounds. */ export declare function boundariesOfCluster(index: number, datums: T[], getClusterValue: (datum: T) => number): number[] | readonly [number, number]; /** * Gets the boundaries of the cluster at the position closest to the given value. * @param position - The position to search for. * @param datums - The array of data. * @param getDatumPosition - Function to extract the position from a datum. * @param getClusterValue - Function to extract the cluster value from a datum. * @returns The start and end indices of the cluster. */ export declare function getClusterBoundariesAtPosition(position: number, datums: T[], getDatumPosition: (datum: T) => number, getClusterValue: (datum: T) => number): number[] | readonly [number, number]; /** * Gets the boundaries (indices) of datums within the specified position range. * @param positionRange - The start and end positions. * @param datums - The array of data. * @param getDatumPosition - Function to extract the position from a datum. * @returns The start and end indices of the range. If the range is empty, it returns the second index as the first - 1. */ export declare function getClusterBoundariesInRange(positionRange: [number, number], datums: T[], getDatumPosition: (datum: T) => number): number[] | readonly [number, number];