@likec4/core 1.40.0 → 1.42.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.
Files changed (257) hide show
  1. package/builder/package.json +4 -0
  2. package/compute-view/package.json +4 -0
  3. package/compute-view/relationships/package.json +4 -0
  4. package/dist/builder/index.d.mts +83 -20
  5. package/dist/builder/index.mjs +210 -126
  6. package/dist/compute-view/index.d.mts +8 -7
  7. package/dist/compute-view/index.mjs +14 -11
  8. package/dist/compute-view/relationships-view/index.d.mts +9 -8
  9. package/dist/compute-view/relationships-view/index.mjs +6 -6
  10. package/dist/index.d.mts +7 -7
  11. package/dist/index.mjs +12 -12
  12. package/dist/model/connection/deployment/index.d.mts +11 -10
  13. package/dist/model/connection/deployment/index.mjs +2 -2
  14. package/dist/model/connection/index.d.mts +12 -11
  15. package/dist/model/connection/index.mjs +3 -3
  16. package/dist/model/connection/model/index.d.mts +11 -10
  17. package/dist/model/connection/model/index.mjs +2 -2
  18. package/dist/model/index.d.mts +14 -14
  19. package/dist/model/index.mjs +4 -5
  20. package/dist/shared/{core.DHQ32OHa.mjs → core.01VTr9qu.mjs} +10 -29
  21. package/dist/shared/core.1vX5a9AY.mjs +86 -0
  22. package/dist/shared/{core.BVNaR17u.mjs → core.B7KhhkRY.mjs} +1 -1
  23. package/dist/shared/core.B85MJLTf.mjs +5 -0
  24. package/dist/shared/{core.BIAlzwKc.mjs → core.BIqHjQiH.mjs} +85 -45
  25. package/dist/shared/core.BKlholso.mjs +3 -0
  26. package/dist/shared/core.BR4zXDH-.mjs +13 -0
  27. package/dist/shared/{core.yHe79zEl.mjs → core.BYNkXQ8A.mjs} +21 -12
  28. package/dist/shared/core.BazD6cot.mjs +14 -0
  29. package/dist/shared/{core.BuoXfSMj.mjs → core.BbE4y-yl.mjs} +1 -1
  30. package/dist/shared/core.BoYfZOBm.mjs +3 -0
  31. package/dist/shared/core.BsSXS-_R.mjs +7 -0
  32. package/dist/shared/{core.T-eLZTW_.mjs → core.BzTakU3I.mjs} +15 -7
  33. package/dist/shared/{core.4u1dVmfX.mjs → core.C2TiyjI6.mjs} +2 -2
  34. package/dist/shared/{core.DLpidoWc.mjs → core.C3JowhaZ.mjs} +3 -3
  35. package/dist/shared/{core.CNGyqkJh.mjs → core.C4x8aaWa.mjs} +3 -1
  36. package/dist/shared/{core.BB6zA-UU.mjs → core.C8YY6Uub.mjs} +38 -9
  37. package/dist/shared/{core.FPITT8Vx.mjs → core.C8sl5Y8Z.mjs} +144 -61
  38. package/dist/shared/{core.DuR3R-xJ.mjs → core.CNgZvKb8.mjs} +3 -5176
  39. package/dist/shared/{core.BbThmf6M.d.mts → core.CQngdcuj.d.mts} +85 -4
  40. package/dist/shared/{core.Be1n9a0i.mjs → core.C_Ni6yHl.mjs} +5 -4
  41. package/dist/shared/core.CbT8JVYL.mjs +5 -0
  42. package/dist/shared/core.CqAJJpK_.mjs +3 -0
  43. package/dist/shared/{core.CySf-2gP.d.mts → core.D0PjZzIS.d.mts} +52 -15
  44. package/dist/shared/{core.DrvfVXkh.d.mts → core.D5fzJWbF.d.mts} +11 -2
  45. package/dist/shared/{core.DrVOJuxX.d.mts → core.DACpKp35.d.mts} +5 -5
  46. package/dist/shared/core.DFi2dOTl.mjs +39548 -0
  47. package/dist/shared/{core.D704WZES.d.mts → core.DIol3syK.d.mts} +2 -2
  48. package/dist/shared/{core.DlG1xWt2.mjs → core.DMMOWQqc.mjs} +3 -2
  49. package/dist/shared/core.DNbUPnve.mjs +3990 -0
  50. package/dist/shared/{core.CCD1ID81.mjs → core.DRJma0Ol.mjs} +4 -3
  51. package/dist/shared/{core.DgttqsJc.mjs → core.DRhg-gVU.mjs} +9 -9
  52. package/dist/shared/core.DSO_rTC2.mjs +5322 -0
  53. package/dist/shared/{core.vWJTxpLV.d.mts → core.D_vkffV4.d.mts} +4 -2
  54. package/dist/shared/core.DdMJk7nx.d.mts +476 -0
  55. package/dist/shared/{core.D_fI5Lf6.d.mts → core.Dgs6-nuz.d.mts} +24 -4
  56. package/dist/shared/{core.Be4Jy9Qx.mjs → core.FZ305VYd.mjs} +2 -2
  57. package/dist/shared/core.OHD4KXm9.mjs +5 -0
  58. package/dist/shared/{core.GTgsmXS_.mjs → core.QJD_fcrc.mjs} +2 -2
  59. package/dist/shared/core.RfnaEmgA.mjs +7 -0
  60. package/dist/shared/core.fHR_8Tnq.d.mts +450 -0
  61. package/dist/shared/{core.D0EgVMQK.mjs → core.lRvxPoao.mjs} +14 -12
  62. package/dist/shared/{core.CaT0SUUK.mjs → core.rCeaAqgW.mjs} +1 -84
  63. package/dist/shared/{core.kxeJe0OY.d.mts → core.s9uwOt60.d.mts} +4 -4
  64. package/dist/shared/core.yna0OdV5.d.mts +98 -0
  65. package/dist/styles/index.d.mts +106 -0
  66. package/dist/styles/index.mjs +1 -0
  67. package/dist/types/_aux.d.mts +2 -2
  68. package/dist/types/_aux.mjs +1 -5
  69. package/dist/types/expression-model.d.mts +3 -4
  70. package/dist/types/expression.d.mts +3 -4
  71. package/dist/types/fqnRef.d.mts +2 -2
  72. package/dist/types/fqnRef.mjs +3 -3
  73. package/dist/types/index.d.mts +8 -8
  74. package/dist/types/index.mjs +151 -6
  75. package/dist/types/scalar.mjs +3 -2
  76. package/dist/utils/graphology/index.d.mts +1864 -0
  77. package/dist/utils/graphology/index.mjs +1 -0
  78. package/dist/utils/index.d.mts +11 -6
  79. package/dist/utils/index.mjs +21 -37
  80. package/dist/utils/iterable/index.d.mts +1 -1
  81. package/dist/utils/iterable/index.mjs +45 -7
  82. package/model/package.json +4 -0
  83. package/package.json +42 -24
  84. package/styles/package.json +4 -0
  85. package/types/package.json +4 -0
  86. package/utils/graphology/package.json +4 -0
  87. package/utils/package.json +4 -0
  88. package/dist/shared/core.6_Vp2iiN.mjs +0 -172
  89. package/dist/shared/core.Bpou6c2f.d.mts +0 -850
  90. package/dist/shared/core.CUw_2J9j.mjs +0 -47
  91. package/dist/shared/core.CzdwsPmY.d.mts +0 -69
  92. package/dist/shared/core.DoM6aM9N.mjs +0 -7
  93. package/dist/shared/core.ILwny7BV.mjs +0 -38
  94. package/dist/theme/index.d.mts +0 -11
  95. package/dist/theme/index.mjs +0 -232
  96. package/src/builder/Builder.deployment.ts +0 -224
  97. package/src/builder/Builder.deploymentModel.ts +0 -449
  98. package/src/builder/Builder.element.ts +0 -241
  99. package/src/builder/Builder.model.ts +0 -494
  100. package/src/builder/Builder.ts +0 -870
  101. package/src/builder/Builder.view-common.ts +0 -273
  102. package/src/builder/Builder.view-deployment.ts +0 -135
  103. package/src/builder/Builder.view-element.ts +0 -202
  104. package/src/builder/Builder.views.ts +0 -399
  105. package/src/builder/Builder.with.ts +0 -156
  106. package/src/builder/_types.ts +0 -320
  107. package/src/builder/index.ts +0 -11
  108. package/src/compute-view/compute-view.ts +0 -80
  109. package/src/compute-view/deployment-view/_types.ts +0 -38
  110. package/src/compute-view/deployment-view/clean-connections.ts +0 -236
  111. package/src/compute-view/deployment-view/compute.ts +0 -94
  112. package/src/compute-view/deployment-view/memory/index.ts +0 -9
  113. package/src/compute-view/deployment-view/memory/memory.ts +0 -96
  114. package/src/compute-view/deployment-view/predicates/deploymentRefs-where.ts +0 -18
  115. package/src/compute-view/deployment-view/predicates/deploymentRefs.ts +0 -154
  116. package/src/compute-view/deployment-view/predicates/index.ts +0 -8
  117. package/src/compute-view/deployment-view/predicates/relation-direct.ts +0 -243
  118. package/src/compute-view/deployment-view/predicates/relation-in-out.ts +0 -70
  119. package/src/compute-view/deployment-view/predicates/relation-incoming.ts +0 -101
  120. package/src/compute-view/deployment-view/predicates/relation-outgoing.ts +0 -95
  121. package/src/compute-view/deployment-view/predicates/relation-where.ts +0 -18
  122. package/src/compute-view/deployment-view/predicates/utils.ts +0 -282
  123. package/src/compute-view/deployment-view/predicates/wildcard.ts +0 -41
  124. package/src/compute-view/deployment-view/stages/stage-exclude.ts +0 -5
  125. package/src/compute-view/deployment-view/stages/stage-final.ts +0 -245
  126. package/src/compute-view/deployment-view/stages/stage-include.ts +0 -95
  127. package/src/compute-view/deployment-view/utils.ts +0 -286
  128. package/src/compute-view/dynamic-view/compute.ts +0 -312
  129. package/src/compute-view/element-view/_types.ts +0 -47
  130. package/src/compute-view/element-view/clean-connections.ts +0 -117
  131. package/src/compute-view/element-view/compute.ts +0 -324
  132. package/src/compute-view/element-view/memory/NodeGroup.ts +0 -31
  133. package/src/compute-view/element-view/memory/index.ts +0 -10
  134. package/src/compute-view/element-view/memory/memory.ts +0 -178
  135. package/src/compute-view/element-view/memory/stage-exclude.ts +0 -59
  136. package/src/compute-view/element-view/memory/stage-final.ts +0 -129
  137. package/src/compute-view/element-view/memory/stage-include.ts +0 -130
  138. package/src/compute-view/element-view/predicates/_utils.ts +0 -91
  139. package/src/compute-view/element-view/predicates/element-expand.ts +0 -29
  140. package/src/compute-view/element-view/predicates/element-kind-tag.ts +0 -27
  141. package/src/compute-view/element-view/predicates/element-ref.ts +0 -24
  142. package/src/compute-view/element-view/predicates/relation-direct.ts +0 -321
  143. package/src/compute-view/element-view/predicates/relation-in-out.ts +0 -64
  144. package/src/compute-view/element-view/predicates/relation-in.ts +0 -115
  145. package/src/compute-view/element-view/predicates/relation-out.ts +0 -119
  146. package/src/compute-view/element-view/predicates/wildcard.ts +0 -88
  147. package/src/compute-view/element-view/utils.ts +0 -65
  148. package/src/compute-view/index.ts +0 -4
  149. package/src/compute-view/memory/AbstractMemory.ts +0 -45
  150. package/src/compute-view/memory/AbstractStageExclude.ts +0 -215
  151. package/src/compute-view/memory/AbstractStageInclude.ts +0 -200
  152. package/src/compute-view/memory/_types.ts +0 -148
  153. package/src/compute-view/memory/index.ts +0 -5
  154. package/src/compute-view/memory/ops.ts +0 -43
  155. package/src/compute-view/relationships-view/_types.ts +0 -16
  156. package/src/compute-view/relationships-view/compute.ts +0 -159
  157. package/src/compute-view/relationships-view/index.ts +0 -3
  158. package/src/compute-view/relationships-view/layout.ts +0 -357
  159. package/src/compute-view/relationships-view/utils.ts +0 -73
  160. package/src/compute-view/utils/ancestorsOfNode.ts +0 -19
  161. package/src/compute-view/utils/applyCustomElementProperties.ts +0 -107
  162. package/src/compute-view/utils/applyCustomRelationProperties.ts +0 -58
  163. package/src/compute-view/utils/applyViewRuleStyles.ts +0 -73
  164. package/src/compute-view/utils/buildComputedNodes.ts +0 -153
  165. package/src/compute-view/utils/buildElementNotations.ts +0 -63
  166. package/src/compute-view/utils/elementExpressionToPredicate.ts +0 -50
  167. package/src/compute-view/utils/link-nodes-with-edges.ts +0 -56
  168. package/src/compute-view/utils/merge-props-from-relationships.ts +0 -161
  169. package/src/compute-view/utils/relationExpressionToPredicates.ts +0 -55
  170. package/src/compute-view/utils/resolve-extended-views.ts +0 -85
  171. package/src/compute-view/utils/resolve-global-rules.ts +0 -88
  172. package/src/compute-view/utils/topological-sort.ts +0 -256
  173. package/src/compute-view/utils/view-hash.ts +0 -45
  174. package/src/compute-view/utils/with-readable-edges.ts +0 -40
  175. package/src/index.ts +0 -32
  176. package/src/model/DeploymentElementModel.ts +0 -682
  177. package/src/model/DeploymentModel.ts +0 -393
  178. package/src/model/ElementModel.ts +0 -293
  179. package/src/model/LikeC4Model.ts +0 -882
  180. package/src/model/RelationModel.ts +0 -152
  181. package/src/model/connection/Connection.ts +0 -72
  182. package/src/model/connection/deployment/DeploymentConnectionModel.ts +0 -185
  183. package/src/model/connection/deployment/find.ts +0 -120
  184. package/src/model/connection/deployment/index.ts +0 -8
  185. package/src/model/connection/index.ts +0 -22
  186. package/src/model/connection/model/ConnectionModel.ts +0 -158
  187. package/src/model/connection/model/find.ts +0 -117
  188. package/src/model/connection/model/index.ts +0 -8
  189. package/src/model/connection/ops.ts +0 -276
  190. package/src/model/guards.ts +0 -77
  191. package/src/model/index.ts +0 -72
  192. package/src/model/types.ts +0 -67
  193. package/src/model/utils.ts +0 -66
  194. package/src/model/view/EdgeModel.ts +0 -120
  195. package/src/model/view/LikeC4ViewModel.ts +0 -361
  196. package/src/model/view/LikeC4ViewsFolder.ts +0 -151
  197. package/src/model/view/NodeModel.ts +0 -247
  198. package/src/theme/element.ts +0 -61
  199. package/src/theme/index.ts +0 -127
  200. package/src/theme/relationships.ts +0 -54
  201. package/src/types/RichText.ts +0 -206
  202. package/src/types/_aux.ts +0 -291
  203. package/src/types/_common.ts +0 -80
  204. package/src/types/const.ts +0 -34
  205. package/src/types/expression-model.ts +0 -294
  206. package/src/types/expression.ts +0 -313
  207. package/src/types/fqnRef.ts +0 -91
  208. package/src/types/geometry.ts +0 -159
  209. package/src/types/global.ts +0 -21
  210. package/src/types/index.ts +0 -42
  211. package/src/types/model-data.ts +0 -77
  212. package/src/types/model-deployment.ts +0 -88
  213. package/src/types/model-dump.ts +0 -79
  214. package/src/types/model-logical.ts +0 -135
  215. package/src/types/model-spec.ts +0 -85
  216. package/src/types/operators.ts +0 -156
  217. package/src/types/project.ts +0 -14
  218. package/src/types/scalar.ts +0 -162
  219. package/src/types/styles.ts +0 -122
  220. package/src/types/view-changes.ts +0 -32
  221. package/src/types/view-common.ts +0 -157
  222. package/src/types/view-computed.ts +0 -118
  223. package/src/types/view-layouted.ts +0 -98
  224. package/src/types/view-parsed.deployment.ts +0 -39
  225. package/src/types/view-parsed.dynamic.ts +0 -89
  226. package/src/types/view-parsed.element.ts +0 -65
  227. package/src/types/view.ts +0 -113
  228. package/src/utils/common-head.ts +0 -22
  229. package/src/utils/compare-natural.ts +0 -60
  230. package/src/utils/const.ts +0 -1
  231. package/src/utils/fqn.ts +0 -302
  232. package/src/utils/getOrCreate.ts +0 -8
  233. package/src/utils/guards.ts +0 -9
  234. package/src/utils/index.ts +0 -68
  235. package/src/utils/invariant.ts +0 -29
  236. package/src/utils/iterable/_types.ts +0 -5
  237. package/src/utils/iterable/filter.ts +0 -55
  238. package/src/utils/iterable/find.ts +0 -38
  239. package/src/utils/iterable/first.ts +0 -48
  240. package/src/utils/iterable/flat.ts +0 -17
  241. package/src/utils/iterable/head.ts +0 -22
  242. package/src/utils/iterable/index.ts +0 -15
  243. package/src/utils/iterable/map.ts +0 -40
  244. package/src/utils/iterable/reduce.ts +0 -24
  245. package/src/utils/iterable/some.ts +0 -36
  246. package/src/utils/iterable/to.ts +0 -19
  247. package/src/utils/iterable/unique.ts +0 -23
  248. package/src/utils/markdown/index.ts +0 -2
  249. package/src/utils/markdown/to-html.ts +0 -32
  250. package/src/utils/markdown/to-text.ts +0 -14
  251. package/src/utils/memoize-prop.ts +0 -30
  252. package/src/utils/mnemonist.ts +0 -9
  253. package/src/utils/object-hash.ts +0 -14
  254. package/src/utils/promises.ts +0 -24
  255. package/src/utils/relations.ts +0 -36
  256. package/src/utils/set.ts +0 -83
  257. package/src/utils/string-hash.ts +0 -16
