@types/d3-array
Advanced tools
Comparing version 3.0.6 to 3.0.7
@@ -30,2 +30,24 @@ // Type definitions for D3JS d3-array module 3.0 | ||
/** | ||
* Represents a nested/recursive InternMap type | ||
* | ||
* The first generic "TObject" refers to the type of the data object that is available in the accessor functions. | ||
* The second generic "TReduce" refers to the type of the data available at the deepest level (the result data). | ||
* The third generic "TKeys" refers to the type of the keys at each level of the nestes InternMap. | ||
*/ | ||
export type NestedInternMap<TObject, TReduce, TKeys extends unknown[]> = TKeys extends [infer TFirst, ...infer TRest] | ||
? InternMap<TFirst, NestedInternMap<TObject, TReduce, TRest>> | ||
: TReduce; | ||
/** | ||
* Represents a nested/recursive Array type | ||
* | ||
* The first generic "TObject" refers to the type of the data object that is available in the accessor functions. | ||
* The second generic "TReduce" refers to the type of the data available at the deepest level (the result data). | ||
* The third generic "TKeys" refers to the type of the keys at each level of the nestes Array. | ||
*/ | ||
export type NestedArray<TObject, TReduce, TKeys extends unknown[]> = TKeys extends [infer TFirst, ...infer TRest] | ||
? Array<[TFirst, NestedArray<TObject, TReduce, TRest>]> | ||
: TReduce; | ||
// -------------------------------------------------------------------------------------- | ||
@@ -449,34 +471,13 @@ // Statistics | ||
/** | ||
* Groups the specified array of values into an InternMap from key to array of value. | ||
* Groups the specified iterable of values into an InternMap from key to array of value. | ||
* | ||
* @param iterable The array to group. | ||
* @param key The key function. | ||
* @param iterable The iterable to group. | ||
* @param keys The key functions. | ||
*/ | ||
export function group<TObject, TKey>(iterable: Iterable<TObject>, key: (value: TObject) => TKey): InternMap<TKey, TObject[]>; | ||
/** | ||
* Groups the specified array of values into an InternMap 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>( | ||
export function group<TObject, TKeys extends unknown[]>( | ||
iterable: Iterable<TObject>, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2 | ||
): InternMap<TKey1, InternMap<TKey2, TObject[]>>; | ||
/** | ||
* Groups the specified array of values into an InternMap 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 | ||
): InternMap<TKey1, InternMap<TKey2, InternMap<TKey3, TObject[]>>>; | ||
...keys: { | ||
[Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; | ||
} | ||
): NestedInternMap<TObject, TObject[], TKeys>; | ||
@@ -486,35 +487,11 @@ /** | ||
* | ||
* @param iterable The array to group. | ||
* @param key The key function. | ||
* @param iterable The iterable to group. | ||
* @param keys The key functions. | ||
*/ | ||
export function groups<TObject, TKey>( | ||
export function groups<TObject, TKeys extends unknown[]>( | ||
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[]]>]>]>; | ||
...keys: { | ||
[Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; | ||
} | ||
): NestedArray<TObject, TObject[], TKeys>; | ||
@@ -524,35 +501,11 @@ /** | ||
* | ||
* @param iterable The array to group. | ||
* @param key The key function. | ||
* @param iterable The iterable to group. | ||
* @param keys The key functions. | ||
*/ | ||
export function flatGroup<TObject, TKey>( | ||
export function flatGroup<TObject, TKeys extends unknown[]>( | ||
iterable: Iterable<TObject>, | ||
key: (value: TObject) => TKey | ||
): Array<[TKey, TObject[]]>; | ||
/** | ||
* Equivalent to group, but returns a flat array of [key0, key1, …, values] instead of nested maps. | ||
* | ||
* @param iterable The array to group. | ||
* @param key1 The first key function. | ||
* @param key2 The second key function. | ||
*/ | ||
export function flatGroup<TObject, TKey1, TKey2>( | ||
iterable: Iterable<TObject>, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2 | ||
): Array<[TKey1, TKey2, TObject[]]>; | ||
/** | ||
* Equivalent to group, but returns a flat array of [key0, key1, …, values] 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 flatGroup<TObject, TKey1, TKey2, TKey3>( | ||
iterable: Iterable<TObject>, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2, | ||
key3: (value: TObject) => TKey3 | ||
): Array<[TKey1, TKey2, TKey3, TObject[]]>; | ||
...keys: { | ||
[Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; | ||
} | ||
): Array<[...TKeys, TObject[]]>; | ||
@@ -562,32 +515,11 @@ /** | ||
* | ||
* @param iterable The array to group. | ||
* @param key The key function. | ||
* @param iterable The iterable to group. | ||
* @param key The key functions. | ||
*/ | ||
export function index<TObject, TKey>(iterable: Iterable<TObject>, key: (value: TObject) => TKey): InternMap<TKey, TObject>; | ||
/** | ||
* Equivalent to group but returns a unique value per compound key instead of an array, throwing if the key is not unique. | ||
* | ||
* @param iterable The array to group. | ||
* @param key1 The first key function. | ||
* @param key2 The second key function. | ||
*/ | ||
export function index<TObject, TKey1, TKey2>( | ||
export function index<TObject, TKeys extends unknown[]>( | ||
iterable: Iterable<TObject>, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2 | ||
): InternMap<TKey1, InternMap<TKey2, TObject>>; | ||
/** | ||
* Equivalent to group but returns a unique value per compound key instead of an array, throwing if the key is not unique. | ||
* | ||
* @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 index<TObject, TKey1, TKey2, TKey3>( | ||
iterable: Iterable<TObject>, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2, | ||
key3: (value: TObject) => TKey3 | ||
): InternMap<TKey1, InternMap<TKey2, InternMap<TKey3, TObject>>>; | ||
...keys: { | ||
[Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; | ||
} | ||
): NestedInternMap<TObject, TObject, TKeys>; | ||
@@ -597,35 +529,11 @@ /** | ||
* | ||
* @param iterable The array to group. | ||
* @param key The key function. | ||
* @param iterable The iterable to group. | ||
* @param keys The key functions. | ||
*/ | ||
export function indexes<TObject, TKey>( | ||
export function indexes<TObject, TKeys extends unknown[]>( | ||
iterable: Iterable<TObject>, | ||
key: (value: TObject) => TKey | ||
): Array<[TKey, TObject]>; | ||
/** | ||
* Equivalent to index, 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 indexes<TObject, TKey1, TKey2>( | ||
iterable: Iterable<TObject>, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2 | ||
): Array<[TKey1, Array<[TKey2, TObject]>]>; | ||
/** | ||
* Equivalent to index, 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 indexes<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]>]>]>; | ||
...keys: { | ||
[Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; | ||
} | ||
): NestedArray<TObject, TObject, TKeys>; | ||
@@ -635,41 +543,13 @@ /** | ||
* | ||
* @param iterable The array to group. | ||
* @param iterable The iterable to group. | ||
* @param reduce The reduce function. | ||
* @param key The key function. | ||
* @param keys The key functions. | ||
*/ | ||
export function rollup<TObject, TReduce, TKey>( | ||
export function rollup<TObject, TReduce, TKeys extends unknown[]>( | ||
iterable: Iterable<TObject>, | ||
reduce: (value: TObject[]) => TReduce, | ||
key: (value: TObject) => TKey | ||
): InternMap<TKey, TReduce>; | ||
/** | ||
* Groups and reduces the specified array of values into an InternMap 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 | ||
): InternMap<TKey1, InternMap<TKey2, TReduce>>; | ||
/** | ||
* Groups and reduces the specified array of values into an InternMap 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 | ||
): InternMap<TKey1, InternMap<TKey2, InternMap<TKey3, TReduce>>>; | ||
reduce: (values: TObject[]) => TReduce, | ||
...keys: { | ||
[Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; | ||
} | ||
): NestedInternMap<TObject, TReduce, TKeys>; | ||
@@ -679,41 +559,13 @@ /** | ||
* | ||
* @param iterable The array to group. | ||
* @param iterable The iterable to group. | ||
* @param reduce The reduce function. | ||
* @param key The key function. | ||
* @param keys The key functions. | ||
*/ | ||
export function rollups<TObject, TReduce, TKey>( | ||
export function rollups<TObject, TReduce, TKeys extends unknown[]>( | ||
iterable: Iterable<TObject>, | ||
reduce: (value: TObject[]) => TReduce, | ||
key: (value: TObject) => TKey | ||
): 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]>]>]>; | ||
reduce: (values: TObject[]) => TReduce, | ||
...keys: { | ||
[Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; | ||
} | ||
): NestedArray<TObject, TReduce, TKeys>; | ||
@@ -723,41 +575,13 @@ /** | ||
* | ||
* @param iterable The array to group. | ||
* @param iterable The iterable to group. | ||
* @param reduce The reduce function. | ||
* @param key The key function. | ||
* @param keys The key functions. | ||
*/ | ||
export function flatRollup<TObject, TReduce, TKey>( | ||
export function flatRollup<TObject, TReduce, TKeys extends unknown[]>( | ||
iterable: Iterable<TObject>, | ||
reduce: (value: TObject[]) => TReduce, | ||
key: (value: TObject) => TKey | ||
): Array<[TKey, TReduce]>; | ||
/** | ||
* Equivalent to rollup, but returns a flat array of [key0, key1, …, value] 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 flatRollup<TObject, TReduce, TKey1, TKey2>( | ||
iterable: Iterable<TObject>, | ||
reduce: (value: TObject[]) => TReduce, | ||
key1: (value: TObject) => TKey1, | ||
key2: (value: TObject) => TKey2 | ||
): Array<[TKey1, TKey2, TReduce]>; | ||
/** | ||
* Equivalent to rollup, but returns a flat array of [key0, key1, …, value] 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 flatRollup<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, TKey2, TKey3, TReduce]>; | ||
reduce: (values: TObject[]) => TReduce, | ||
...keys: { | ||
[Index in keyof TKeys]: (value: TObject, index: number, values: TObject[]) => TKeys[Index]; | ||
} | ||
): Array<[...TKeys, TReduce]>; | ||
@@ -764,0 +588,0 @@ /** |
{ | ||
"name": "@types/d3-array", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"description": "TypeScript definitions for D3JS d3-array module", | ||
@@ -53,4 +53,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-array", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "b726461c161dc3709c25a27f1ef38ea716cddf66ac506ce6c98973ef82b3ad09", | ||
"typesPublisherContentHash": "0f5cadfe1257c06fe63e7b4f5ea59cb53f91401bea9fc7ef48b006c19de5c4fc", | ||
"typeScriptVersion": "4.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Tue, 22 Aug 2023 18:04:16 GMT | ||
* Last updated: Mon, 28 Aug 2023 19:03:02 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
49610
910