@types/d3-hierarchy
Advanced tools
Comparing version 1.1.6 to 2.0.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for D3JS d3-hierarchy module 1.1 | ||
// Type definitions for D3JS d3-hierarchy module 2.0 | ||
// Project: https://github.com/d3/d3-hierarchy/, https://d3js.org/d3-hierarchy | ||
@@ -7,5 +7,6 @@ // Definitions by: Tom Wanzek <https://github.com/tomwanzek> | ||
// denisname <https://github.com/denisname> | ||
// Nathan Bierema <https://github.com/Methuselah96> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// Last module patch version validated against: 1.1.6 | ||
// Last module patch version validated against: 2.0.0 | ||
@@ -80,2 +81,8 @@ // ----------------------------------------------------------------------- | ||
/** | ||
* Returns the first node in the hierarchy from this node for which the specified filter returns a truthy value. undefined if no such node is found. | ||
* @param filter Filter. | ||
*/ | ||
find(filter: (node: this) => boolean): this | undefined; | ||
/** | ||
* Returns the shortest path through the hierarchy from this node to the specified target node. | ||
@@ -120,2 +127,7 @@ * The path starts at this node, ascends to the least common ancestor of this node and the target node, and then descends to the target node. | ||
/** | ||
* Returns an iterator over the node’s descendants in breadth-first order. | ||
*/ | ||
[Symbol.iterator](): Iterator<this>; | ||
/** | ||
* Invokes the specified function for node and each descendant in breadth-first order, | ||
@@ -125,5 +137,6 @@ * such that a given node is only visited if all nodes of lesser depth have already been visited, | ||
* | ||
* @param func The specified function is passed the current node. | ||
* @param func The specified function is passed the current descendant, the zero-based traversal index, and this node. | ||
* @param that If that is specified, it is the this context of the callback. | ||
*/ | ||
each(func: (node: this) => void): this; | ||
each<T = undefined>(func: (this: T, node: this, index: number, thisNode: this) => void, that?: T): this; | ||
@@ -134,5 +147,7 @@ /** | ||
* | ||
* @param func The specified function is passed the current node. | ||
* @param func The specified function is passed the current descendant, the zero-based traversal index, and this node. | ||
* @param that If that is specified, it is the this context of the callback. | ||
* | ||
*/ | ||
eachAfter(func: (node: this) => void): this; | ||
eachAfter<T = undefined>(func: (this: T, node: this, index: number, thisNode: this) => void, that?: T): this; | ||
@@ -143,5 +158,6 @@ /** | ||
* | ||
* @param func The specified function is passed the current node. | ||
* @param func The specified function is passed the current descendant, the zero-based traversal index, and this node. | ||
* @param that If that is specified, it is the this context of the callback. | ||
*/ | ||
eachBefore(func: (node: this) => void): this; | ||
eachBefore<T = undefined>(func: (this: T, node: this, index: number, thisNode: this) => void, that?: T): this; | ||
@@ -159,7 +175,9 @@ /** | ||
* @param data The root specified data. | ||
* @param children The specified children accessor function invoked for each datum, starting with the root data. | ||
* Must return an array of data representing the children, and return null or undefined if the current datum has no children. | ||
* If *data* is a Map, it is implicitly converted to the entry [undefined, *data*], | ||
* and the children accessor instead defaults to `(d) => Array.isArray(d) ? d[1] : null;`. | ||
* @param children The specified children accessor function is invoked for each datum, starting with the root data, | ||
* and must return an iterable of data representing the children, if any. | ||
* If children is not specified, it defaults to: `(d) => d.children`. | ||
*/ | ||
export function hierarchy<Datum>(data: Datum, children?: (d: Datum) => (Datum[] | null | undefined)): HierarchyNode<Datum>; | ||
export function hierarchy<Datum>(data: Datum, children?: (d: Datum) => (Iterable<Datum> | null | undefined)): HierarchyNode<Datum>; | ||
@@ -166,0 +184,0 @@ // ----------------------------------------------------------------------- |
{ | ||
"name": "@types/d3-hierarchy", | ||
"version": "1.1.6", | ||
"version": "2.0.0", | ||
"description": "TypeScript definitions for D3JS d3-hierarchy module", | ||
@@ -26,14 +26,20 @@ "license": "MIT", | ||
"githubUsername": "denisname" | ||
}, | ||
{ | ||
"name": "Nathan Bierema", | ||
"url": "https://github.com/Methuselah96", | ||
"githubUsername": "Methuselah96" | ||
} | ||
], | ||
"main": "", | ||
"types": "index", | ||
"types": "index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
"directory": "types/d3-hierarchy" | ||
}, | ||
"scripts": {}, | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "604b39ea6f11e194f694a965c7075233a7088d98135a555924a7e77030e2dff4", | ||
"typeScriptVersion": "2.0" | ||
"typesPublisherContentHash": "cfe92c70e946538e00274633e3a290ba14b60ad16f3d3231aa62fe19bf2c12b2", | ||
"typeScriptVersion": "3.2" | ||
} |
@@ -5,9 +5,9 @@ # Installation | ||
# Summary | ||
This package contains type definitions for D3JS d3-hierarchy module ( https://github.com/d3/d3-hierarchy/ ). | ||
This package contains type definitions for D3JS d3-hierarchy module (https://github.com/d3/d3-hierarchy/). | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-hierarchy | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-hierarchy. | ||
Additional Details | ||
* Last updated: Wed, 13 Feb 2019 17:05:43 GMT | ||
### Additional Details | ||
* Last updated: Wed, 30 Sep 2020 00:01:32 GMT | ||
* Dependencies: none | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>, denisname <https://github.com/denisname>. | ||
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96). |
Sorry, the diff of this file is not supported yet
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
38202
770