@types/topo
Advanced tools
Comparing version
@@ -32,6 +32,6 @@ // Type definitions for topo 3.0 | ||
options?: { | ||
group?: TGroup; | ||
before?: TGroup | TGroup[]; | ||
after?: TGroup | TGroup[]; | ||
sort?: number; | ||
group?: TGroup | undefined; | ||
before?: TGroup | TGroup[] | undefined; | ||
after?: TGroup | TGroup[] | undefined; | ||
sort?: number | undefined; | ||
} | ||
@@ -38,0 +38,0 @@ ): TNode[]; |
{ | ||
"name": "@types/topo", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "TypeScript definitions for topo", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/topo", | ||
"license": "MIT", | ||
@@ -14,11 +15,12 @@ "contributors": [ | ||
"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/topo" | ||
}, | ||
"scripts": {}, | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "42c6a2c5ac31f8c4d1eee714fb8c1ddc150a4da20bc5e3f4cf75cd26188fb597", | ||
"typeScriptVersion": "2.3" | ||
"typesPublisherContentHash": "1b4f685280d914b68f1adc61f2847ef89530aca32f0347c6025f28ccdcf48f24", | ||
"typeScriptVersion": "3.6" | ||
} |
@@ -8,6 +8,58 @@ # Installation | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/topo | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/topo. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/topo/index.d.ts) | ||
````ts | ||
// Type definitions for topo 3.0 | ||
// Project: https://github.com/hapijs/topo#readme | ||
// Definitions by: BendingBender <https://github.com/BendingBender> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
Additional Details | ||
* Last updated: Tue, 25 Dec 2018 05:33:16 GMT | ||
export = Topo; | ||
/** | ||
* The Topo object is the container for topologically sorting a list of nodes with non-circular interdependencies. | ||
*/ | ||
declare class Topo<TNode = any, TGroup = string> { | ||
/** | ||
* An array of the topologically sorted nodes. This list is renewed upon each call to `topo.add()`. | ||
*/ | ||
nodes: TNode[]; | ||
/** | ||
* Specifies an additional node or list of nodes to be topologically sorted. | ||
* | ||
* @param nodes a mixed value or array of mixed values to be added as nodes to the topologically sorted list. | ||
* @param options optional sorting information about the `nodes`: | ||
* - `group` - a string naming the group to which `nodes` should be assigned. The group name `'?'` is reserved. | ||
* - `before` - a string or array of strings specifying the groups that `nodes` must precede in the topological sort. | ||
* - `after` - a string or array of strings specifying the groups that `nodes` must succeed in the topological sort. | ||
* - `sort` - a numerical value used to sort items when performing a `topo.merge()`. | ||
* @returns an array of the topologically sorted nodes. | ||
*/ | ||
add( | ||
nodes: TNode | TNode[], | ||
options?: { | ||
group?: TGroup | undefined; | ||
before?: TGroup | TGroup[] | undefined; | ||
after?: TGroup | TGroup[] | undefined; | ||
sort?: number | undefined; | ||
} | ||
): TNode[]; | ||
/** | ||
* Merges another `Topo` object into the current object. | ||
* If the order in which items have been added to each list matters, use the `sort` option in `topo.add()` | ||
* with an incrementing value providing an absolute sort order among all items added to either object. | ||
* | ||
* @param others the other object or array of objects to be merged into the current one. `null` values are ignored. | ||
* @returns an array of the topologically sorted nodes. Will throw if a dependency error is found as a result of the combined items. | ||
*/ | ||
merge(others: Topo<TNode, TGroup> | Array<Topo<TNode, TGroup>>): TNode[]; | ||
} | ||
```` | ||
### Additional Details | ||
* Last updated: Fri, 02 Jul 2021 19:37:13 GMT | ||
* Dependencies: none | ||
@@ -17,2 +69,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by BendingBender <https://github.com/BendingBender>. | ||
These definitions were written by [BendingBender](https://github.com/BendingBender). |
Sorry, the diff of this file is not supported yet
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
7098
55.93%0
-100%69
305.88%