Skip to content
This repository was archived by the owner on Feb 27, 2025. It is now read-only.

Commit 5f1e061

Browse files
committed
chore: updating types
Signed-off-by: Pawel Psztyc <jarrodek@gmail.com>
1 parent 5646ec7 commit 5f1e061

17 files changed

Lines changed: 36 additions & 31 deletions

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@api-modeling/graphlib",
3-
"version": "3.0.2",
3+
"version": "3.0.3",
44
"description": "A directed and undirected multi-graph library",
55
"author": "Chris Pettitt <cpettitt@gmail.com>",
66
"license": "MIT",

src/alg/components.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ import { NodeIdentifier } from "../types";
99
* @argument graph - graph to find components in.
1010
* @returns array of nodes list representing components
1111
*/
12-
export default function components<N, E>(g: Graph<N, E>): NodeIdentifier[][];
12+
export default function components<G, N, E>(g: Graph<G, N, E>): NodeIdentifier[][];

src/alg/dfs.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ import { NodeIdentifier } from "../types";
99
*
1010
* Order must be one of "pre" or "post".
1111
*/
12-
export default function dfs<N, E>(g: Graph<N, E>, vs: NodeIdentifier|NodeIdentifier[], order: 'pre'|'post'): NodeIdentifier[];
12+
export default function dfs<G, N, E>(g: Graph<G, N, E>, vs: NodeIdentifier|NodeIdentifier[], order: 'pre'|'post'): NodeIdentifier[];

src/alg/dijkstra-all.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ import { Edge, NodePath, NodeIdentifier } from "../types.js";
1515
* for the purposes of shortest path traversal. By default this function uses the graph.outEdges.
1616
* @returns shortest paths map.
1717
*/
18-
export default function dijkstraAll<N, E>(g: Graph<N, E>, weightFunc?: (edge: Edge<E>) => number, edgeFunc?: (v: NodeIdentifier) => Edge<E>[]): Record<NodeIdentifier, Record<NodeIdentifier, NodePath>>;
18+
export default function dijkstraAll<G, N, E>(g: Graph<G, N, E>, weightFunc?: (edge: Edge<E>) => number, edgeFunc?: (v: NodeIdentifier) => Edge<E>[]): Record<NodeIdentifier, Record<NodeIdentifier, NodePath>>;

src/alg/dijkstra.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ import { Edge, NodePath, NodeIdentifier } from "../types";
1919
* for the purposes of shortest path traversal. By default this function uses the graph.outEdges.
2020
* @returns shortest pathes map that starts from node source
2121
*/
22-
export default function dijkstra<N, E>(g: Graph<N, E>, source: NodeIdentifier, weightFn?: ((edge: Edge<E>) => number), edgeFn?: ((v: NodeIdentifier) => Edge<E>[])): Record<NodeIdentifier, NodePath>;
22+
export default function dijkstra<G, N, E>(g: Graph<G, N, E>, source: NodeIdentifier, weightFn?: ((edge: Edge<E>) => number), edgeFn?: ((v: NodeIdentifier) => Edge<E>[])): Record<NodeIdentifier, NodePath>;

src/alg/find-cycles.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ import { NodeIdentifier } from "../types";
1212
* @argument graph - graph where to search cycles.
1313
* @returns cycles list.
1414
*/
15-
export default function findCycles<N, E>(g: Graph<N, E>): NodeIdentifier[][];
15+
export default function findCycles<G, N, E>(g: Graph<G, N, E>): NodeIdentifier[][];

src/alg/floyd-warshall.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ import { Edge, FloydWarshallResult, NodeIdentifier } from "../types";
2020
* for the purposes of shortest path traversal. By default this function uses the graph.outEdges.
2121
* @returns shortest pathes map.
2222
*/
23-
export default function floydWarshall<N, E>(g: Graph<N, E>, weightFn?: (edge: Edge<E>) => number, edgeFn?: (v: NodeIdentifier) => Edge<E>[]): FloydWarshallResult;
23+
export default function floydWarshall<G, N, E>(g: Graph<G, N, E>, weightFn?: (edge: Edge<E>) => number, edgeFn?: (v: NodeIdentifier) => Edge<E>[]): FloydWarshallResult;

src/alg/is-acyclic.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ import { Graph } from "../graph";
88
* @argument graph graph to detect whether it acyclic ot not.
99
* @returns whether graph contain cycles or not.
1010
*/
11-
export default function isAcyclic<N, E>(g: Graph<N, E>): boolean;
11+
export default function isAcyclic<G, N, E>(g: Graph<G, N, E>): boolean;

src/alg/postorder.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ import { NodeIdentifier } from "../types";
1010
* @argument vs - nodes list to traverse.
1111
* @returns the nodes in the order they were visited as a list of their names.
1212
*/
13-
export default function postOrder<N, E>(g: Graph<N, E>, vs: NodeIdentifier|NodeIdentifier[]): NodeIdentifier[];
13+
export default function postOrder<G, N, E>(g: Graph<G, N, E>, vs: NodeIdentifier|NodeIdentifier[]): NodeIdentifier[];

0 commit comments

Comments
 (0)