@babsey/code-graph 0.9.2 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/code-graph.js +2230 -2176
- package/dist/code-graph.umd.cjs +8 -8
- package/dist/codeEngine/topologicalSorting.d.ts +22 -0
- package/package.json +3 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IConnection } from '@baklavajs/core';
|
|
2
|
+
import { AbstractCodeNode } from '../codeNode';
|
|
3
|
+
import { CodeGraph } from '../codeGraph';
|
|
4
|
+
export interface ITopologicalSortingResult {
|
|
5
|
+
calculationOrder: AbstractCodeNode[];
|
|
6
|
+
connectionsFromNode: Map<AbstractCodeNode, IConnection[]>;
|
|
7
|
+
/** NodeInterface.id -> parent Node.id */
|
|
8
|
+
interfaceIdToNodeId: Map<string, string>;
|
|
9
|
+
}
|
|
10
|
+
export declare class CycleError extends Error {
|
|
11
|
+
constructor();
|
|
12
|
+
}
|
|
13
|
+
/** Uses Kahn's algorithm to topologically sort the nodes in the graph */
|
|
14
|
+
export declare function sortTopologically(graph: CodeGraph): ITopologicalSortingResult;
|
|
15
|
+
/** Uses Kahn's algorithm to topologically sort the nodes in the graph */
|
|
16
|
+
export declare function sortTopologically(nodes: ReadonlyArray<AbstractCodeNode>, connections: ReadonlyArray<IConnection>): ITopologicalSortingResult;
|
|
17
|
+
/** This overload is only used for internal purposes */
|
|
18
|
+
export declare function sortTopologically(nodesorGraph: ReadonlyArray<AbstractCodeNode> | CodeGraph, connections?: ReadonlyArray<IConnection>): ITopologicalSortingResult;
|
|
19
|
+
/** Checks whether a graph contains a cycle */
|
|
20
|
+
export declare function containsCycle(graph: CodeGraph): boolean;
|
|
21
|
+
/** Checks whether the provided set of nodes and connections contains a cycle */
|
|
22
|
+
export declare function containsCycle(nodes: ReadonlyArray<AbstractCodeNode>, connections: ReadonlyArray<IConnection>): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babsey/code-graph",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"author": "babsey <spreizer@web.de>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"@vue/language-core": "~3.2",
|
|
56
56
|
"@vue/tsconfig": "~0.8",
|
|
57
57
|
"eslint": "~9.39",
|
|
58
|
-
"eslint-plugin-vue": "~10.
|
|
58
|
+
"eslint-plugin-vue": "~10.7",
|
|
59
59
|
"jiti": "~2.6",
|
|
60
60
|
"npm-run-all2": "~8.0",
|
|
61
|
-
"prettier": "~3.
|
|
61
|
+
"prettier": "~3.8",
|
|
62
62
|
"rimraf": "~6.1",
|
|
63
63
|
"sass-embedded": "~1.97",
|
|
64
64
|
"typescript": "~5.9",
|