@hpcc-js/util 2.37.0 → 2.41.0

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.
@@ -1,7 +1,8 @@
1
+ declare type ID = string | number;
1
2
  declare class GraphItem<T = any> {
2
3
  protected _graph: Graph2;
3
4
  _: T;
4
- id(): string;
5
+ id(): ID;
5
6
  constructor(g: Graph2, _: T);
6
7
  }
7
8
  declare class ChildGraphItem<S = any> extends GraphItem<S> {
@@ -26,10 +27,10 @@ declare class Vertex<V = any> extends ChildGraphItem<V> {
26
27
  edgeCount(): number;
27
28
  inEdges(): Edge<any>[];
28
29
  addInEdge(e: Edge): void;
29
- removeInEdge(id: string): void;
30
+ removeInEdge(id: ID): void;
30
31
  outEdges(): Edge<any>[];
31
32
  addOutEdge(e: Edge): void;
32
- removeOutEdge(id: string): void;
33
+ removeOutEdge(id: ID): void;
33
34
  }
34
35
  declare class Edge<E = any> extends ChildGraphItem<E> {
35
36
  _source: Vertex;
@@ -48,57 +49,57 @@ export declare class Graph2<V = any, E = any, S = any> {
48
49
  isDirected(): boolean;
49
50
  _idFunc: (_: any) => string;
50
51
  idFunc(_: (_: S | V | E) => string): this;
51
- _sourceFunc: (_: any) => string;
52
- sourceFunc(_: (_: E) => string): this;
53
- _targetFunc: (_: any) => string;
54
- targetFunc(_: (_: E) => string): this;
52
+ _sourceFunc: (_: any) => ID;
53
+ sourceFunc(_: (_: E) => ID): this;
54
+ _targetFunc: (_: any) => ID;
55
+ targetFunc(_: (_: E) => ID): this;
55
56
  _updateFunc: (before: S | V | E, after: S | V | E) => S | V | E;
56
57
  updateFunc(_: (before: S | V | E, after: S | V | E) => S | V | E): this;
57
58
  id(_: S | V | E): string;
58
- type(id: string): "S" | "V" | "E" | "";
59
+ type(id: ID): "S" | "V" | "E" | "";
59
60
  isSubgraph(_: S | V | E): _ is S;
60
61
  isVertex(_: S | V | E): _ is V;
61
62
  isEdge(_: S | V | E): _ is E;
62
63
  allItems(): Array<S | V | E>;
63
- item(id: string): S | V | E | undefined;
64
- itemExists(id: string): boolean;
64
+ item(id: ID): S | V | E | undefined;
65
+ itemExists(id: ID): boolean;
65
66
  allSubgraphs(): S[];
66
67
  subgraphs(): S[];
67
- subgraphExists(id: string): boolean;
68
- subgraph(id: string): S;
69
- subgraphSubgraphs(id: string): S[];
70
- subgraphVertices(id: string): V[];
71
- subgraphEdges(id: string): E[];
68
+ subgraphExists(id: ID): boolean;
69
+ subgraph(id: ID): S;
70
+ subgraphSubgraphs(id: ID): S[];
71
+ subgraphVertices(id: ID): V[];
72
+ subgraphEdges(id: ID): E[];
72
73
  addSubgraph(s: S, parent?: S): this;
73
74
  mergeSubgraphs(_subgraphs?: S[]): this;
74
75
  updateSubgraph(sg: S): this;
75
- removeSubgraph(id: string, promoteChildren?: boolean): this;
76
- subgraphParent(id: string): S | undefined;
77
- subgraphParent(id: string, parentID: string): this;
76
+ removeSubgraph(id: ID, promoteChildren?: boolean): this;
77
+ subgraphParent(id: ID): S | undefined;
78
+ subgraphParent(id: ID, parentID: ID): this;
78
79
  allVertices(): V[];
79
80
  vertices(): V[];
80
- vertexExists(id: string): boolean;
81
- vertex(id: string): V;
81
+ vertexExists(id: ID): boolean;
82
+ vertex(id: ID): V;
82
83
  allEdges(): E[];
83
84
  edges(): E[];
84
85
  vertexEdges(vertexID: string): E[];
85
86
  inEdges(vertexID: string): E[];
86
87
  outEdges(vertexID: string): E[];
87
88
  private _neighbors;
88
- neighbors(id: string): V[];
89
- singleNeighbors(id: string): V[];
89
+ neighbors(id: ID): V[];
90
+ singleNeighbors(id: ID): V[];
90
91
  addVertex(v: V, parent?: S): this;
91
92
  mergeVertices(_vertices: V[]): this;
92
93
  updateVertex(v: V): this;
93
- removeVertex(id: string): this;
94
- vertexParent(id: string): S | undefined;
95
- vertexParent(id: string, parentID: string): this;
96
- edgeExists(id: string): boolean;
97
- edge(id: string): E;
94
+ removeVertex(id: ID): this;
95
+ vertexParent(id: ID): S | undefined;
96
+ vertexParent(id: ID, parentID: ID): this;
97
+ edgeExists(id: ID): boolean;
98
+ edge(id: ID): E;
98
99
  addEdge(e: E, parent?: S): this;
99
100
  mergeEdges(_edges: E[]): this;
100
101
  updateEdge(e: E): this;
101
- removeEdge(id: string): this;
102
+ removeEdge(id: ID): this;
102
103
  protected _hwalk(item: Subgraph<S> | Vertex<V>, formatter: HierarchyFormatter<V, S>): object;
103
104
  hierarchy(formatter: HierarchyFormatter<V, S>): object[];
104
105
  dijkstra(source: string, target: string): {
@@ -1,2 +1,3 @@
1
- export declare function join(...args: string[]): string;
1
+ export declare function join(...segments: string[]): string;
2
+ export declare function dirname(path: string): string;
2
3
  //# sourceMappingURL=url.d.ts.map