
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
@types/topo
Advanced tools
TypeScript definitions for topo
npm install --save @types/topo
This package contains type definitions for topo (https://github.com/hapijs/topo#readme).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/topo.
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[];
}
These definitions were written by BendingBender.
FAQs
TypeScript definitions for topo
The npm package @types/topo receives a total of 562 weekly downloads. As such, @types/topo popularity was classified as not popular.
We found that @types/topo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.