mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 09:41:45 +00:00
d3-array : fix linting errors
This commit is contained in:
@@ -548,7 +548,7 @@ interface ObjDefinition {
|
||||
date: string;
|
||||
}
|
||||
|
||||
const objArray: Array<ObjDefinition> = [
|
||||
const objArray: ObjDefinition[] = [
|
||||
{ name: "jim", amount: "34.0", date: "11/12/2015" },
|
||||
{ name: "carl", amount: "120.11", date: "11/12/2015" },
|
||||
{ name: "stacy", amount: "12.01", date: "01/04/2016" },
|
||||
|
||||
Vendored
+15
-15
@@ -176,41 +176,41 @@ export function bisector<T, U>(accessor: (x: T) => U): Bisector<T, U>;
|
||||
|
||||
/**
|
||||
* 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].
|
||||
*
|
||||
*
|
||||
* @param array The array to partially sort (in place).
|
||||
* @param k The middle index for partial sorting.
|
||||
* @param k The middle index for partial sorting.
|
||||
*/
|
||||
export function quickselect<T>(array: Array<T>, k: number): Array<T>;
|
||||
export function quickselect<T>(array: ArrayLike<T>, k: number): T[];
|
||||
|
||||
/**
|
||||
* 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].
|
||||
*
|
||||
*
|
||||
* @param array The array to partially sort (in place).
|
||||
* @param k The middle index for partial sorting.
|
||||
* @param k The middle index for partial sorting.
|
||||
* @param left The left index of the range to sort.
|
||||
*/
|
||||
export function quickselect<T>(array: Array<T>, k: number, left: number): Array<T>;
|
||||
export function quickselect<T>(array: ArrayLike<T>, k: number, left: number): T[];
|
||||
|
||||
/**
|
||||
* 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].
|
||||
*
|
||||
*
|
||||
* @param array The array to partially sort (in place).
|
||||
* @param k The middle index for partial sorting.
|
||||
* @param k The middle index for partial sorting.
|
||||
* @param left The left index of the range to sort.
|
||||
* @param right The right index.
|
||||
*/
|
||||
export function quickselect<T>(array: Array<T>, k: number, left: number, right: number): Array<T>;
|
||||
export function quickselect<T>(array: ArrayLike<T>, k: number, left: number, right: number): T[];
|
||||
|
||||
/**
|
||||
* 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].
|
||||
*
|
||||
*
|
||||
* @param array The array to partially sort (in place).
|
||||
* @param k The middle index for partial sorting.
|
||||
* @param k The middle index for partial sorting.
|
||||
* @param left The left index of the range to sort.
|
||||
* @param right The right index.
|
||||
* @param compare The compare function.
|
||||
*/
|
||||
export function quickselect<T>(array: Array<T>, k: number, left: number, right: number, compare: (a: Primitive | undefined, b: Primitive | undefined) => number): Array<T>;
|
||||
export function quickselect<T>(array: ArrayLike<T>, k: number, left: number, right: number, compare: (a: Primitive | undefined, b: Primitive | undefined) => number): T[];
|
||||
|
||||
// NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances.
|
||||
/**
|
||||
@@ -235,14 +235,14 @@ export function descending(a: Primitive | undefined, b: Primitive | undefined):
|
||||
*/
|
||||
export function group<TObject, TKey>(a: ArrayLike<TObject>, key: (value: TObject) => TKey): Map<TKey, TObject>;
|
||||
|
||||
|
||||
/**
|
||||
* Groups and reduces the specified array of values into a Map from key to value.
|
||||
* Groups and reduces the specified array of values into a Map from key to value.
|
||||
*
|
||||
* @param a The array to group.
|
||||
* @param reduce The reduce function.
|
||||
* @param key The key function.
|
||||
*/
|
||||
export function rollup<TObject, TKey>(a: ArrayLike<TObject>, reduce: (value: Array<TObject>) => number, key: (value: TObject) => TKey): Map<TKey, TObject>;
|
||||
export function rollup<TObject, TKey>(a: ArrayLike<TObject>, reduce: (value: ArrayLike<TObject>) => number, key: (value: TObject) => TKey): Map<TKey, TObject>;
|
||||
|
||||
/**
|
||||
* Returns the Cartesian product of the two arrays a and b.
|
||||
|
||||
Reference in New Issue
Block a user