@types/topo
TypeScript definitions for topo
Last updated 5 years ago by types .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @types/topo 
SYNC missed versions from official npm registry.

Installation

npm install --save @types/topo

Summary

This package contains type definitions for topo (https://github.com/hapijs/topo#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/topo.

index.d.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

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
  • Global values: none

Credits

These definitions were written by BendingBender.

Current Tags

  • 3.0.1                                ...           latest (5 years ago)
  • 3.0.0                                ...           ts2.3 (7 years ago)
  • 3.0.0                                ...           ts2.4 (7 years ago)
  • 3.0.0                                ...           ts2.5 (7 years ago)
  • 3.0.0                                ...           ts2.6 (7 years ago)
  • 3.0.0                                ...           ts2.7 (7 years ago)
  • 3.0.0                                ...           ts2.8 (7 years ago)
  • 3.0.0                                ...           ts2.9 (7 years ago)
  • 3.0.0                                ...           ts3.0 (7 years ago)
  • 3.0.0                                ...           ts3.1 (7 years ago)
  • 3.0.0                                ...           ts3.2 (7 years ago)
  • 3.0.0                                ...           ts3.3 (7 years ago)
  • 3.0.0                                ...           ts3.4 (7 years ago)
  • 3.0.0                                ...           ts3.5 (7 years ago)
  • 3.0.1                                ...           ts3.6 (5 years ago)
  • 3.0.1                                ...           ts3.7 (5 years ago)
  • 3.0.1                                ...           ts3.8 (5 years ago)
  • 3.0.1                                ...           ts3.9 (5 years ago)
  • 3.0.1                                ...           ts4.0 (5 years ago)
  • 3.0.1                                ...           ts4.1 (5 years ago)
  • 3.0.1                                ...           ts4.2 (5 years ago)
  • 3.0.1                                ...           ts4.3 (5 years ago)
  • 3.0.1                                ...           ts4.4 (5 years ago)
  • 3.0.1                                ...           ts4.5 (5 years ago)
  • 3.0.1                                ...           ts4.6 (5 years ago)
  • 3.0.1                                ...           ts4.7 (5 years ago)
  • 3.0.1                                ...           ts4.8 (5 years ago)
  • 3.0.1                                ...           ts4.9 (5 years ago)
  • 3.0.1                                ...           ts5.0 (5 years ago)
  • 3.0.1                                ...           ts5.1 (5 years ago)

2 Versions

  • 3.0.1                                ...           5 years ago
  • 3.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org | Home |