@@ -0,0 +1,1864 @@
1
+ /**
2
+ * Graphology Typings
3
+ * ===================
4
+ *
5
+ * Graphology TypeScript declaration.
6
+ */
7
+
8
+ /**
9
+ * Miscellaneous types.
10
+ */
11
+ type Attributes = {[name: string]: any};
12
+
13
+ type GraphType = 'mixed' | 'directed' | 'undirected';
14
+
15
+ type UpdateHints<ItemAttributes extends Attributes = Attributes> = {
16
+ attributes?: Array<keyof ItemAttributes>;
17
+ };
18
+
19
+ type GraphOptions = {
20
+ allowSelfLoops?: boolean;
21
+ multi?: boolean;
22
+ type?: GraphType;
23
+ };
24
+
25
+ type NodeEntry<NodeAttributes extends Attributes = Attributes> = {
26
+ node: string;
27
+ attributes: NodeAttributes;
28
+ };
29
+
30
+ type NodeMergeResult = [key: string, nodeWasAdded: boolean];
31
+
32
+ type NeighborEntry<NodeAttributes extends Attributes = Attributes> = {
33
+ neighbor: string;
34
+ attributes: NodeAttributes;
35
+ };
36
+
37
+ type EdgeEntry<
38
+ NodeAttributes extends Attributes = Attributes,
39
+ EdgeAttributes extends Attributes = Attributes
40
+ > = {
41
+ edge: string;
42
+ attributes: EdgeAttributes;
43
+ source: string;
44
+ target: string;
45
+ sourceAttributes: NodeAttributes;
46
+ targetAttributes: NodeAttributes;
47
+ undirected: boolean;
48
+ };
49
+
50
+ type EdgeMergeResult = [
51
+ key: string,
52
+ edgeWasAdded: boolean,
53
+ sourceWasAdded: boolean,
54
+ targetWasAdded: boolean
55
+ ];
56
+
57
+ type AdjacencyIterationCallback<
58
+ NodeAttributes extends Attributes = Attributes,
59
+ EdgeAttributes extends Attributes = Attributes
60
+ > = (
61
+ node: string,
62
+ neighbor: string,
63
+ nodeAttributes: NodeAttributes,
64
+ neighborAttributes: NodeAttributes,
65
+ edge: string,
66
+ edgeAttributes: EdgeAttributes,
67
+ undirected: boolean
68
+ ) => void;
69
+
70
+ type AdjacencyIterationCallbackWithOrphans<
71
+ NodeAttributes extends Attributes = Attributes,
72
+ EdgeAttributes extends Attributes = Attributes
73
+ > = (
74
+ node: string,
75
+ neighbor: string | null,
76
+ nodeAttributes: NodeAttributes,
77
+ neighborAttributes: NodeAttributes | null,
78
+ edge: string | null,
79
+ edgeAttributes: EdgeAttributes | null,
80
+ undirected: boolean | null
81
+ ) => void;
82
+
83
+ type NodeIterationCallback<NodeAttributes extends Attributes = Attributes> = (
84
+ node: string,
85
+ attributes: NodeAttributes
86
+ ) => void;
87
+
88
+ type NodePredicate<NodeAttributes extends Attributes = Attributes> = (
89
+ node: string,
90
+ attributes: NodeAttributes
91
+ ) => boolean | void;
92
+
93
+ type NodeMapper<T, NodeAttributes extends Attributes = Attributes> = (
94
+ node: string,
95
+ attributes: NodeAttributes
96
+ ) => T;
97
+
98
+ type NodeReducer<T, NodeAttributes extends Attributes = Attributes> = (
99
+ accumulator: T,
100
+ node: string,
101
+ attributes: NodeAttributes
102
+ ) => T;
103
+
104
+ type NeighborIterationCallback<NodeAttributes extends Attributes = Attributes> =
105
+ (neighbor: string, attributes: NodeAttributes) => void;
106
+
107
+ type NeighborPredicate<NodeAttributes extends Attributes = Attributes> = (
108
+ neighbor: string,
109
+ attributes: NodeAttributes
110
+ ) => boolean | void;
111
+
112
+ type NeighborMapper<T, NodeAttributes extends Attributes = Attributes> = (
113
+ neighbor: string,
114
+ attributes: NodeAttributes
115
+ ) => T;
116
+
117
+ type NeighborReducer<T, NodeAttributes extends Attributes = Attributes> = (
118
+ accumulator: T,
119
+ neighbor: string,
120
+ attributes: NodeAttributes
121
+ ) => T;
122
+
123
+ type EdgeIterationCallback<
124
+ NodeAttributes extends Attributes = Attributes,
125
+ EdgeAttributes extends Attributes = Attributes
126
+ > = (
127
+ edge: string,
128
+ attributes: EdgeAttributes,
129
+ source: string,
130
+ target: string,
131
+ sourceAttributes: NodeAttributes,
132
+ targetAttributes: NodeAttributes,
133
+ undirected: boolean
134
+ ) => void;
135
+
136
+ type EdgePredicate<
137
+ NodeAttributes extends Attributes = Attributes,
138
+ EdgeAttributes extends Attributes = Attributes
139
+ > = (
140
+ edge: string,
141
+ attributes: EdgeAttributes,
142
+ source: string,
143
+ target: string,
144
+ sourceAttributes: NodeAttributes,
145
+ targetAttributes: NodeAttributes,
146
+ undirected: boolean
147
+ ) => boolean | void;
148
+
149
+ type EdgeMapper<
150
+ T,
151
+ NodeAttributes extends Attributes = Attributes,
152
+ EdgeAttributes extends Attributes = Attributes
153
+ > = (
154
+ edge: string,
155
+ attributes: EdgeAttributes,
156
+ source: string,
157
+ target: string,
158
+ sourceAttributes: NodeAttributes,
159
+ targetAttributes: NodeAttributes,
160
+ undirected: boolean
161
+ ) => T;
162
+
163
+ type EdgeReducer<
164
+ T,
165
+ NodeAttributes extends Attributes = Attributes,
166
+ EdgeAttributes extends Attributes = Attributes
167
+ > = (
168
+ accumulator: T,
169
+ edge: string,
170
+ attributes: EdgeAttributes,
171
+ source: string,
172
+ target: string,
173
+ sourceAttributes: NodeAttributes,
174
+ targetAttributes: NodeAttributes,
175
+ undirected: boolean
176
+ ) => T;
177
+
178
+ type SerializedNode<NodeAttributes extends Attributes = Attributes> = {
179
+ key: string;
180
+ attributes?: NodeAttributes;
181
+ };
182
+
183
+ type SerializedEdge<EdgeAttributes extends Attributes = Attributes> = {
184
+ key?: string;
185
+ source: string;
186
+ target: string;
187
+ attributes?: EdgeAttributes;
188
+ undirected?: boolean;
189
+ };
190
+
191
+ type SerializedGraph<
192
+ NodeAttributes extends Attributes = Attributes,
193
+ EdgeAttributes extends Attributes = Attributes,
194
+ GraphAttributes extends Attributes = Attributes
195
+ > = {
196
+ attributes: GraphAttributes;
197
+ options: GraphOptions;
198
+ nodes: Array<SerializedNode<NodeAttributes>>;
199
+ edges: Array<SerializedEdge<EdgeAttributes>>;
200
+ };
201
+
202
+ /**
203
+ * Event Emitter typings for convience.
204
+ * @note Taken from here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/events/index.d.ts
205
+ */
206
+ type Listener = (...args: any[]) => void;
207
+ type EventsMapping = Record<string, Listener>;
208
+
209
+ type AttributeUpdatePayload<ItemAttributes extends Attributes = Attributes> =
210
+ | {
211
+ type: 'set';
212
+ key: string;
213
+ attributes: ItemAttributes;
214
+ name: keyof ItemAttributes;
215
+ }
216
+ | {
217
+ type: 'remove';
218
+ key: string;
219
+ attributes: ItemAttributes;
220
+ name: keyof ItemAttributes;
221
+ }
222
+ | {
223
+ type: 'replace';
224
+ key: string;
225
+ attributes: ItemAttributes;
226
+ }
227
+ | {
228
+ type: 'merge';
229
+ key: string;
230
+ attributes: ItemAttributes;
231
+ data: ItemAttributes;
232
+ }
233
+ | {
234
+ type: 'update';
235
+ key: string;
236
+ attributes: ItemAttributes;
237
+ };
238
+
239
+ type GraphEvents<
240
+ NodeAttributes extends Attributes = Attributes,
241
+ EdgeAttributes extends Attributes = Attributes,
242
+ GraphAttributes extends Attributes = Attributes
243
+ > = {
244
+ nodeAdded(payload: {key: string; attributes: NodeAttributes}): void;
245
+ edgeAdded(payload: {
246
+ key: string;
247
+ source: string;
248
+ target: string;
249
+ attributes: EdgeAttributes;
250
+ undirected: boolean;
251
+ }): void;
252
+ nodeDropped(payload: {key: string; attributes: NodeAttributes}): void;
253
+ edgeDropped(payload: {
254
+ key: string;
255
+ source: string;
256
+ target: string;
257
+ attributes: EdgeAttributes;
258
+ undirected: boolean;
259
+ }): void;
260
+ cleared(): void;
261
+ edgesCleared(): void;
262
+ attributesUpdated(
263
+ payload: Omit<AttributeUpdatePayload<GraphAttributes>, 'key'>
264
+ ): void;
265
+ nodeAttributesUpdated(payload: AttributeUpdatePayload<NodeAttributes>): void;
266
+ edgeAttributesUpdated(payload: AttributeUpdatePayload<EdgeAttributes>): void;
267
+ eachNodeAttributesUpdated(payload: {
268
+ hints: UpdateHints<NodeAttributes>;
269
+ }): void;
270
+ eachEdgeAttributesUpdated(payload: {
271
+ hints: UpdateHints<EdgeAttributes>;
272
+ }): void;
273
+ };
274
+
275
+ declare class GraphEventEmitter<Events extends EventsMapping> {
276
+ static listenerCount<Events extends EventsMapping>(
277
+ emitter: GraphEventEmitter<Events>,
278
+ type: string | number
279
+ ): number;
280
+ static defaultMaxListeners: number;
281
+
282
+ eventNames<Event extends keyof Events>(): Array<Event>;
283
+ setMaxListeners(n: number): this;
284
+ getMaxListeners(): number;
285
+ emit<Event extends keyof Events>(
286
+ type: Event,
287
+ ...args: Parameters<Events[Event]>
288
+ ): boolean;
289
+ addListener<Event extends keyof Events>(
290
+ type: Event,
291
+ listener: Events[Event]
292
+ ): this;
293
+ on<Event extends keyof Events>(type: Event, listener: Events[Event]): this;
294
+ once<Event extends keyof Events>(type: Event, listener: Events[Event]): this;
295
+ prependListener<Event extends keyof Events>(
296
+ type: Event,
297
+ listener: Events[Event]
298
+ ): this;
299
+ prependOnceListener<Event extends keyof Events>(
300
+ type: Event,
301
+ listener: Events[Event]
302
+ ): this;
303
+ removeListener<Event extends keyof Events>(
304
+ type: Event,
305
+ listener: Events[Event]
306
+ ): this;
307
+ off<Event extends keyof Events>(type: Event, listener: Events[Event]): this;
308
+ removeAllListeners<Event extends keyof Events>(type?: Event): this;
309
+ listeners<Event extends keyof Events>(type: Event): Events[Event][];
310
+ listenerCount<Event extends keyof Events>(type: Event): number;
311
+ rawListeners<Event extends keyof Events>(type: Event): Events[Event][];
312
+ }
313
+
314
+ /**
315
+ * Main interface.
316
+ */
317
+ declare abstract class AbstractGraph<
318
+ NodeAttributes extends Attributes = Attributes,
319
+ EdgeAttributes extends Attributes = Attributes,
320
+ GraphAttributes extends Attributes = Attributes
321
+ > extends GraphEventEmitter<
322
+ GraphEvents<NodeAttributes, EdgeAttributes, GraphAttributes>
323
+ > {
324
+ // Constructor
325
+ constructor(options?: GraphOptions);
326
+
327
+ // Members
328
+ order: number;
329
+ size: number;
330
+ directedSize: number;
331
+ undirectedSize: number;
332
+ type: GraphType;
333
+ multi: boolean;
334
+ allowSelfLoops: boolean;
335
+ implementation: string;
336
+ selfLoopCount: number;
337
+ directedSelfLoopCount: number;
338
+ undirectedSelfLoopCount: number;
339
+
340
+ // Read methods
341
+ hasNode(node: unknown): boolean;
342
+ hasDirectedEdge(edge: unknown): boolean;
343
+ hasDirectedEdge(source: unknown, target: unknown): boolean;
344
+ hasUndirectedEdge(edge: unknown): boolean;
345
+ hasUndirectedEdge(source: unknown, target: unknown): boolean;
346
+ hasEdge(edge: unknown): boolean;
347
+ hasEdge(source: unknown, target: unknown): boolean;
348
+ directedEdge(source: unknown, target: unknown): string | undefined;
349
+ undirectedEdge(source: unknown, target: unknown): string | undefined;
350
+ edge(source: unknown, target: unknown): string | undefined;
351
+ inDegree(node: unknown): number;
352
+ outDegree(node: unknown): number;
353
+ inboundDegree(node: unknown): number;
354
+ outboundDegree(node: unknown): number;
355
+ directedDegree(node: unknown): number;
356
+ undirectedDegree(node: unknown): number;
357
+ degree(node: unknown): number;
358
+ inDegreeWithoutSelfLoops(node: unknown): number;
359
+ outDegreeWithoutSelfLoops(node: unknown): number;
360
+ inboundDegreeWithoutSelfLoops(node: unknown): number;
361
+ outboundDegreeWithoutSelfLoops(node: unknown): number;
362
+ directedDegreeWithoutSelfLoops(node: unknown): number;
363
+ undirectedDegreeWithoutSelfLoops(node: unknown): number;
364
+ degreeWithoutSelfLoops(node: unknown): number;
365
+ source(edge: unknown): string;
366
+ target(edge: unknown): string;
367
+ extremities(edge: unknown): [string, string];
368
+ opposite(node: unknown, edge: unknown): string;
369
+ isUndirected(edge: unknown): boolean;
370
+ isDirected(edge: unknown): boolean;
371
+ isSelfLoop(edge: unknown): boolean;
372
+ hasExtremity(edge: unknown, node: unknown): boolean;
373
+ areNeighbors(source: unknown, target: unknown): boolean;
374
+ areUndirectedNeighbors(source: unknown, target: unknown): boolean;
375
+ areDirectedNeighbors(source: unknown, target: unknown): boolean;
376
+ areInNeighbors(source: unknown, target: unknown): boolean;
377
+ areOutNeighbors(source: unknown, target: unknown): boolean;
378
+ areInboundNeighbors(source: unknown, target: unknown): boolean;
379
+ areOutboundNeighbors(source: unknown, target: unknown): boolean;
380
+
381
+ // Mutation methods
382
+ addNode(node: unknown, attributes?: NodeAttributes): string;
383
+ mergeNode(
384
+ node: unknown,
385
+ attributes?: Partial<NodeAttributes>
386
+ ): NodeMergeResult;
387
+ updateNode(
388
+ node: unknown,
389
+ updater?: (attributes: Partial<NodeAttributes>) => NodeAttributes
390
+ ): NodeMergeResult;
391
+ addEdge(
392
+ source: unknown,
393
+ target: unknown,
394
+ attributes?: EdgeAttributes
395
+ ): string;
396
+ mergeEdge(
397
+ source: unknown,
398
+ target: unknown,
399
+ attributes?: Partial<EdgeAttributes>
400
+ ): EdgeMergeResult;
401
+ updateEdge(
402
+ source: unknown,
403
+ target: unknown,
404
+ updater?: (attributes: Partial<EdgeAttributes>) => EdgeAttributes
405
+ ): EdgeMergeResult;
406
+ addDirectedEdge(
407
+ source: unknown,
408
+ target: unknown,
409
+ attributes?: EdgeAttributes
410
+ ): string;
411
+ mergeDirectedEdge(
412
+ source: unknown,
413
+ target: unknown,
414
+ attributes?: Partial<EdgeAttributes>
415
+ ): EdgeMergeResult;
416
+ updateDirectedEdge(
417
+ source: unknown,
418
+ target: unknown,
419
+ updater?: (attributes: Partial<EdgeAttributes>) => EdgeAttributes
420
+ ): EdgeMergeResult;
421
+ addUndirectedEdge(
422
+ source: unknown,
423
+ target: unknown,
424
+ attributes?: EdgeAttributes
425
+ ): string;
426
+ mergeUndirectedEdge(
427
+ source: unknown,
428
+ target: unknown,
429
+ attributes?: Partial<EdgeAttributes>
430
+ ): EdgeMergeResult;
431
+ updateUndirectedEdge(
432
+ source: unknown,
433
+ target: unknown,
434
+ updater?: (attributes: Partial<EdgeAttributes>) => EdgeAttributes
435
+ ): EdgeMergeResult;
436
+ addEdgeWithKey(
437
+ edge: unknown,
438
+ source: unknown,
439
+ target: unknown,
440
+ attributes?: EdgeAttributes
441
+ ): string;
442
+ mergeEdgeWithKey(
443
+ edge: unknown,
444
+ source: unknown,
445
+ target: unknown,
446
+ attributes?: Partial<EdgeAttributes>
447
+ ): EdgeMergeResult;
448
+ updateEdgeWithKey(
449
+ edge: unknown,
450
+ source: unknown,
451
+ target: unknown,
452
+ updater?: (attributes: Partial<EdgeAttributes>) => EdgeAttributes
453
+ ): EdgeMergeResult;
454
+ addDirectedEdgeWithKey(
455
+ edge: unknown,
456
+ source: unknown,
457
+ target: unknown,
458
+ attributes?: EdgeAttributes
459
+ ): string;
460
+ mergeDirectedEdgeWithKey(
461
+ edge: unknown,
462
+ source: unknown,
463
+ target: unknown,
464
+ attributes?: Partial<EdgeAttributes>
465
+ ): EdgeMergeResult;
466
+ updateDirectedEdgeWithKey(
467
+ edge: unknown,
468
+ source: unknown,
469
+ target: unknown,
470
+ updater?: (attributes: Partial<EdgeAttributes>) => EdgeAttributes
471
+ ): EdgeMergeResult;
472
+ addUndirectedEdgeWithKey(
473
+ edge: unknown,
474
+ source: unknown,
475
+ target: unknown,
476
+ attributes?: EdgeAttributes
477
+ ): string;
478
+ mergeUndirectedEdgeWithKey(
479
+ edge: unknown,
480
+ source: unknown,
481
+ target: unknown,
482
+ attributes?: Partial<EdgeAttributes>
483
+ ): EdgeMergeResult;
484
+ updateUndirectedEdgeWithKey(
485
+ edge: unknown,
486
+ source: unknown,
487
+ target: unknown,
488
+ updater?: (attributes: Partial<EdgeAttributes>) => EdgeAttributes
489
+ ): EdgeMergeResult;
490
+ dropNode(node: unknown): void;
491
+ dropEdge(edge: unknown): void;
492
+ dropEdge(source: unknown, target: unknown): void;
493
+ dropDirectedEdge(source: unknown, target: unknown): void;
494
+ dropUndirectedEdge(source: unknown, target: unknown): void;
495
+ clear(): void;
496
+ clearEdges(): void;
497
+
498
+ // Graph attribute methods
499
+ getAttribute<AttributeName extends keyof GraphAttributes>(
500
+ name: AttributeName
501
+ ): GraphAttributes[AttributeName];
502
+ getAttributes(): GraphAttributes;
503
+ hasAttribute<AttributeName extends keyof GraphAttributes>(
504
+ name: AttributeName
505
+ ): boolean;
506
+ setAttribute<AttributeName extends keyof GraphAttributes>(
507
+ name: AttributeName,
508
+ value: GraphAttributes[AttributeName]
509
+ ): this;
510
+ updateAttribute<AttributeName extends keyof GraphAttributes>(
511
+ name: AttributeName,
512
+ updater: (
513
+ value: GraphAttributes[AttributeName] | undefined
514
+ ) => GraphAttributes[AttributeName]
515
+ ): this;
516
+ removeAttribute<AttributeName extends keyof GraphAttributes>(
517
+ name: AttributeName
518
+ ): this;
519
+ replaceAttributes(attributes: GraphAttributes): this;
520
+ mergeAttributes(attributes: Partial<GraphAttributes>): this;
521
+ updateAttributes(
522
+ updater: (attributes: GraphAttributes) => GraphAttributes
523
+ ): this;
524
+
525
+ // Node attribute methods
526
+ getNodeAttribute<AttributeName extends keyof NodeAttributes>(
527
+ node: unknown,
528
+ name: AttributeName
529
+ ): NodeAttributes[AttributeName];
530
+ getNodeAttributes(node: unknown): NodeAttributes;
531
+ hasNodeAttribute<AttributeName extends keyof NodeAttributes>(
532
+ node: unknown,
533
+ name: AttributeName
534
+ ): boolean;
535
+ setNodeAttribute<AttributeName extends keyof NodeAttributes>(
536
+ node: unknown,
537
+ name: AttributeName,
538
+ value: NodeAttributes[AttributeName]
539
+ ): this;
540
+ updateNodeAttribute<AttributeName extends keyof NodeAttributes>(
541
+ node: unknown,
542
+ name: AttributeName,
543
+ updater: (
544
+ value: NodeAttributes[AttributeName] | undefined
545
+ ) => NodeAttributes[AttributeName]
546
+ ): this;
547
+ removeNodeAttribute<AttributeName extends keyof NodeAttributes>(
548
+ node: unknown,
549
+ name: AttributeName
550
+ ): this;
551
+ replaceNodeAttributes(node: unknown, attributes: NodeAttributes): this;
552
+ mergeNodeAttributes(node: unknown, attributes: Partial<NodeAttributes>): this;
553
+ updateNodeAttributes(
554
+ node: unknown,
555
+ updater: (attributes: NodeAttributes) => NodeAttributes
556
+ ): this;
557
+
558
+ getSourceAttribute<AttributeName extends keyof NodeAttributes>(
559
+ edge: unknown,
560
+ name: AttributeName
561
+ ): NodeAttributes[AttributeName];
562
+ getSourceAttributes(edge: unknown): NodeAttributes;
563
+ hasSourceAttribute<AttributeName extends keyof NodeAttributes>(
564
+ edge: unknown,
565
+ name: AttributeName
566
+ ): boolean;
567
+ setSourceAttribute<AttributeName extends keyof NodeAttributes>(
568
+ edge: unknown,
569
+ name: AttributeName,
570
+ value: NodeAttributes[AttributeName]
571
+ ): this;
572
+ updateSourceAttribute<AttributeName extends keyof NodeAttributes>(
573
+ edge: unknown,
574
+ name: AttributeName,
575
+ updater: (
576
+ value: NodeAttributes[AttributeName] | undefined
577
+ ) => NodeAttributes[AttributeName]
578
+ ): this;
579
+ removeSourceAttribute<AttributeName extends keyof NodeAttributes>(
580
+ edge: unknown,
581
+ name: AttributeName
582
+ ): this;
583
+ replaceSourceAttributes(edge: unknown, attributes: NodeAttributes): this;
584
+ mergeSourceAttributes(
585
+ edge: unknown,
586
+ attributes: Partial<NodeAttributes>
587
+ ): this;
588
+ updateSourceAttributes(
589
+ edge: unknown,
590
+ updater: (attributes: NodeAttributes) => NodeAttributes
591
+ ): this;
592
+
593
+ getTargetAttribute<AttributeName extends keyof NodeAttributes>(
594
+ edge: unknown,
595
+ name: AttributeName
596
+ ): NodeAttributes[AttributeName];
597
+ getTargetAttributes(edge: unknown): NodeAttributes;
598
+ hasTargetAttribute<AttributeName extends keyof NodeAttributes>(
599
+ edge: unknown,
600
+ name: AttributeName
601
+ ): boolean;
602
+ setTargetAttribute<AttributeName extends keyof NodeAttributes>(
603
+ edge: unknown,
604
+ name: AttributeName,
605
+ value: NodeAttributes[AttributeName]
606
+ ): this;
607
+ updateTargetAttribute<AttributeName extends keyof NodeAttributes>(
608
+ edge: unknown,
609
+ name: AttributeName,
610
+ updater: (
611
+ value: NodeAttributes[AttributeName] | undefined
612
+ ) => NodeAttributes[AttributeName]
613
+ ): this;
614
+ removeTargetAttribute<AttributeName extends keyof NodeAttributes>(
615
+ edge: unknown,
616
+ name: AttributeName
617
+ ): this;
618
+ replaceTargetAttributes(edge: unknown, attributes: NodeAttributes): this;
619
+ mergeTargetAttributes(
620
+ edge: unknown,
621
+ attributes: Partial<NodeAttributes>
622
+ ): this;
623
+ updateTargetAttributes(
624
+ edge: unknown,
625
+ updater: (attributes: NodeAttributes) => NodeAttributes
626
+ ): this;
627
+
628
+ getOppositeAttribute<AttributeName extends keyof NodeAttributes>(
629
+ node: unknown,
630
+ edge: unknown,
631
+ name: AttributeName
632
+ ): NodeAttributes[AttributeName];
633
+ getOppositeAttributes(node: unknown): NodeAttributes;
634
+ hasOppositeAttribute<AttributeName extends keyof NodeAttributes>(
635
+ node: unknown,
636
+ edge: unknown,
637
+ name: AttributeName
638
+ ): boolean;
639
+ setOppositeAttribute<AttributeName extends keyof NodeAttributes>(
640
+ node: unknown,
641
+ edge: unknown,
642
+ name: AttributeName,
643
+ value: NodeAttributes[AttributeName]
644
+ ): this;
645
+ updateOppositeAttribute<AttributeName extends keyof NodeAttributes>(
646
+ node: unknown,
647
+ edge: unknown,
648
+ name: AttributeName,
649
+ updater: (
650
+ value: NodeAttributes[AttributeName] | undefined
651
+ ) => NodeAttributes[AttributeName]
652
+ ): this;
653
+ removeOppositeAttribute<AttributeName extends keyof NodeAttributes>(
654
+ node: unknown,
655
+ edge: unknown,
656
+ name: AttributeName
657
+ ): this;
658
+ replaceOppositeAttributes(
659
+ node: unknown,
660
+ edge: unknown,
661
+ attributes: NodeAttributes
662
+ ): this;
663
+ mergeOppositeAttributes(
664
+ node: unknown,
665
+ edge: unknown,
666
+ attributes: Partial<NodeAttributes>
667
+ ): this;
668
+ updateOppositeAttributes(
669
+ node: unknown,
670
+ edge: unknown,
671
+ updater: (attributes: NodeAttributes) => NodeAttributes
672
+ ): this;
673
+
674
+ updateEachNodeAttributes(
675
+ updater: NodeMapper<NodeAttributes, NodeAttributes>,
676
+ hints?: UpdateHints<NodeAttributes>
677
+ ): void;
678
+
679
+ // Edge attribute methods
680
+ getEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
681
+ edge: unknown,
682
+ name: AttributeName
683
+ ): EdgeAttributes[AttributeName];
684
+ getEdgeAttributes(edge: unknown): EdgeAttributes;
685
+ hasEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
686
+ edge: unknown,
687
+ name: AttributeName
688
+ ): boolean;
689
+ setEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
690
+ edge: unknown,
691
+ name: AttributeName,
692
+ value: EdgeAttributes[AttributeName]
693
+ ): this;
694
+ updateEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
695
+ edge: unknown,
696
+ name: AttributeName,
697
+ updater: (
698
+ value: EdgeAttributes[AttributeName] | undefined
699
+ ) => EdgeAttributes[AttributeName]
700
+ ): this;
701
+ removeEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
702
+ edge: unknown,
703
+ name: AttributeName
704
+ ): this;
705
+ replaceEdgeAttributes(edge: unknown, attributes: EdgeAttributes): this;
706
+ mergeEdgeAttributes(edge: unknown, attributes: Partial<EdgeAttributes>): this;
707
+ updateEdgeAttributes(
708
+ edge: unknown,
709
+ updater: (attributes: EdgeAttributes) => EdgeAttributes
710
+ ): this;
711
+
712
+ updateEachEdgeAttributes(
713
+ updater: EdgeMapper<EdgeAttributes, NodeAttributes, EdgeAttributes>,
714
+ hints?: UpdateHints<EdgeAttributes>
715
+ ): void;
716
+
717
+ // Edge attribute methods (source, target)
718
+ getEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
719
+ source: unknown,
720
+ target: unknown,
721
+ name: AttributeName
722
+ ): EdgeAttributes[AttributeName];
723
+ getEdgeAttributes(source: unknown, target: unknown): EdgeAttributes;
724
+ hasEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
725
+ source: unknown,
726
+ target: unknown,
727
+ name: AttributeName
728
+ ): boolean;
729
+ setEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
730
+ source: unknown,
731
+ target: unknown,
732
+ name: AttributeName,
733
+ value: EdgeAttributes[AttributeName]
734
+ ): this;
735
+ updateEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
736
+ source: unknown,
737
+ target: unknown,
738
+ name: AttributeName,
739
+ updater: (
740
+ value: EdgeAttributes[AttributeName] | undefined
741
+ ) => EdgeAttributes[AttributeName]
742
+ ): this;
743
+ removeEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
744
+ source: unknown,
745
+ target: unknown,
746
+ name: AttributeName
747
+ ): this;
748
+ replaceEdgeAttributes(
749
+ source: unknown,
750
+ target: unknown,
751
+ attributes: EdgeAttributes
752
+ ): this;
753
+ mergeEdgeAttributes(
754
+ source: unknown,
755
+ target: unknown,
756
+ attributes: Partial<EdgeAttributes>
757
+ ): this;
758
+ updateEdgeAttributes(
759
+ source: unknown,
760
+ target: unknown,
761
+ updater: (attributes: EdgeAttributes) => EdgeAttributes
762
+ ): this;
763
+
764
+ getDirectedEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
765
+ source: unknown,
766
+ target: unknown,
767
+ name: AttributeName
768
+ ): EdgeAttributes[AttributeName];
769
+ getDirectedEdgeAttributes(source: unknown, target: unknown): EdgeAttributes;
770
+ hasDirectedEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
771
+ source: unknown,
772
+ target: unknown,
773
+ name: AttributeName
774
+ ): boolean;
775
+ setDirectedEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
776
+ source: unknown,
777
+ target: unknown,
778
+ name: AttributeName,
779
+ value: EdgeAttributes[AttributeName]
780
+ ): this;
781
+ updateDirectedEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
782
+ source: unknown,
783
+ target: unknown,
784
+ name: AttributeName,
785
+ updater: (
786
+ value: EdgeAttributes[AttributeName] | undefined
787
+ ) => EdgeAttributes[AttributeName]
788
+ ): this;
789
+ removeDirectedEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
790
+ source: unknown,
791
+ target: unknown,
792
+ name: AttributeName
793
+ ): this;
794
+ replaceDirectedEdgeAttributes(
795
+ source: unknown,
796
+ target: unknown,
797
+ attributes: EdgeAttributes
798
+ ): this;
799
+ mergeDirectedEdgeAttributes(
800
+ source: unknown,
801
+ target: unknown,
802
+ attributes: Partial<EdgeAttributes>
803
+ ): this;
804
+ updateDirectedEdgeAttributes(
805
+ source: unknown,
806
+ target: unknown,
807
+ updater: (attributes: EdgeAttributes) => EdgeAttributes
808
+ ): this;
809
+
810
+ getUndirectedEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
811
+ source: unknown,
812
+ target: unknown,
813
+ name: AttributeName
814
+ ): EdgeAttributes[AttributeName];
815
+ getUndirectedEdgeAttributes(source: unknown, target: unknown): EdgeAttributes;
816
+ hasUndirectedEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
817
+ source: unknown,
818
+ target: unknown,
819
+ name: AttributeName
820
+ ): boolean;
821
+ setUndirectedEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
822
+ source: unknown,
823
+ target: unknown,
824
+ name: AttributeName,
825
+ value: EdgeAttributes[AttributeName]
826
+ ): this;
827
+ updateUndirectedEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
828
+ source: unknown,
829
+ target: unknown,
830
+ name: AttributeName,
831
+ updater: (
832
+ value: EdgeAttributes[AttributeName] | undefined
833
+ ) => EdgeAttributes[AttributeName]
834
+ ): this;
835
+ removeUndirectedEdgeAttribute<AttributeName extends keyof EdgeAttributes>(
836
+ source: unknown,
837
+ target: unknown,
838
+ name: AttributeName
839
+ ): this;
840
+ replaceUndirectedEdgeAttributes(
841
+ source: unknown,
842
+ target: unknown,
843
+ attributes: EdgeAttributes
844
+ ): this;
845
+ mergeUndirectedEdgeAttributes(
846
+ source: unknown,
847
+ target: unknown,
848
+ attributes: Partial<EdgeAttributes>
849
+ ): this;
850
+ updateUndirectedEdgeAttributes(
851
+ source: unknown,
852
+ target: unknown,
853
+ updater: (attributes: EdgeAttributes) => EdgeAttributes
854
+ ): this;
855
+
856
+ // Iteration methods
857
+ forEachAdjacencyEntry(
858
+ callback: AdjacencyIterationCallback<NodeAttributes, EdgeAttributes>
859
+ ): void;
860
+ forEachAssymetricAdjacencyEntry(
861
+ callback: AdjacencyIterationCallback<NodeAttributes, EdgeAttributes>
862
+ ): void;
863
+ forEachAdjacencyEntryWithOrphans(
864
+ callback: AdjacencyIterationCallbackWithOrphans<
865
+ NodeAttributes,
866
+ EdgeAttributes
867
+ >
868
+ ): void;
869
+ forEachAssymetricAdjacencyEntryWithOrphans(
870
+ callback: AdjacencyIterationCallbackWithOrphans<
871
+ NodeAttributes,
872
+ EdgeAttributes
873
+ >
874
+ ): void;
875
+
876
+ nodes(): Array<string>;
877
+ forEachNode(callback: NodeIterationCallback<NodeAttributes>): void;
878
+ mapNodes<T>(callback: NodeMapper<T, NodeAttributes>): Array<T>;
879
+ filterNodes(callback: NodePredicate<NodeAttributes>): Array<string>;
880
+ reduceNodes<T>(callback: NodeReducer<T, NodeAttributes>, initialValue: T): T;
881
+ findNode(callback: NodePredicate<NodeAttributes>): string | undefined;
882
+ someNode(callback: NodePredicate<NodeAttributes>): boolean;
883
+ everyNode(callback: NodePredicate<NodeAttributes>): boolean;
884
+ nodeEntries(): IterableIterator<NodeEntry<NodeAttributes>>;
885
+
886
+ edges(): Array<string>;
887
+ edges(node: unknown): Array<string>;
888
+ edges(source: unknown, target: unknown): Array<string>;
889
+ undirectedEdges(): Array<string>;
890
+ undirectedEdges(node: unknown): Array<string>;
891
+ undirectedEdges(source: unknown, target: unknown): Array<string>;
892
+ directedEdges(): Array<string>;
893
+ directedEdges(node: unknown): Array<string>;
894
+ directedEdges(source: unknown, target: unknown): Array<string>;
895
+ inEdges(): Array<string>;
896
+ inEdges(node: unknown): Array<string>;
897
+ inEdges(source: unknown, target: unknown): Array<string>;
898
+ outEdges(): Array<string>;
899
+ outEdges(node: unknown): Array<string>;
900
+ outEdges(source: unknown, target: unknown): Array<string>;
901
+ inboundEdges(): Array<string>;
902
+ inboundEdges(node: unknown): Array<string>;
903
+ inboundEdges(source: unknown, target: unknown): Array<string>;
904
+ outboundEdges(): Array<string>;
905
+ outboundEdges(node: unknown): Array<string>;
906
+ outboundEdges(source: unknown, target: unknown): Array<string>;
907
+
908
+ forEachEdge(
909
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
910
+ ): void;
911
+ forEachEdge(
912
+ node: unknown,
913
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
914
+ ): void;
915
+ forEachEdge(
916
+ source: unknown,
917
+ target: unknown,
918
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
919
+ ): void;
920
+ forEachUndirectedEdge(
921
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
922
+ ): void;
923
+ forEachUndirectedEdge(
924
+ node: unknown,
925
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
926
+ ): void;
927
+ forEachUndirectedEdge(
928
+ source: unknown,
929
+ target: unknown,
930
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
931
+ ): void;
932
+ forEachDirectedEdge(
933
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
934
+ ): void;
935
+ forEachDirectedEdge(
936
+ node: unknown,
937
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
938
+ ): void;
939
+ forEachDirectedEdge(
940
+ source: unknown,
941
+ target: unknown,
942
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
943
+ ): void;
944
+ forEachInEdge(
945
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
946
+ ): void;
947
+ forEachInEdge(
948
+ node: unknown,
949
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
950
+ ): void;
951
+ forEachInEdge(
952
+ source: unknown,
953
+ target: unknown,
954
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
955
+ ): void;
956
+ forEachOutEdge(
957
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
958
+ ): void;
959
+ forEachOutEdge(
960
+ node: unknown,
961
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
962
+ ): void;
963
+ forEachOutEdge(
964
+ source: unknown,
965
+ target: unknown,
966
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
967
+ ): void;
968
+ forEachInboundEdge(
969
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
970
+ ): void;
971
+ forEachInboundEdge(
972
+ node: unknown,
973
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
974
+ ): void;
975
+ forEachInboundEdge(
976
+ source: unknown,
977
+ target: unknown,
978
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
979
+ ): void;
980
+ forEachOutboundEdge(
981
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
982
+ ): void;
983
+ forEachOutboundEdge(
984
+ node: unknown,
985
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
986
+ ): void;
987
+ forEachOutboundEdge(
988
+ source: unknown,
989
+ target: unknown,
990
+ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>
991
+ ): void;
992
+
993
+ mapEdges<T>(
994
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
995
+ ): Array<T>;
996
+ mapEdges<T>(
997
+ node: unknown,
998
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
999
+ ): Array<T>;
1000
+ mapEdges<T>(
1001
+ source: unknown,
1002
+ target: unknown,
1003
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1004
+ ): Array<T>;
1005
+ mapUndirectedEdges<T>(
1006
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1007
+ ): Array<T>;
1008
+ mapUndirectedEdges<T>(
1009
+ node: unknown,
1010
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1011
+ ): Array<T>;
1012
+ mapUndirectedEdges<T>(
1013
+ source: unknown,
1014
+ target: unknown,
1015
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1016
+ ): Array<T>;
1017
+ mapDirectedEdges<T>(
1018
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1019
+ ): Array<T>;
1020
+ mapDirectedEdges<T>(
1021
+ node: unknown,
1022
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1023
+ ): Array<T>;
1024
+ mapDirectedEdges<T>(
1025
+ source: unknown,
1026
+ target: unknown,
1027
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1028
+ ): Array<T>;
1029
+ mapInEdges<T>(
1030
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1031
+ ): Array<T>;
1032
+ mapInEdges<T>(
1033
+ node: unknown,
1034
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1035
+ ): Array<T>;
1036
+ mapInEdges<T>(
1037
+ source: unknown,
1038
+ target: unknown,
1039
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1040
+ ): Array<T>;
1041
+ mapOutEdges<T>(
1042
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1043
+ ): Array<T>;
1044
+ mapOutEdges<T>(
1045
+ node: unknown,
1046
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1047
+ ): Array<T>;
1048
+ mapOutEdges<T>(
1049
+ source: unknown,
1050
+ target: unknown,
1051
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1052
+ ): Array<T>;
1053
+ mapInboundEdges<T>(
1054
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1055
+ ): Array<T>;
1056
+ mapInboundEdges<T>(
1057
+ node: unknown,
1058
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1059
+ ): Array<T>;
1060
+ mapInboundEdges<T>(
1061
+ source: unknown,
1062
+ target: unknown,
1063
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1064
+ ): Array<T>;
1065
+ mapOutboundEdges<T>(
1066
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1067
+ ): Array<T>;
1068
+ mapOutboundEdges<T>(
1069
+ node: unknown,
1070
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1071
+ ): Array<T>;
1072
+ mapOutboundEdges<T>(
1073
+ source: unknown,
1074
+ target: unknown,
1075
+ callback: EdgeMapper<T, NodeAttributes, EdgeAttributes>
1076
+ ): Array<T>;
1077
+
1078
+ filterEdges(
1079
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1080
+ ): Array<string>;
1081
+ filterEdges(
1082
+ node: unknown,
1083
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1084
+ ): Array<string>;
1085
+ filterEdges(
1086
+ source: unknown,
1087
+ target: unknown,
1088
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1089
+ ): Array<string>;
1090
+ filterUndirectedEdges(
1091
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1092
+ ): Array<string>;
1093
+ filterUndirectedEdges(
1094
+ node: unknown,
1095
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1096
+ ): Array<string>;
1097
+ filterUndirectedEdges(
1098
+ source: unknown,
1099
+ target: unknown,
1100
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1101
+ ): Array<string>;
1102
+ filterDirectedEdges(
1103
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1104
+ ): Array<string>;
1105
+ filterDirectedEdges(
1106
+ node: unknown,
1107
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1108
+ ): Array<string>;
1109
+ filterDirectedEdges(
1110
+ source: unknown,
1111
+ target: unknown,
1112
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1113
+ ): Array<string>;
1114
+ filterInEdges(
1115
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1116
+ ): Array<string>;
1117
+ filterInEdges(
1118
+ node: unknown,
1119
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1120
+ ): Array<string>;
1121
+ filterInEdges(
1122
+ source: unknown,
1123
+ target: unknown,
1124
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1125
+ ): Array<string>;
1126
+ filterOutEdges(
1127
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1128
+ ): Array<string>;
1129
+ filterOutEdges(
1130
+ node: unknown,
1131
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1132
+ ): Array<string>;
1133
+ filterOutEdges(
1134
+ source: unknown,
1135
+ target: unknown,
1136
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1137
+ ): Array<string>;
1138
+ filterInboundEdges(
1139
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1140
+ ): Array<string>;
1141
+ filterInboundEdges(
1142
+ node: unknown,
1143
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1144
+ ): Array<string>;
1145
+ filterInboundEdges(
1146
+ source: unknown,
1147
+ target: unknown,
1148
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1149
+ ): Array<string>;
1150
+ filterOutboundEdges(
1151
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1152
+ ): Array<string>;
1153
+ filterOutboundEdges(
1154
+ node: unknown,
1155
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1156
+ ): Array<string>;
1157
+ filterOutboundEdges(
1158
+ source: unknown,
1159
+ target: unknown,
1160
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1161
+ ): Array<string>;
1162
+
1163
+ reduceEdges<T>(
1164
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1165
+ initialValue: T
1166
+ ): T;
1167
+ reduceEdges<T>(
1168
+ node: unknown,
1169
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1170
+ initialValue: T
1171
+ ): T;
1172
+ reduceEdges<T>(
1173
+ source: unknown,
1174
+ target: unknown,
1175
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1176
+ initialValue: T
1177
+ ): T;
1178
+ reduceUndirectedEdges<T>(
1179
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1180
+ initialValue: T
1181
+ ): T;
1182
+ reduceUndirectedEdges<T>(
1183
+ node: unknown,
1184
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1185
+ initialValue: T
1186
+ ): T;
1187
+ reduceUndirectedEdges<T>(
1188
+ source: unknown,
1189
+ target: unknown,
1190
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1191
+ initialValue: T
1192
+ ): T;
1193
+ reduceDirectedEdges<T>(
1194
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1195
+ initialValue: T
1196
+ ): T;
1197
+ reduceDirectedEdges<T>(
1198
+ node: unknown,
1199
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1200
+ initialValue: T
1201
+ ): T;
1202
+ reduceDirectedEdges<T>(
1203
+ source: unknown,
1204
+ target: unknown,
1205
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1206
+ initialValue: T
1207
+ ): T;
1208
+ reduceInEdges<T>(
1209
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1210
+ initialValue: T
1211
+ ): T;
1212
+ reduceInEdges<T>(
1213
+ node: unknown,
1214
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1215
+ initialValue: T
1216
+ ): T;
1217
+ reduceInEdges<T>(
1218
+ source: unknown,
1219
+ target: unknown,
1220
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1221
+ initialValue: T
1222
+ ): T;
1223
+ reduceOutEdges<T>(
1224
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1225
+ initialValue: T
1226
+ ): T;
1227
+ reduceOutEdges<T>(
1228
+ node: unknown,
1229
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1230
+ initialValue: T
1231
+ ): T;
1232
+ reduceOutEdges<T>(
1233
+ source: unknown,
1234
+ target: unknown,
1235
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1236
+ initialValue: T
1237
+ ): T;
1238
+ reduceInboundEdges<T>(
1239
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1240
+ initialValue: T
1241
+ ): T;
1242
+ reduceInboundEdges<T>(
1243
+ node: unknown,
1244
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1245
+ initialValue: T
1246
+ ): T;
1247
+ reduceInboundEdges<T>(
1248
+ source: unknown,
1249
+ target: unknown,
1250
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1251
+ initialValue: T
1252
+ ): T;
1253
+ reduceOutboundEdges<T>(
1254
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1255
+ initialValue: T
1256
+ ): T;
1257
+ reduceOutboundEdges<T>(
1258
+ node: unknown,
1259
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1260
+ initialValue: T
1261
+ ): T;
1262
+ reduceOutboundEdges<T>(
1263
+ source: unknown,
1264
+ target: unknown,
1265
+ callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>,
1266
+ initialValue: T
1267
+ ): T;
1268
+
1269
+ findEdge(
1270
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1271
+ ): string | undefined;
1272
+ findEdge(
1273
+ node: unknown,
1274
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1275
+ ): string | undefined;
1276
+ findEdge(
1277
+ source: unknown,
1278
+ target: unknown,
1279
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1280
+ ): string | undefined;
1281
+ findUndirectedEdge(
1282
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1283
+ ): string | undefined;
1284
+ findUndirectedEdge(
1285
+ node: unknown,
1286
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1287
+ ): string | undefined;
1288
+ findUndirectedEdge(
1289
+ source: unknown,
1290
+ target: unknown,
1291
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1292
+ ): string | undefined;
1293
+ findDirectedEdge(
1294
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1295
+ ): string | undefined;
1296
+ findDirectedEdge(
1297
+ node: unknown,
1298
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1299
+ ): string | undefined;
1300
+ findDirectedEdge(
1301
+ source: unknown,
1302
+ target: unknown,
1303
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1304
+ ): string | undefined;
1305
+ findInEdge(
1306
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1307
+ ): string | undefined;
1308
+ findInEdge(
1309
+ node: unknown,
1310
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1311
+ ): string | undefined;
1312
+ findInEdge(
1313
+ source: unknown,
1314
+ target: unknown,
1315
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1316
+ ): string | undefined;
1317
+ findOutEdge(
1318
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1319
+ ): string | undefined;
1320
+ findOutEdge(
1321
+ node: unknown,
1322
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1323
+ ): string | undefined;
1324
+ findOutEdge(
1325
+ source: unknown,
1326
+ target: unknown,
1327
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1328
+ ): string | undefined;
1329
+ findInboundEdge(
1330
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1331
+ ): string | undefined;
1332
+ findInboundEdge(
1333
+ node: unknown,
1334
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1335
+ ): string | undefined;
1336
+ findInboundEdge(
1337
+ source: unknown,
1338
+ target: unknown,
1339
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1340
+ ): string | undefined;
1341
+ findOutboundEdge(
1342
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1343
+ ): string | undefined;
1344
+ findOutboundEdge(
1345
+ node: unknown,
1346
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1347
+ ): string | undefined;
1348
+ findOutboundEdge(
1349
+ source: unknown,
1350
+ target: unknown,
1351
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1352
+ ): string | undefined;
1353
+
1354
+ someEdge(callback: EdgePredicate<NodeAttributes, EdgeAttributes>): boolean;
1355
+ someEdge(
1356
+ node: unknown,
1357
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1358
+ ): boolean;
1359
+ someEdge(
1360
+ source: unknown,
1361
+ target: unknown,
1362
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1363
+ ): boolean;
1364
+ someUndirectedEdge(
1365
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1366
+ ): boolean;
1367
+ someUndirectedEdge(
1368
+ node: unknown,
1369
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1370
+ ): boolean;
1371
+ someUndirectedEdge(
1372
+ source: unknown,
1373
+ target: unknown,
1374
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1375
+ ): boolean;
1376
+ someDirectedEdge(
1377
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1378
+ ): boolean;
1379
+ someDirectedEdge(
1380
+ node: unknown,
1381
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1382
+ ): boolean;
1383
+ someDirectedEdge(
1384
+ source: unknown,
1385
+ target: unknown,
1386
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1387
+ ): boolean;
1388
+ someInEdge(callback: EdgePredicate<NodeAttributes, EdgeAttributes>): boolean;
1389
+ someInEdge(
1390
+ node: unknown,
1391
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1392
+ ): boolean;
1393
+ someInEdge(
1394
+ source: unknown,
1395
+ target: unknown,
1396
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1397
+ ): boolean;
1398
+ someOutEdge(callback: EdgePredicate<NodeAttributes, EdgeAttributes>): boolean;
1399
+ someOutEdge(
1400
+ node: unknown,
1401
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1402
+ ): boolean;
1403
+ someOutEdge(
1404
+ source: unknown,
1405
+ target: unknown,
1406
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1407
+ ): boolean;
1408
+ someInboundEdge(
1409
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1410
+ ): boolean;
1411
+ someInboundEdge(
1412
+ node: unknown,
1413
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1414
+ ): boolean;
1415
+ someInboundEdge(
1416
+ source: unknown,
1417
+ target: unknown,
1418
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1419
+ ): boolean;
1420
+ someOutboundEdge(
1421
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1422
+ ): boolean;
1423
+ someOutboundEdge(
1424
+ node: unknown,
1425
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1426
+ ): boolean;
1427
+ someOutboundEdge(
1428
+ source: unknown,
1429
+ target: unknown,
1430
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1431
+ ): boolean;
1432
+
1433
+ everyEdge(callback: EdgePredicate<NodeAttributes, EdgeAttributes>): boolean;
1434
+ everyEdge(
1435
+ node: unknown,
1436
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1437
+ ): boolean;
1438
+ everyEdge(
1439
+ source: unknown,
1440
+ target: unknown,
1441
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1442
+ ): boolean;
1443
+ everyUndirectedEdge(
1444
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1445
+ ): boolean;
1446
+ everyUndirectedEdge(
1447
+ node: unknown,
1448
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1449
+ ): boolean;
1450
+ everyUndirectedEdge(
1451
+ source: unknown,
1452
+ target: unknown,
1453
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1454
+ ): boolean;
1455
+ everyDirectedEdge(
1456
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1457
+ ): boolean;
1458
+ everyDirectedEdge(
1459
+ node: unknown,
1460
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1461
+ ): boolean;
1462
+ everyDirectedEdge(
1463
+ source: unknown,
1464
+ target: unknown,
1465
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1466
+ ): boolean;
1467
+ everyInEdge(callback: EdgePredicate<NodeAttributes, EdgeAttributes>): boolean;
1468
+ everyInEdge(
1469
+ node: unknown,
1470
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1471
+ ): boolean;
1472
+ everyInEdge(
1473
+ source: unknown,
1474
+ target: unknown,
1475
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1476
+ ): boolean;
1477
+ everyOutEdge(
1478
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1479
+ ): boolean;
1480
+ everyOutEdge(
1481
+ node: unknown,
1482
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1483
+ ): boolean;
1484
+ everyOutEdge(
1485
+ source: unknown,
1486
+ target: unknown,
1487
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1488
+ ): boolean;
1489
+ everyInboundEdge(
1490
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1491
+ ): boolean;
1492
+ everyInboundEdge(
1493
+ node: unknown,
1494
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1495
+ ): boolean;
1496
+ everyInboundEdge(
1497
+ source: unknown,
1498
+ target: unknown,
1499
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1500
+ ): boolean;
1501
+ everyOutboundEdge(
1502
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1503
+ ): boolean;
1504
+ everyOutboundEdge(
1505
+ node: unknown,
1506
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1507
+ ): boolean;
1508
+ everyOutboundEdge(
1509
+ source: unknown,
1510
+ target: unknown,
1511
+ callback: EdgePredicate<NodeAttributes, EdgeAttributes>
1512
+ ): boolean;
1513
+
1514
+ edgeEntries(): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1515
+ edgeEntries(
1516
+ node: unknown
1517
+ ): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1518
+ edgeEntries(
1519
+ source: unknown,
1520
+ target: unknown
1521
+ ): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1522
+ undirectedEdgeEntries(): IterableIterator<
1523
+ EdgeEntry<NodeAttributes, EdgeAttributes>
1524
+ >;
1525
+ undirectedEdgeEntries(
1526
+ node: unknown
1527
+ ): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1528
+ undirectedEdgeEntries(
1529
+ source: unknown,
1530
+ target: unknown
1531
+ ): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1532
+ directedEdgeEntries(): IterableIterator<
1533
+ EdgeEntry<NodeAttributes, EdgeAttributes>
1534
+ >;
1535
+ directedEdgeEntries(
1536
+ node: unknown
1537
+ ): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1538
+ directedEdgeEntries(
1539
+ source: unknown,
1540
+ target: unknown
1541
+ ): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1542
+ inEdgeEntries(): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1543
+ inEdgeEntries(
1544
+ node: unknown
1545
+ ): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1546
+ inEdgeEntries(
1547
+ source: unknown,
1548
+ target: unknown
1549
+ ): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1550
+ outEdgeEntries(): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1551
+ outEdgeEntries(
1552
+ node: unknown
1553
+ ): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1554
+ outEdgeEntries(
1555
+ source: unknown,
1556
+ target: unknown
1557
+ ): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1558
+ inboundEdgeEntries(): IterableIterator<
1559
+ EdgeEntry<NodeAttributes, EdgeAttributes>
1560
+ >;
1561
+ inboundEdgeEntries(
1562
+ node: unknown
1563
+ ): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1564
+ inboundEdgeEntries(
1565
+ source: unknown,
1566
+ target: unknown
1567
+ ): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1568
+ outboundEdgeEntries(): IterableIterator<
1569
+ EdgeEntry<NodeAttributes, EdgeAttributes>
1570
+ >;
1571
+ outboundEdgeEntries(
1572
+ node: unknown
1573
+ ): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1574
+ outboundEdgeEntries(
1575
+ source: unknown,
1576
+ target: unknown
1577
+ ): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>;
1578
+
1579
+ neighbors(node: unknown): Array<string>;
1580
+ undirectedNeighbors(node: unknown): Array<string>;
1581
+ directedNeighbors(node: unknown): Array<string>;
1582
+ inNeighbors(node: unknown): Array<string>;
1583
+ outNeighbors(node: unknown): Array<string>;
1584
+ inboundNeighbors(node: unknown): Array<string>;
1585
+ outboundNeighbors(node: unknown): Array<string>;
1586
+
1587
+ forEachNeighbor(
1588
+ node: unknown,
1589
+ callback: NeighborIterationCallback<NodeAttributes>
1590
+ ): void;
1591
+ forEachUndirectedNeighbor(
1592
+ node: unknown,
1593
+ callback: NeighborIterationCallback<NodeAttributes>
1594
+ ): void;
1595
+ forEachDirectedNeighbor(
1596
+ node: unknown,
1597
+ callback: NeighborIterationCallback<NodeAttributes>
1598
+ ): void;
1599
+ forEachInNeighbor(
1600
+ node: unknown,
1601
+ callback: NeighborIterationCallback<NodeAttributes>
1602
+ ): void;
1603
+ forEachOutNeighbor(
1604
+ node: unknown,
1605
+ callback: NeighborIterationCallback<NodeAttributes>
1606
+ ): void;
1607
+ forEachInboundNeighbor(
1608
+ node: unknown,
1609
+ callback: NeighborIterationCallback<NodeAttributes>
1610
+ ): void;
1611
+ forEachOutboundNeighbor(
1612
+ node: unknown,
1613
+ callback: NeighborIterationCallback<NodeAttributes>
1614
+ ): void;
1615
+
1616
+ mapNeighbors<T>(
1617
+ node: unknown,
1618
+ callback: NeighborMapper<T, NodeAttributes>
1619
+ ): Array<T>;
1620
+ mapUndirectedNeighbors<T>(
1621
+ node: unknown,
1622
+ callback: NeighborMapper<T, NodeAttributes>
1623
+ ): Array<T>;
1624
+ mapDirectedNeighbors<T>(
1625
+ node: unknown,
1626
+ callback: NeighborMapper<T, NodeAttributes>
1627
+ ): Array<T>;
1628
+ mapInNeighbors<T>(
1629
+ node: unknown,
1630
+ callback: NeighborMapper<T, NodeAttributes>
1631
+ ): Array<T>;
1632
+ mapOutNeighbors<T>(
1633
+ node: unknown,
1634
+ callback: NeighborMapper<T, NodeAttributes>
1635
+ ): Array<T>;
1636
+ mapInboundNeighbors<T>(
1637
+ node: unknown,
1638
+ callback: NeighborMapper<T, NodeAttributes>
1639
+ ): Array<T>;
1640
+ mapOutboundNeighbors<T>(
1641
+ node: unknown,
1642
+ callback: NeighborMapper<T, NodeAttributes>
1643
+ ): Array<T>;
1644
+
1645
+ filterNeighbors(
1646
+ node: unknown,
1647
+ callback: NeighborPredicate<NodeAttributes>
1648
+ ): Array<string>;
1649
+ filterUndirectedNeighbors(
1650
+ node: unknown,
1651
+ callback: NeighborPredicate<NodeAttributes>
1652
+ ): Array<string>;
1653
+ filterDirectedNeighbors(
1654
+ node: unknown,
1655
+ callback: NeighborPredicate<NodeAttributes>
1656
+ ): Array<string>;
1657
+ filterInNeighbors(
1658
+ node: unknown,
1659
+ callback: NeighborPredicate<NodeAttributes>
1660
+ ): Array<string>;
1661
+ filterOutNeighbors(
1662
+ node: unknown,
1663
+ callback: NeighborPredicate<NodeAttributes>
1664
+ ): Array<string>;
1665
+ filterInboundNeighbors(
1666
+ node: unknown,
1667
+ callback: NeighborPredicate<NodeAttributes>
1668
+ ): Array<string>;
1669
+ filterOutboundNeighbors(
1670
+ node: unknown,
1671
+ callback: NeighborPredicate<NodeAttributes>
1672
+ ): Array<string>;
1673
+
1674
+ reduceNeighbors<T>(
1675
+ node: unknown,
1676
+ callback: NeighborReducer<T, NodeAttributes>,
1677
+ initialValue: T
1678
+ ): T;
1679
+ reduceUndirectedNeighbors<T>(
1680
+ node: unknown,
1681
+ callback: NeighborReducer<T, NodeAttributes>,
1682
+ initialValue: T
1683
+ ): T;
1684
+ reduceDirectedNeighbors<T>(
1685
+ node: unknown,
1686
+ callback: NeighborReducer<T, NodeAttributes>,
1687
+ initialValue: T
1688
+ ): T;
1689
+ reduceInNeighbors<T>(
1690
+ node: unknown,
1691
+ callback: NeighborReducer<T, NodeAttributes>,
1692
+ initialValue: T
1693
+ ): T;
1694
+ reduceOutNeighbors<T>(
1695
+ node: unknown,
1696
+ callback: NeighborReducer<T, NodeAttributes>,
1697
+ initialValue: T
1698
+ ): T;
1699
+ reduceInboundNeighbors<T>(
1700
+ node: unknown,
1701
+ callback: NeighborReducer<T, NodeAttributes>,
1702
+ initialValue: T
1703
+ ): T;
1704
+ reduceOutboundNeighbors<T>(
1705
+ node: unknown,
1706
+ callback: NeighborReducer<T, NodeAttributes>,
1707
+ initialValue: T
1708
+ ): T;
1709
+
1710
+ findNeighbor(
1711
+ node: unknown,
1712
+ callback: NeighborPredicate<NodeAttributes>
1713
+ ): string | undefined;
1714
+ findUndirectedNeighbor(
1715
+ node: unknown,
1716
+ callback: NeighborPredicate<NodeAttributes>
1717
+ ): string | undefined;
1718
+ findDirectedNeighbor(
1719
+ node: unknown,
1720
+ callback: NeighborPredicate<NodeAttributes>
1721
+ ): string | undefined;
1722
+ findInNeighbor(
1723
+ node: unknown,
1724
+ callback: NeighborPredicate<NodeAttributes>
1725
+ ): string | undefined;
1726
+ findOutNeighbor(
1727
+ node: unknown,
1728
+ callback: NeighborPredicate<NodeAttributes>
1729
+ ): string | undefined;
1730
+ findInboundNeighbor(
1731
+ node: unknown,
1732
+ callback: NeighborPredicate<NodeAttributes>
1733
+ ): string | undefined;
1734
+ findOutboundNeighbor(
1735
+ node: unknown,
1736
+ callback: NeighborPredicate<NodeAttributes>
1737
+ ): string | undefined;
1738
+
1739
+ someNeighbor(
1740
+ node: unknown,
1741
+ callback: NeighborPredicate<NodeAttributes>
1742
+ ): boolean;
1743
+ someUndirectedNeighbor(
1744
+ node: unknown,
1745
+ callback: NeighborPredicate<NodeAttributes>
1746
+ ): boolean;
1747
+ someDirectedNeighbor(
1748
+ node: unknown,
1749
+ callback: NeighborPredicate<NodeAttributes>
1750
+ ): boolean;
1751
+ someInNeighbor(
1752
+ node: unknown,
1753
+ callback: NeighborPredicate<NodeAttributes>
1754
+ ): boolean;
1755
+ someOutNeighbor(
1756
+ node: unknown,
1757
+ callback: NeighborPredicate<NodeAttributes>
1758
+ ): boolean;
1759
+ someInboundNeighbor(
1760
+ node: unknown,
1761
+ callback: NeighborPredicate<NodeAttributes>
1762
+ ): boolean;
1763
+ someOutboundNeighbor(
1764
+ node: unknown,
1765
+ callback: NeighborPredicate<NodeAttributes>
1766
+ ): boolean;
1767
+
1768
+ everyNeighbor(
1769
+ node: unknown,
1770
+ callback: NeighborPredicate<NodeAttributes>
1771
+ ): boolean;
1772
+ everyUndirectedNeighbor(
1773
+ node: unknown,
1774
+ callback: NeighborPredicate<NodeAttributes>
1775
+ ): boolean;
1776
+ everyDirectedNeighbor(
1777
+ node: unknown,
1778
+ callback: NeighborPredicate<NodeAttributes>
1779
+ ): boolean;
1780
+ everyInNeighbor(
1781
+ node: unknown,
1782
+ callback: NeighborPredicate<NodeAttributes>
1783
+ ): boolean;
1784
+ everyOutNeighbor(
1785
+ node: unknown,
1786
+ callback: NeighborPredicate<NodeAttributes>
1787
+ ): boolean;
1788
+ everyInboundNeighbor(
1789
+ node: unknown,
1790
+ callback: NeighborPredicate<NodeAttributes>
1791
+ ): boolean;
1792
+ everyOutboundNeighbor(
1793
+ node: unknown,
1794
+ callback: NeighborPredicate<NodeAttributes>
1795
+ ): boolean;
1796
+
1797
+ neighborEntries(
1798
+ node: unknown
1799
+ ): IterableIterator<NeighborEntry<NodeAttributes>>;
1800
+ undirectedNeighborEntries(
1801
+ node: unknown
1802
+ ): IterableIterator<NeighborEntry<NodeAttributes>>;
1803
+ directedNeighborEntries(
1804
+ node: unknown
1805
+ ): IterableIterator<NeighborEntry<NodeAttributes>>;
1806
+ inNeighborEntries(
1807
+ node: unknown
1808
+ ): IterableIterator<NeighborEntry<NodeAttributes>>;
1809
+ outNeighborEntries(
1810
+ node: unknown
1811
+ ): IterableIterator<NeighborEntry<NodeAttributes>>;
1812
+ inboundNeighborEntries(
1813
+ node: unknown
1814
+ ): IterableIterator<NeighborEntry<NodeAttributes>>;
1815
+ outboundNeighborEntries(
1816
+ node: unknown
1817
+ ): IterableIterator<NeighborEntry<NodeAttributes>>;
1818
+
1819
+ // Serialization methods
1820
+ export(): SerializedGraph<NodeAttributes, EdgeAttributes, GraphAttributes>;
1821
+ import(
1822
+ data: Partial<
1823
+ SerializedGraph<NodeAttributes, EdgeAttributes, GraphAttributes>
1824
+ >,
1825
+ merge?: boolean
1826
+ ): this;
1827
+ import(
1828
+ graph: AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes>,
1829
+ merge?: boolean
1830
+ ): this;
1831
+
1832
+ // Utils
1833
+ nullCopy(
1834
+ options?: Partial<GraphOptions>
1835
+ ): AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes>;
1836
+ emptyCopy(
1837
+ options?: Partial<GraphOptions>
1838
+ ): AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes>;
1839
+ copy(
1840
+ options?: Partial<GraphOptions>
1841
+ ): AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes>;
1842
+
1843
+ // Well-known methods
1844
+ toJSON(): SerializedGraph<NodeAttributes, EdgeAttributes, GraphAttributes>;
1845
+ toString(): string;
1846
+ inspect(): any;
1847
+
1848
+ static from<
1849
+ NA extends Attributes = Attributes,
1850
+ EA extends Attributes = Attributes,
1851
+ GA extends Attributes = Attributes
1852
+ >(
1853
+ data: SerializedGraph<NA, EA, GA> | AbstractGraph<NA, EA, GA>,
1854
+ options?: GraphOptions
1855
+ ): AbstractGraph<NA, EA, GA>;
1856
+ }
1857
+
1858
+ declare class Graph<
1859
+ NodeAttributes extends Attributes = Attributes,
1860
+ EdgeAttributes extends Attributes = Attributes,
1861
+ GraphAttributes extends Attributes = Attributes
1862
+ > extends AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes> {}
1863
+
1864
+ export { Graph };