import { throttle as _throttle } from 'throttle-debounce'; import { NumericAccessor, StringAccessor, BooleanAccessor, ColorAccessor, GenericAccessor } from '../types/accessor'; import { FindNearestDirection, StackValuesRecord } from '../types/data'; import { ContinuousScale } from '../types/scale'; export declare const isNumber: (a: T) => a is T extends number ? T : never; export declare const isFunction: (a: T) => a is T extends Function ? T : never; export declare const isUndefined: (a: T) => a is T extends undefined ? T : never; export declare const isNil: (a: T) => a is null | undefined; export declare const isString: (a: T) => a is T extends string ? T : never; export declare const isArray: (a: T) => a is T extends any[] ? T : never; export declare const isObject: (a: T) => boolean; export declare const isAClassInstance: (a: T) => boolean; export declare const isPlainObject: (a: T) => boolean; export declare const isEmpty: (obj: T) => boolean; export declare const isEqual: (a: unknown | null | undefined, b: unknown | null | undefined, skipKeys?: string[], visited?: Set) => boolean; export declare const without: (arr: Array, ...args: T[]) => Array; export declare const flatten: (arr: Array) => Array; export declare const cloneDeep: (obj: T, stack?: Map) => T; export declare const merge: (obj1: T, obj2: K, visited?: Map) => T & K; export declare const omit: >(obj: T, props: Array) => Partial; export declare const groupBy: >(arr: T[], accessor: (a: T, index: number) => string | number) => Record; export declare const sortBy: (arr: Array, accessor: (a: T) => string | number) => Array; export declare const throttle: any>(f: T, delay: number, options?: { noTrailing?: boolean; noLeading?: boolean; debounceMode?: boolean; }) => _throttle; export declare function getValue(d: T, accessor: NumericAccessor | StringAccessor | BooleanAccessor | ColorAccessor | GenericAccessor, index?: number): ReturnType; export declare function getString(d: T, accessor: StringAccessor, i?: number): string | null | undefined; export declare function getNumber(d: T, accessor: NumericAccessor, i?: number): number | null | undefined; export declare function getBoolean(d: T, accessor: BooleanAccessor, i?: number): boolean | null | undefined; export declare function clean(data: T[]): T[]; export declare function clamp(d: number, min: number, max: number): number; export declare function unique(array: T[]): T[]; export declare function countUnique(array: T[], accessor?: (d: unknown) => unknown): number; export declare function arrayOfIndices(n: number): number[]; export declare function shallowDiff(o1?: Record, o2?: Record): Record; /** * Extent of the data stacked along the y direction, starting from `baseline` instead of zero. * Used for floating bars and waterfall charts, and for `Area`'s `baseline` config property. */ export declare function getStackedExtentWithBaseline(data: Datum[], baseline: NumericAccessor, ...acs: NumericAccessor[]): (number | undefined)[]; /** * Extent of the data stacked along the y direction, growing from zero. * * The baseline stays fixed at zero here so the trailing accessors can remain a rest parameter: * a `NumericAccessor` can be a bare number or null, so a positional baseline could never be told * apart from a leading accessor. Use `getStackedExtentWithBaseline` for a non-zero baseline. */ export declare function getStackedExtent(data: Datum[], ...acs: NumericAccessor[]): (number | undefined)[]; export declare function getStackedValues(d: Datum, index: number, ...acs: NumericAccessor[]): (number | undefined)[]; export declare function getStackedData(data: Datum[], baseline: NumericAccessor, acs: NumericAccessor[], prevNegative?: boolean[]): StackValuesRecord[]; export declare function getMin(data: Datum[], ...acs: NumericAccessor[]): number | undefined; export declare function getMax(data: Datum[], ...acs: NumericAccessor[]): number | undefined; export declare function getExtent(data: Datum[], ...acs: NumericAccessor[]): (number | undefined)[]; export declare function getNearest(data: Datum[], value: number, accessor: NumericAccessor, direction?: FindNearestDirection): Datum; /** Finds the datum nearest to a point in the scaled (pixel) space, considering all the provided Y accessors * (regular and stacked) so that multi-series charts pick the nearest series point. * Returns the datum, its index and the squared distance to it, or `undefined` when there's nothing to snap to */ export declare function getNearest2D(data: Datum[], point: [number, number], xScale: ContinuousScale, yScale: ContinuousScale, xAccessor: NumericAccessor, yAccessors?: NumericAccessor[], yStackedAccessors?: NumericAccessor[], baselineAccessor?: NumericAccessor): { datum: Datum; index: number; distanceSq: number; } | undefined; export declare function filterDataByRange(data: Datum[], range: [number, number], accessor: NumericAccessor, includeNeighbors?: boolean): Datum[]; export declare function isNumberWithinRange(value: number, range: [number, number]): boolean; export declare const ensureArray: (value: T | T[] | null) => T[];