@types/d3-array
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for D3JS d3-array module 2.1 | ||
// Type definitions for D3JS d3-array module 2.2 | ||
// Project: https://github.com/d3/d3-array, https://d3js.org/d3-array | ||
@@ -6,8 +6,9 @@ // Definitions by: Alex Ford <https://github.com/gustavderdrache> | ||
// Tom Wanzek <https://github.com/tomwanzek> | ||
// denisname <https://github.com/denisname>, | ||
// denisname <https://github.com/denisname> | ||
// Hugues Stefanski <https://github.com/ledragon> | ||
// Nathan Bierema <https://github.com/Methuselah96> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
// Last module patch version validated against: 2.1.0 | ||
// Last module patch version validated against: 2.2.0 | ||
@@ -295,17 +296,41 @@ // -------------------------------------------------------------------------- | ||
* Groups the specified array of values into a Map from key to array of value. | ||
* @param a The array to group. | ||
* @param iterable The array to group. | ||
* @param key The key function. | ||
*/ | ||
export function group<TObject, TKey>(a: Iterable<TObject>, key: (value: TObject) => TKey): Map<TKey, TObject[]>; | ||
export function group<TObject, TKey>(iterable: Iterable<TObject>, key: (value: TObject) => TKey): Map<TKey, TObject[]>; | ||
/** | ||
* Equivalent to group, but returns nested arrays instead of nested maps. | ||
* @param iterable The array to group. | ||
* @param key The key function. | ||
*/ | ||
export function groups<TObject, TKey>(iterable: Iterable<TObject>, key: (value: TObject) => TKey): [TKey, TObject[]]; | ||
/** | ||
* Groups and reduces the specified array of values into a Map from key to value. | ||
* | ||
* @param a The array to group. | ||
* @param iterable The array to group. | ||
* @param reduce The reduce function. | ||
* @param key The key function. | ||
*/ | ||
export function rollup<TObject, TKey, TReduce>(a: Iterable<TObject>, reduce: (value: TObject[]) => TReduce, key: (value: TObject) => TKey): Map<TKey, TReduce>; | ||
export function rollup<TObject, TKey, TReduce>( | ||
iterable: Iterable<TObject>, | ||
reduce: (value: TObject[]) => TReduce, | ||
key: (value: TObject) => TKey | ||
): Map<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 key The key function. | ||
*/ | ||
export function rollups<TObject, TKey, TReduce>( | ||
iterable: Iterable<TObject>, | ||
reduce: (value: TObject[]) => TReduce, | ||
key: (value: TObject) => TKey | ||
): [TKey, TReduce]; | ||
/** | ||
* Returns the number of valid number values (i.e., not null, NaN, or undefined) in the specified iterable; accepts an accessor. | ||
@@ -368,8 +393,9 @@ * | ||
/** | ||
* Returns a permutation of the specified array using the specified array of indexes. | ||
* The returned array contains the corresponding element in array for each index in indexes, in order. | ||
* Returns a permutation of the specified source object (or array) using the specified iterable of keys. | ||
* The returned array contains the corresponding property of the source object for each key in keys, in order. | ||
* For example, `permute(["a", "b", "c"], [1, 2, 0]) // ["b", "c", "a"]` | ||
* | ||
* It is acceptable to have more keys than source elements, and for keys to be duplicated or omitted. | ||
*/ | ||
export function permute<T>(array: { [key: number]: T; }, keys: ArrayLike<number>): T[]; | ||
export function permute<T>(source: { [key: number]: T; }, keys: Iterable<number>): T[]; | ||
/** | ||
@@ -380,3 +406,3 @@ * Extract the values from an object into an array with a stable order. For example: | ||
*/ | ||
export function permute<T, K extends keyof T>(object: T, keys: ArrayLike<K>): Array<T[K]>; | ||
export function permute<T, K extends keyof T>(source: T, keys: Iterable<K>): Array<T[K]>; | ||
@@ -387,3 +413,2 @@ /** | ||
export function range(stop: number): number[]; | ||
/** | ||
@@ -390,0 +415,0 @@ * Generates a numeric sequence starting from the given start and stop values. 'step' defaults to 1. The output range does not include 'stop'. |
{ | ||
"name": "@types/d3-array", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "TypeScript definitions for D3JS d3-array module", | ||
@@ -31,2 +31,7 @@ "license": "MIT", | ||
"githubUsername": "ledragon" | ||
}, | ||
{ | ||
"name": "Nathan Bierema", | ||
"url": "https://github.com/Methuselah96", | ||
"githubUsername": "Methuselah96" | ||
} | ||
@@ -43,4 +48,4 @@ ], | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "450fe2bfa2e80b4e396121246852bbfd8223039624159dddad90e8b8f8cdbe60", | ||
"typesPublisherContentHash": "ae45f5d0d7163db9e1e8e04fac800b29ecd20bbf60e58f1d239e4d9e49b6c0f7", | ||
"typeScriptVersion": "3.2" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Fri, 09 Oct 2020 06:51:10 GMT | ||
* Last updated: Tue, 13 Oct 2020 04:09:39 GMT | ||
* Dependencies: none | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [Tom Wanzek](https://github.com/tomwanzek), [denisname](https://github.com/denisname), and [Hugues Stefanski](https://github.com/ledragon). | ||
These definitions were written by [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [Tom Wanzek](https://github.com/tomwanzek), [denisname](https://github.com/denisname), [Hugues Stefanski](https://github.com/ledragon), and [Nathan Bierema](https://github.com/Methuselah96). |
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
31495
536