@types/d3-array
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for D3JS d3-array module 2.2 | ||
// Type definitions for D3JS d3-array module 2.3 | ||
// Project: https://github.com/d3/d3-array, https://d3js.org/d3-array | ||
@@ -12,3 +12,3 @@ // Definitions by: Alex Ford <https://github.com/gustavderdrache> | ||
// Last module patch version validated against: 2.2.0 | ||
// Last module patch version validated against: 2.3.3 | ||
@@ -38,3 +38,3 @@ // -------------------------------------------------------------------------- | ||
*/ | ||
export function min(array: Iterable<string>): string | undefined; | ||
export function min(iterable: Iterable<string>): string | undefined; | ||
@@ -44,13 +44,17 @@ /** | ||
*/ | ||
export function min<T extends Numeric>(array: Iterable<T>): T | undefined; | ||
export function min<T extends Numeric>(iterable: Iterable<T>): T | undefined; | ||
/** | ||
* Return the minimum value in the array using natural order. | ||
*/ | ||
export function min<T>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => string | undefined | null): string | undefined; | ||
export function min<T>( | ||
iterable: Iterable<T>, | ||
accessor: (datum: T, index: number, array: Iterable<T>) => string | undefined | null | ||
): string | undefined; | ||
/** | ||
* Return the minimum value in the array using natural order. | ||
*/ | ||
export function min<T, U extends Numeric>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => U | undefined | null): U | undefined; | ||
export function min<T, U extends Numeric>( | ||
iterable: Iterable<T>, | ||
accessor: (datum: T, index: number, array: Iterable<T>) => U | undefined | null | ||
): U | undefined; | ||
@@ -60,32 +64,37 @@ /** | ||
*/ | ||
export function minIndex<T>(array: Iterable<T>): number ; | ||
export function minIndex<T>(iterable: Iterable<T>): number; | ||
/** | ||
* Return the index of the minimum value in the array using natural order and a projection function to map values. | ||
*/ | ||
export function minIndex<TDatum, U>(array: Iterable<TDatum>, accessor: (datum: TDatum, index: number, array: Iterable<TDatum>) => U | undefined | null): number ; | ||
export function minIndex<TDatum, U>( | ||
iterable: Iterable<TDatum>, | ||
accessor: (datum: TDatum, index: number, array: Iterable<TDatum>) => U | undefined | null | ||
): number; | ||
/** | ||
* Return the index of the minimum value in the array using natural order. | ||
*/ | ||
export function minIndex<T>(array: Iterable<T>): number ; | ||
export function minIndex<T>(iterable: Iterable<T>): number; | ||
/** | ||
* Return the maximum value in the array of strings using natural order. | ||
*/ | ||
export function max(array: Iterable<string>): string | undefined; | ||
export function max(iterable: Iterable<string>): string | undefined; | ||
/** | ||
* Return the maximum value in the array of numbers using natural order. | ||
*/ | ||
export function max<T extends Numeric>(array: Iterable<T>): T | undefined; | ||
export function max<T extends Numeric>(iterable: Iterable<T>): T | undefined; | ||
/** | ||
* Return the maximum value in the array using natural order and a projection function to map values to strings. | ||
*/ | ||
export function max<T>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => string | undefined | null): string | undefined; | ||
export function max<T>( | ||
iterable: Iterable<T>, | ||
accessor: (datum: T, index: number, array: Iterable<T>) => string | undefined | null | ||
): string | undefined; | ||
/** | ||
* Return the maximum value in the array using natural order and a projection function to map values to easily-sorted values. | ||
*/ | ||
export function max<T, U extends Numeric>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => U | undefined | null): U | undefined; | ||
export function max<T, U extends Numeric>( | ||
iterable: Iterable<T>, | ||
accessor: (datum: T, index: number, array: Iterable<T>) => U | undefined | null | ||
): U | undefined; | ||
@@ -95,8 +104,10 @@ /** | ||
*/ | ||
export function maxIndex<T>(array: Iterable<T>): number ; | ||
export function maxIndex<T>(iterable: Iterable<T>): number; | ||
/** | ||
* Return the index of the maximum value in the array using natural order and a projection function to map values. | ||
*/ | ||
export function maxIndex<TDatum, U>(array: Iterable<TDatum>, accessor: (datum: TDatum, index: number, array: Iterable<TDatum>) => U | undefined | null): number ; | ||
export function maxIndex<TDatum, U>( | ||
iterable: Iterable<TDatum>, | ||
accessor: (datum: TDatum, index: number, array: Iterable<TDatum>) => U | undefined | null | ||
): number; | ||
@@ -106,23 +117,33 @@ /** | ||
*/ | ||
export function extent(array: Iterable<string>): [string, string] | [undefined, undefined]; | ||
export function extent(iterable: Iterable<string>): [string, string] | [undefined, undefined]; | ||
/** | ||
* Return the min and max simultaneously. | ||
*/ | ||
export function extent<T extends Numeric>(array: Iterable<T>): [T, T] | [undefined, undefined]; | ||
export function extent<T extends Numeric>(iterable: Iterable<T>): [T, T] | [undefined, undefined]; | ||
/** | ||
* Return the min and max simultaneously. | ||
*/ | ||
export function extent<T>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => string | undefined | null): [string, string] | [undefined, undefined]; | ||
export function extent<T>( | ||
iterable: Iterable<T>, | ||
accessor: (datum: T, index: number, array: Iterable<T>) => string | undefined | null | ||
): [string, string] | [undefined, undefined]; | ||
/** | ||
* Return the min and max simultaneously. | ||
*/ | ||
export function extent<T, U extends Numeric>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => U | undefined | null): [U, U] | [undefined, undefined]; | ||
export function extent<T, U extends Numeric>( | ||
iterable: Iterable<T>, | ||
accessor: (datum: T, index: number, array: Iterable<T>) => U | undefined | null | ||
): [U, U] | [undefined, undefined]; | ||
/** | ||
* Return the mean of an array of numbers | ||
* Compute the sum of an array of numbers. | ||
*/ | ||
export function mean<T extends Numeric>(array: Iterable<T | undefined | null>): number | undefined; | ||
export function sum<T extends Numeric>(iterable: Iterable<T | undefined | null>): number; | ||
/** | ||
* Compute the sum of an array, using the given accessor to convert values to numbers. | ||
*/ | ||
export function sum<T>( | ||
iterable: Iterable<T>, | ||
accessor: (datum: T, index: number, array: Iterable<T>) => number | undefined | null | ||
): number; | ||
@@ -132,3 +153,10 @@ /** | ||
*/ | ||
export function mean<T>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => number | undefined | null): number | undefined; | ||
export function mean<T extends Numeric>(iterable: Iterable<T | undefined | null>): number | undefined; | ||
/** | ||
* Return the mean of an array of numbers | ||
*/ | ||
export function mean<T>( | ||
iterable: Iterable<T>, | ||
accessor: (datum: T, index: number, array: Iterable<T>) => number | undefined | null | ||
): number | undefined; | ||
@@ -138,47 +166,76 @@ /** | ||
*/ | ||
export function median<T extends Numeric>(array: Iterable<T | undefined | null>): number | undefined; | ||
export function median<T extends Numeric>(iterable: Iterable<T | undefined | null>): number | undefined; | ||
/** | ||
* Return the median of an array of numbers | ||
*/ | ||
export function median<T>(array: Iterable<T>, accessor: (element: T, i: number, array: Iterable<T>) => number | undefined | null): number | undefined; | ||
export function median<T>( | ||
iterable: Iterable<T>, | ||
accessor: (element: T, i: number, array: Iterable<T>) => number | undefined | null | ||
): number | undefined; | ||
/** | ||
* Returns the p-quantile of an array of numbers | ||
* Returns the p-quantile of the given iterable of numbers, where p is a number in the range [0, 1]. | ||
* | ||
* An optional accessor function may be specified, which is equivalent to calling array.map(accessor) before computing the quantile. | ||
*/ | ||
export function quantile<T extends Numeric>(array: Iterable<T | undefined | null>, p: number): number | undefined; | ||
export function quantile<T>(array: Iterable<T>, p: number, accessor: (element: T, i: number, array: Iterable<T>) => number | undefined | null): number | undefined; | ||
export function quantile<T extends Numeric>(iterable: Iterable<T | undefined | null>, p: number): number | undefined; | ||
/** | ||
* Compute the sum of an array of numbers. | ||
* Returns the p-quantile of the given iterable of numbers, where p is a number in the range [0, 1]. | ||
* | ||
* An optional accessor function may be specified, which is equivalent to calling array.map(accessor) before computing the quantile. | ||
*/ | ||
export function sum<T extends Numeric>(array: Iterable<T | undefined | null>): number; | ||
export function quantile<T>( | ||
iterable: Iterable<T>, | ||
p: number, | ||
accessor: (element: T, i: number, array: Iterable<T>) => number | undefined | null | ||
): number | undefined; | ||
/** | ||
* Compute the sum of an array, using the given accessor to convert values to numbers. | ||
* Similar to quantile, but expects the input to be a sorted array of values. | ||
* In contrast with quantile, the accessor is only called on the elements needed to compute the quantile. | ||
*/ | ||
export function sum<T>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => number | undefined | null): number; | ||
export function quantileSorted<T extends Numeric>( | ||
array: Array<T | undefined | null>, | ||
p: number | ||
): number | undefined; | ||
/** | ||
* Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array of numbers. | ||
* Similar to quantile, but expects the input to be a sorted array of values. | ||
* In contrast with quantile, the accessor is only called on the elements needed to compute the quantile. | ||
*/ | ||
export function deviation<T extends Numeric>(array: Iterable<T | undefined | null>): number | undefined; | ||
export function quantileSorted<T>( | ||
array: T[], | ||
p: number, | ||
accessor: (element: T, i: number, array: T[]) => number | undefined | null | ||
): number | undefined; | ||
/** | ||
* Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array, | ||
* using the given accessor to convert values to numbers. | ||
* Returns an unbiased estimator of the population variance of the given iterable of numbers using Welford’s algorithm. | ||
* If the iterable has fewer than two numbers, returns undefined. | ||
* An optional accessor function may be specified, which is equivalent to calling Array.from before computing the variance. | ||
* This method ignores undefined and NaN values; this is useful for ignoring missing data. | ||
*/ | ||
export function deviation<T>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => number | undefined | null): number | undefined; | ||
export function variance<T extends Numeric>(iterable: Iterable<T | undefined | null>): number | undefined; | ||
/** | ||
* Compute an unbiased estimator of the population variance of the given array of numbers. | ||
* Returns an unbiased estimator of the population variance of the given iterable of numbers using Welford’s algorithm. | ||
* If the iterable has fewer than two numbers, returns undefined. | ||
* An optional accessor function may be specified, which is equivalent to calling Array.from before computing the variance. | ||
* This method ignores undefined and NaN values; this is useful for ignoring missing data. | ||
*/ | ||
export function variance<T extends Numeric>(array: Iterable<T | undefined | null>): number | undefined; | ||
export function variance<T>( | ||
iterable: Iterable<T>, | ||
accessor: (datum: T, index: number, array: Iterable<T>) => number | undefined | null | ||
): number | undefined; | ||
/** | ||
* Compute an unbiased estimator of the population variance of the given array, | ||
* Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array of numbers. | ||
*/ | ||
export function deviation<T extends Numeric>(iterable: Iterable<T | undefined | null>): number | undefined; | ||
/** | ||
* Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array, | ||
* using the given accessor to convert values to numbers. | ||
*/ | ||
export function variance<T>(array: Iterable<T>, accessor: (datum: T, index: number, array: Iterable<T>) => number | undefined | null): number | undefined; | ||
export function deviation<T>( | ||
iterable: Iterable<T>, | ||
accessor: (datum: T, index: number, array: Iterable<T>) => number | undefined | null | ||
): number | undefined; | ||
@@ -190,25 +247,13 @@ // -------------------------------------------------------------------------------------- | ||
/** | ||
* @deprecated Use leastIndex instead. | ||
*/ | ||
export function scan(array: Iterable<number>, comparator?: (a: number, b: number) => number): number | undefined; | ||
/** | ||
* @deprecated Use leastIndex instead. | ||
*/ | ||
export function scan<T>(array: Iterable<T>, comparator: (a: T, b: T) => number): number | undefined; | ||
/** | ||
* Returns the least element of the specified iterable. | ||
*/ | ||
export function least<T>(array: Iterable<T>): T | undefined; | ||
export function least<T>(iterable: Iterable<T>): T | undefined; | ||
/** | ||
* Returns the least element of the specified iterable according to the specified comparator. | ||
*/ | ||
export function least<T>(array: Iterable<T>, comparator: (a: T, b: T) => number): T | undefined; | ||
export function least<T>(iterable: Iterable<T>, comparator: (a: T, b: T) => number): T | undefined; | ||
/** | ||
* Returns the least element of the specified iterable according to the specified accessor. | ||
*/ | ||
export function least<T, U>(array: Iterable<T>, accessor: (a: T) => U): T | undefined; | ||
export function least<T, U>(iterable: Iterable<T>, accessor: (a: T) => U): T | undefined; | ||
@@ -218,14 +263,50 @@ /** | ||
*/ | ||
export function leastIndex<T>(array: Iterable<T>): number | undefined; | ||
export function leastIndex<T>(iterable: Iterable<T>): number | undefined; | ||
/** | ||
* Returns the index of the least element of the specified iterable according to the specified comparator. | ||
*/ | ||
export function leastIndex<T>(array: Iterable<T>, comparator: (a: T, b: T) => number): number | undefined; | ||
export function leastIndex<T>(iterable: Iterable<T>, comparator: (a: T, b: T) => number): number | undefined; | ||
/** | ||
* Returns the index of the least element of the specified iterable according to the specified accessor. | ||
*/ | ||
export function leastIndex<T, U>(array: Iterable<T>, accessor: (a: T) => U): number | undefined; | ||
export function leastIndex<T, U>(iterable: Iterable<T>, accessor: (a: T) => U): number | undefined; | ||
/** | ||
* Returns the greatest element of the specified iterable according to the specified comparator or accessor. | ||
* If the given iterable contains no comparable elements (i.e., the comparator returns NaN when comparing each element to itself), returns undefined. | ||
* If comparator is not specified, it defaults to ascending. | ||
*/ | ||
export function greatest<T>(iterable: Iterable<T>): T | undefined; | ||
/** | ||
* Returns the greatest element of the specified iterable according to the specified comparator or accessor. | ||
* If the given iterable contains no comparable elements (i.e., the comparator returns NaN when comparing each element to itself), returns undefined. | ||
* If comparator is not specified, it defaults to ascending. | ||
*/ | ||
export function greatest<T>(iterable: Iterable<T>, comparator: (a: T, b: T) => number): T | undefined; | ||
/** | ||
* Returns the greatest element of the specified iterable according to the specified comparator or accessor. | ||
* If the given iterable contains no comparable elements (i.e., the comparator returns NaN when comparing each element to itself), returns undefined. | ||
* If comparator is not specified, it defaults to ascending. | ||
*/ | ||
export function greatest<T, U>(iterable: Iterable<T>, accessor: (a: T) => U): T | undefined; | ||
/** | ||
* Returns the index of the greatest element of the specified iterable according to the specified comparator or accessor. | ||
* If the given iterable contains no comparable elements (i.e., the comparator returns NaN when comparing each element to itself), returns -1. | ||
* If comparator is not specified, it defaults to ascending. | ||
*/ | ||
export function greatestIndex<T>(iterable: Iterable<T>): number | undefined; | ||
/** | ||
* Returns the index of the greatest element of the specified iterable according to the specified comparator or accessor. | ||
* If the given iterable contains no comparable elements (i.e., the comparator returns NaN when comparing each element to itself), returns -1. | ||
* If comparator is not specified, it defaults to ascending. | ||
*/ | ||
export function greatestIndex<T>(iterable: Iterable<T>, comparator: (a: T, b: T) => number): number | undefined; | ||
/** | ||
* Returns the index of the greatest element of the specified iterable according to the specified comparator or accessor. | ||
* If the given iterable contains no comparable elements (i.e., the comparator returns NaN when comparing each element to itself), returns -1. | ||
* If comparator is not specified, it defaults to ascending. | ||
*/ | ||
export function greatestIndex<T, U>(iterable: Iterable<T>, accessor: (a: T) => U): number | undefined; | ||
export function bisectLeft(array: ArrayLike<number>, x: number, lo?: number, hi?: number): number; | ||
@@ -256,3 +337,2 @@ export function bisectLeft(array: ArrayLike<string>, x: string, lo?: number, hi?: number): number; | ||
export function quickselect<T>(array: ArrayLike<T>, k: number): T[]; | ||
/** | ||
@@ -266,3 +346,2 @@ * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right]. | ||
export function quickselect<T>(array: ArrayLike<T>, k: number, left: number): T[]; | ||
/** | ||
@@ -277,3 +356,2 @@ * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right]. | ||
export function quickselect<T>(array: ArrayLike<T>, k: number, left: number, right: number): T[]; | ||
/** | ||
@@ -312,2 +390,26 @@ * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right]. | ||
export function group<TObject, TKey>(iterable: Iterable<TObject>, key: (value: TObject) => TKey): Map<TKey, TObject[]>; | ||
/** | ||
* Groups the specified array of values into a Map from key to array of value. | ||
* @param iterable The array to group. | ||
* @param key1 The first key function. | ||
* @param key2 The second key function. | ||
*/ | ||
export function group<TObject, TKey1, TKey2>( | ||
iterable: Iterable<TObject>, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2 | ||
): Map<TKey1, Map<TKey2, TObject[]>>; | ||
/** | ||
* Groups the specified array of values into a Map from key to array of value. | ||
* @param iterable The array to group. | ||
* @param key1 The first key function. | ||
* @param key2 The second key function. | ||
* @param key3 The third key function. | ||
*/ | ||
export function group<TObject, TKey1, TKey2, TKey3>( | ||
iterable: Iterable<TObject>, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2, | ||
key3: (value: TObject) => TKey3 | ||
): Map<TKey1, Map<TKey2, Map<TKey3, TObject[]>>>; | ||
@@ -319,3 +421,30 @@ /** | ||
*/ | ||
export function groups<TObject, TKey>(iterable: Iterable<TObject>, key: (value: TObject) => TKey): [TKey, TObject[]]; | ||
export function groups<TObject, TKey>( | ||
iterable: Iterable<TObject>, | ||
key: (value: TObject) => TKey | ||
): Array<[TKey, TObject[]]>; | ||
/** | ||
* Equivalent to group, but returns nested arrays instead of nested maps. | ||
* @param iterable The array to group. | ||
* @param key1 The first key function. | ||
* @param key2 The second key function. | ||
*/ | ||
export function groups<TObject, TKey1, TKey2>( | ||
iterable: Iterable<TObject>, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2 | ||
): Array<[TKey1, Array<[TKey2, TObject[]]>]>; | ||
/** | ||
* Equivalent to group, but returns nested arrays instead of nested maps. | ||
* @param iterable The array to group. | ||
* @param key1 The first key function. | ||
* @param key2 The second key function. | ||
* @param key3 The third key function. | ||
*/ | ||
export function groups<TObject, TKey1, TKey2, TKey3>( | ||
iterable: Iterable<TObject>, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2, | ||
key3: (value: TObject) => TKey3 | ||
): Array<[TKey1, Array<[TKey2, Array<[TKey3, TObject[]]>]>]>; | ||
@@ -329,3 +458,3 @@ /** | ||
*/ | ||
export function rollup<TObject, TKey, TReduce>( | ||
export function rollup<TObject, TReduce, TKey>( | ||
iterable: Iterable<TObject>, | ||
@@ -335,2 +464,32 @@ reduce: (value: TObject[]) => TReduce, | ||
): Map<TKey, TReduce>; | ||
/** | ||
* Groups and reduces the specified array of values into a Map from key to value. | ||
* | ||
* @param iterable The array to group. | ||
* @param reduce The reduce function. | ||
* @param key1 The first key function. | ||
* @param key2 The second key function. | ||
*/ | ||
export function rollup<TObject, TReduce, TKey1, TKey2>( | ||
iterable: Iterable<TObject>, | ||
reduce: (value: TObject[]) => TReduce, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2 | ||
): Map<TKey1, Map<TKey2, TReduce>>; | ||
/** | ||
* Groups and reduces the specified array of values into a Map from key to value. | ||
* | ||
* @param iterable The array to group. | ||
* @param reduce The reduce function. | ||
* @param key1 The first key function. | ||
* @param key2 The second key function. | ||
* @param key3 The third key function. | ||
*/ | ||
export function rollup<TObject, TReduce, TKey1, TKey2, TKey3>( | ||
iterable: Iterable<TObject>, | ||
reduce: (value: TObject[]) => TReduce, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2, | ||
key3: (value: TObject) => TKey3 | ||
): Map<TKey1, Map<TKey2, Map<TKey3, TReduce>>>; | ||
@@ -344,7 +503,37 @@ /** | ||
*/ | ||
export function rollups<TObject, TKey, TReduce>( | ||
export function rollups<TObject, TReduce, TKey>( | ||
iterable: Iterable<TObject>, | ||
reduce: (value: TObject[]) => TReduce, | ||
key: (value: TObject) => TKey | ||
): [TKey, TReduce]; | ||
): Array<[TKey, TReduce]>; | ||
/** | ||
* Equivalent to rollup, but returns nested arrays instead of nested maps. | ||
* | ||
* @param iterable The array to group. | ||
* @param reduce The reduce function. | ||
* @param key1 The first key function. | ||
* @param key2 The second key function. | ||
*/ | ||
export function rollups<TObject, TReduce, TKey1, TKey2>( | ||
iterable: Iterable<TObject>, | ||
reduce: (value: TObject[]) => TReduce, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2 | ||
): Array<[TKey1, Array<[TKey2, TReduce]>]>; | ||
/** | ||
* Equivalent to rollup, but returns nested arrays instead of nested maps. | ||
* | ||
* @param iterable The array to group. | ||
* @param reduce The reduce function. | ||
* @param key1 The first key function. | ||
* @param key2 The second key function. | ||
* @param key3 The third key function. | ||
*/ | ||
export function rollups<TObject, TReduce, TKey1, TKey2, TKey3>( | ||
iterable: Iterable<TObject>, | ||
reduce: (value: TObject[]) => TReduce, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2, | ||
key3: (value: TObject) => TKey3 | ||
): Array<[TKey1, Array<[TKey2, Array<[TKey3, TReduce]>]>]>; | ||
@@ -354,12 +543,15 @@ /** | ||
* | ||
* @param a Input array. | ||
* @param iterable Input array. | ||
*/ | ||
export function count<TObject>(a: Iterable<TObject>): number; | ||
export function count<TObject>(iterable: Iterable<TObject>): number; | ||
/** | ||
* Returns the number of valid number values (i.e., not null, NaN, or undefined) in the specified iterable; accepts an accessor. | ||
* | ||
* @param a Input array. | ||
* @param iterable Input array. | ||
* @param accessor Accesor method. | ||
*/ | ||
export function count<TObject>(a: Iterable<TObject>, accessor: (a: TObject, b: TObject) => number | null | undefined): number; | ||
export function count<TObject>( | ||
iterable: Iterable<TObject>, | ||
accessor: (a: TObject, b: TObject) => number | null | undefined | ||
): number; | ||
@@ -390,3 +582,3 @@ /** | ||
*/ | ||
export function merge<T>(arrays: Iterable<Iterable<T>>): T[]; | ||
export function merge<T>(iterables: Iterable<Iterable<T>>): T[]; | ||
@@ -397,5 +589,5 @@ /** | ||
* | ||
* @param array Array of input elements | ||
* @param iterable Array of input elements | ||
*/ | ||
export function pairs<T>(array: Iterable<T>): Array<[T, T]>; | ||
export function pairs<T>(iterable: Iterable<T>): Array<[T, T]>; | ||
/** | ||
@@ -406,6 +598,6 @@ * For each adjacent pair of elements in the specified array, in order, invokes the specified reducer function passing the element i and element i - 1. | ||
* | ||
* @param array Array of input elements | ||
* @param iterable Array of input elements | ||
* @param reducer A reducer function taking as input to adjacent elements of the input array and returning a reduced value. | ||
*/ | ||
export function pairs<T, U>(array: Iterable<T>, reducer: (a: T, b: T) => U): U[]; | ||
export function pairs<T, U>(iterable: Iterable<T>, reducer: (a: T, b: T) => U): U[]; | ||
@@ -428,11 +620,2 @@ /** | ||
/** | ||
* Generates a 0-based numeric sequence. The output range does not include 'stop'. | ||
*/ | ||
export function range(stop: number): number[]; | ||
/** | ||
* Generates a numeric sequence starting from the given start and stop values. 'step' defaults to 1. The output range does not include 'stop'. | ||
*/ | ||
export function range(start: number, stop: number, step?: number): number[]; | ||
/** | ||
* Randomizes the order of the specified array using the Fisher–Yates shuffle. | ||
@@ -494,2 +677,11 @@ */ | ||
/** | ||
* Generates a 0-based numeric sequence. The output range does not include 'stop'. | ||
*/ | ||
export function range(stop: number): number[]; | ||
/** | ||
* Generates a numeric sequence starting from the given start and stop values. 'step' defaults to 1. The output range does not include 'stop'. | ||
*/ | ||
export function range(start: number, stop: number, step?: number): number[]; | ||
/** | ||
* Transpose a matrix provided in Array of Arrays format. | ||
@@ -496,0 +688,0 @@ */ |
{ | ||
"name": "@types/d3-array", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "TypeScript definitions for D3JS d3-array module", | ||
@@ -47,4 +47,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "ae45f5d0d7163db9e1e8e04fac800b29ecd20bbf60e58f1d239e4d9e49b6c0f7", | ||
"typesPublisherContentHash": "db80d1adfa92e82f5185c0ae308ac0c1a1f41347e3b607a1418ea4655604cc03", | ||
"typeScriptVersion": "3.2" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Tue, 13 Oct 2020 04:09:39 GMT | ||
* Last updated: Tue, 20 Oct 2020 06:39:43 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39657
750