/** * D3 Array Polyfill - Lightweight array utility functions. * * This is a drop-in replacement for d3-array, implementing only the methods * used in the Vega chart rendering system: min, max, extent, and map. * * @see VD-5022 - [Zero Dependencies] remove d3 dependency */ /** * Returns the minimum value in the array. * Mimics d3.min(). * * @template T * @param {T[]} array - Array of values. * @param {Function} [accessor] - Optional accessor function. * @returns {number | undefined} The minimum value, or undefined for empty arrays. */ export declare function min(array: T[], accessor?: (d: T, i: number) => number): number | undefined; /** * Returns the maximum value in the array. * Mimics d3.max(). * * @template T * @param {T[]} array - Array of values. * @param {Function} [accessor] - Optional accessor function. * @returns {number | undefined} The maximum value, or undefined for empty arrays. */ export declare function max(array: T[], accessor?: (d: T, i: number) => number): number | undefined; /** * Returns the [min, max] of the array. * Mimics d3.extent(). * * @template T * @param {T[]} array - Array of values. * @returns {[T, T] | [undefined, undefined]} Tuple of [min, max], or [undefined, undefined] for empty arrays. */ export declare function extent(array: T[]): [T, T] | [undefined, undefined]; /** * Maps each element of the array through a transform function. * Mimics d3.map() (the array mapping function from d3-array, not the Map collection). * * @template T * @template U * @param {T[]} array - Input array. * @param {Function} mapper - Transform function called with (element, index). * @returns {U[]} New array of transformed values. */ export declare function map(array: T[], mapper: (d: T, i: number) => U): U[];