@dxos/app-graph 0.8.4-main.ae835ea → 0.8.4-main.bc674ce
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/lib/browser/index.mjs +1014 -553
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +1013 -553
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/atoms.d.ts +8 -0
- package/dist/types/src/atoms.d.ts.map +1 -0
- package/dist/types/src/graph-builder.d.ts +108 -66
- package/dist/types/src/graph-builder.d.ts.map +1 -1
- package/dist/types/src/graph.d.ts +182 -212
- package/dist/types/src/graph.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +6 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/node-matcher.d.ts +218 -0
- package/dist/types/src/node-matcher.d.ts.map +1 -0
- package/dist/types/src/node-matcher.test.d.ts +2 -0
- package/dist/types/src/node-matcher.test.d.ts.map +1 -0
- package/dist/types/src/node.d.ts +32 -3
- package/dist/types/src/node.d.ts.map +1 -1
- package/dist/types/src/stories/EchoGraph.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +35 -33
- package/src/atoms.ts +25 -0
- package/src/graph-builder.test.ts +520 -104
- package/src/graph-builder.ts +550 -255
- package/src/graph.test.ts +299 -106
- package/src/graph.ts +964 -394
- package/src/index.ts +9 -3
- package/src/node-matcher.test.ts +301 -0
- package/src/node-matcher.ts +284 -0
- package/src/node.ts +39 -6
- package/src/stories/EchoGraph.stories.tsx +104 -95
- package/src/stories/Tree.tsx +2 -2
- package/dist/types/src/experimental/graph-projections.test.d.ts +0 -25
- package/dist/types/src/experimental/graph-projections.test.d.ts.map +0 -1
- package/dist/types/src/signals-integration.test.d.ts +0 -2
- package/dist/types/src/signals-integration.test.d.ts.map +0 -1
- package/dist/types/src/testing.d.ts +0 -5
- package/dist/types/src/testing.d.ts.map +0 -1
- package/src/experimental/graph-projections.test.ts +0 -56
- package/src/signals-integration.test.ts +0 -218
- package/src/testing.ts +0 -20
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Atom, Registry } from '@effect-atom/atom-react';
|
|
2
2
|
import * as Option from 'effect/Option';
|
|
3
|
+
import * as Pipeable from 'effect/Pipeable';
|
|
3
4
|
import { Event } from '@dxos/async';
|
|
4
5
|
import { type MakeOptional } from '@dxos/util';
|
|
5
|
-
import
|
|
6
|
+
import * as Node from './node';
|
|
6
7
|
/**
|
|
7
8
|
* Get the Graph a Node is currently associated with.
|
|
8
9
|
*/
|
|
9
|
-
export declare const getGraph: (node: Node) => Graph;
|
|
10
|
-
export declare const ROOT_ID = "root";
|
|
11
|
-
export declare const ROOT_TYPE = "dxos.org/type/GraphRoot";
|
|
12
|
-
export declare const ACTION_TYPE = "dxos.org/type/GraphAction";
|
|
13
|
-
export declare const ACTION_GROUP_TYPE = "dxos.org/type/GraphActionGroup";
|
|
10
|
+
export declare const getGraph: (node: Node.Node) => Graph;
|
|
14
11
|
export type GraphTraversalOptions = {
|
|
15
12
|
/**
|
|
16
13
|
* A callback which is called for each node visited during traversal.
|
|
17
14
|
*
|
|
18
15
|
* If the callback returns `false`, traversal is stops recursing.
|
|
19
16
|
*/
|
|
20
|
-
visitor: (node: Node, path: string[]) => boolean | void;
|
|
17
|
+
visitor: (node: Node.Node, path: string[]) => boolean | void;
|
|
21
18
|
/**
|
|
22
19
|
* The node to start traversing from.
|
|
23
20
|
*
|
|
@@ -29,15 +26,15 @@ export type GraphTraversalOptions = {
|
|
|
29
26
|
*
|
|
30
27
|
* @default 'outbound'
|
|
31
28
|
*/
|
|
32
|
-
relation?: Relation;
|
|
29
|
+
relation?: Node.Relation;
|
|
33
30
|
};
|
|
34
|
-
export type
|
|
31
|
+
export type GraphProps = {
|
|
35
32
|
registry?: Registry.Registry;
|
|
36
|
-
nodes?: MakeOptional<Node, 'data' | 'cacheable'>[];
|
|
33
|
+
nodes?: MakeOptional<Node.Node, 'data' | 'cacheable'>[];
|
|
37
34
|
edges?: Record<string, Edges>;
|
|
38
|
-
onExpand?:
|
|
39
|
-
onInitialize?:
|
|
40
|
-
onRemoveNode?:
|
|
35
|
+
onExpand?: (id: string, relation: Node.Relation) => void;
|
|
36
|
+
onInitialize?: (id: string) => Promise<void>;
|
|
37
|
+
onRemoveNode?: (id: string) => void;
|
|
41
38
|
};
|
|
42
39
|
export type Edge = {
|
|
43
40
|
source: string;
|
|
@@ -47,222 +44,195 @@ export type Edges = {
|
|
|
47
44
|
inbound: string[];
|
|
48
45
|
outbound: string[];
|
|
49
46
|
};
|
|
50
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Identifier denoting a Graph.
|
|
49
|
+
*/
|
|
50
|
+
export declare const GraphTypeId: unique symbol;
|
|
51
|
+
export type GraphTypeId = typeof GraphTypeId;
|
|
52
|
+
/**
|
|
53
|
+
* Identifier for the graph kind discriminator.
|
|
54
|
+
*/
|
|
55
|
+
export declare const GraphKind: unique symbol;
|
|
56
|
+
export type GraphKind = typeof GraphKind;
|
|
57
|
+
export type GraphKindType = 'readable' | 'expandable' | 'writable';
|
|
58
|
+
export interface BaseGraph extends Pipeable.Pipeable {
|
|
59
|
+
readonly [GraphTypeId]: GraphTypeId;
|
|
60
|
+
readonly [GraphKind]: GraphKindType;
|
|
51
61
|
/**
|
|
52
62
|
* Event emitted when a node is changed.
|
|
53
63
|
*/
|
|
54
|
-
onNodeChanged: Event<{
|
|
64
|
+
readonly onNodeChanged: Event<{
|
|
55
65
|
id: string;
|
|
56
|
-
node: Option.Option<Node>;
|
|
66
|
+
node: Option.Option<Node.Node>;
|
|
57
67
|
}>;
|
|
58
68
|
/**
|
|
59
|
-
*
|
|
60
|
-
*/
|
|
61
|
-
toJSON(id?: string): object;
|
|
62
|
-
json(id?: string): Rx.Rx<any>;
|
|
63
|
-
/**
|
|
64
|
-
* Get the rx key for the node with the given id.
|
|
69
|
+
* Get the atom key for the JSON representation of the graph.
|
|
65
70
|
*/
|
|
66
|
-
|
|
71
|
+
json(id?: string): Atom.Atom<any>;
|
|
67
72
|
/**
|
|
68
|
-
* Get the
|
|
73
|
+
* Get the atom key for the node with the given id.
|
|
69
74
|
*/
|
|
70
|
-
|
|
75
|
+
node(id: string): Atom.Atom<Option.Option<Node.Node>>;
|
|
71
76
|
/**
|
|
72
|
-
* Get the
|
|
77
|
+
* Get the atom key for the node with the given id.
|
|
73
78
|
*/
|
|
74
|
-
|
|
79
|
+
nodeOrThrow(id: string): Atom.Atom<Node.Node>;
|
|
75
80
|
/**
|
|
76
|
-
* Get the
|
|
81
|
+
* Get the atom key for the connections of the node with the given id.
|
|
77
82
|
*/
|
|
78
|
-
|
|
83
|
+
connections(id: string, relation?: Node.Relation): Atom.Atom<Node.Node[]>;
|
|
79
84
|
/**
|
|
80
|
-
* Get the
|
|
85
|
+
* Get the atom key for the actions of the node with the given id.
|
|
81
86
|
*/
|
|
82
|
-
|
|
87
|
+
actions(id: string): Atom.Atom<(Node.Action | Node.ActionGroup)[]>;
|
|
83
88
|
/**
|
|
84
|
-
*
|
|
89
|
+
* Get the atom key for the edges of the node with the given id.
|
|
85
90
|
*/
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Get the node with the given id from the graph's registry.
|
|
89
|
-
*/
|
|
90
|
-
getNode(id: string): Option.Option<Node>;
|
|
91
|
-
/**
|
|
92
|
-
* Get the node with the given id from the graph's registry.
|
|
93
|
-
*
|
|
94
|
-
* @throws If the node is Option.none().
|
|
95
|
-
*/
|
|
96
|
-
getNodeOrThrow(id: string): Node;
|
|
97
|
-
/**
|
|
98
|
-
* Get all nodes connected to the node with the given id by the given relation from the graph's registry.
|
|
99
|
-
*/
|
|
100
|
-
getConnections(id: string, relation?: Relation): Node[];
|
|
101
|
-
/**
|
|
102
|
-
* Get all actions connected to the node with the given id from the graph's registry.
|
|
103
|
-
*/
|
|
104
|
-
getActions(id: string): Node[];
|
|
105
|
-
/**
|
|
106
|
-
* Get the edges from the node with the given id from the graph's registry.
|
|
107
|
-
*/
|
|
108
|
-
getEdges(id: string): Edges;
|
|
109
|
-
/**
|
|
110
|
-
* Recursive depth-first traversal of the graph.
|
|
111
|
-
*
|
|
112
|
-
* @param options.node The node to start traversing from.
|
|
113
|
-
* @param options.relation The relation to traverse graph edges.
|
|
114
|
-
* @param options.visitor A callback which is called for each node visited during traversal.
|
|
115
|
-
*/
|
|
116
|
-
traverse(options: GraphTraversalOptions, path?: string[]): void;
|
|
117
|
-
/**
|
|
118
|
-
* Get the path between two nodes in the graph.
|
|
119
|
-
*/
|
|
120
|
-
getPath(params: {
|
|
121
|
-
source?: string;
|
|
122
|
-
target: string;
|
|
123
|
-
}): Option.Option<string[]>;
|
|
124
|
-
/**
|
|
125
|
-
* Wait for the path between two nodes in the graph to be established.
|
|
126
|
-
*/
|
|
127
|
-
waitForPath(params: {
|
|
128
|
-
source?: string;
|
|
129
|
-
target: string;
|
|
130
|
-
}, options?: {
|
|
131
|
-
timeout?: number;
|
|
132
|
-
interval?: number;
|
|
133
|
-
}): Promise<string[]>;
|
|
134
|
-
}
|
|
135
|
-
export interface ExpandableGraph extends ReadableGraph {
|
|
136
|
-
/**
|
|
137
|
-
* Initialize a node in the graph.
|
|
138
|
-
*
|
|
139
|
-
* Fires the `onInitialize` callback to provide initial data for a node.
|
|
140
|
-
*/
|
|
141
|
-
initialize(id: string): Promise<void>;
|
|
142
|
-
/**
|
|
143
|
-
* Expand a node in the graph.
|
|
144
|
-
*
|
|
145
|
-
* Fires the `onExpand` callback to add connections to the node.
|
|
146
|
-
*/
|
|
147
|
-
expand(id: string, relation?: Relation): void;
|
|
148
|
-
/**
|
|
149
|
-
* Sort the edges of the node with the given id.
|
|
150
|
-
*/
|
|
151
|
-
sortEdges(id: string, relation: Relation, order: string[]): void;
|
|
152
|
-
}
|
|
153
|
-
export interface WritableGraph extends ExpandableGraph {
|
|
154
|
-
/**
|
|
155
|
-
* Add nodes to the graph.
|
|
156
|
-
*/
|
|
157
|
-
addNodes(nodes: NodeArg<any, Record<string, any>>[]): void;
|
|
158
|
-
/**
|
|
159
|
-
* Add a node to the graph.
|
|
160
|
-
*/
|
|
161
|
-
addNode(node: NodeArg<any, Record<string, any>>): void;
|
|
162
|
-
/**
|
|
163
|
-
* Remove nodes from the graph.
|
|
164
|
-
*/
|
|
165
|
-
removeNodes(ids: string[], edges?: boolean): void;
|
|
166
|
-
/**
|
|
167
|
-
* Remove a node from the graph.
|
|
168
|
-
*/
|
|
169
|
-
removeNode(id: string, edges?: boolean): void;
|
|
170
|
-
/**
|
|
171
|
-
* Add edges to the graph.
|
|
172
|
-
*/
|
|
173
|
-
addEdges(edges: Edge[]): void;
|
|
174
|
-
/**
|
|
175
|
-
* Add an edge to the graph.
|
|
176
|
-
*/
|
|
177
|
-
addEdge(edge: Edge): void;
|
|
178
|
-
/**
|
|
179
|
-
* Remove edges from the graph.
|
|
180
|
-
*/
|
|
181
|
-
removeEdges(edges: Edge[], removeOrphans?: boolean): void;
|
|
182
|
-
/**
|
|
183
|
-
* Remove an edge from the graph.
|
|
184
|
-
*/
|
|
185
|
-
removeEdge(edge: Edge, removeOrphans?: boolean): void;
|
|
91
|
+
edges(id: string): Atom.Atom<Edges>;
|
|
186
92
|
}
|
|
93
|
+
export type ReadableGraph = BaseGraph & {
|
|
94
|
+
readonly [GraphKind]: 'readable' | 'expandable' | 'writable';
|
|
95
|
+
};
|
|
96
|
+
export type ExpandableGraph = BaseGraph & {
|
|
97
|
+
readonly [GraphKind]: 'expandable' | 'writable';
|
|
98
|
+
};
|
|
99
|
+
export type WritableGraph = BaseGraph & {
|
|
100
|
+
readonly [GraphKind]: 'writable';
|
|
101
|
+
};
|
|
187
102
|
/**
|
|
188
|
-
*
|
|
103
|
+
* Graph interface.
|
|
189
104
|
*/
|
|
190
|
-
export
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
105
|
+
export type Graph = WritableGraph;
|
|
106
|
+
/**
|
|
107
|
+
* Convert the graph to a JSON object.
|
|
108
|
+
*/
|
|
109
|
+
export declare const toJSON: (graph: BaseGraph, id?: string) => object;
|
|
110
|
+
/**
|
|
111
|
+
* Get the node with the given id from the graph's registry.
|
|
112
|
+
*/
|
|
113
|
+
export declare function getNode(graph: BaseGraph, id: string): Option.Option<Node.Node>;
|
|
114
|
+
export declare function getNode(id: string): (graph: BaseGraph) => Option.Option<Node.Node>;
|
|
115
|
+
/**
|
|
116
|
+
* Get the node with the given id from the graph's registry.
|
|
117
|
+
*
|
|
118
|
+
* @throws If the node is Option.none().
|
|
119
|
+
*/
|
|
120
|
+
export declare function getNodeOrThrow(graph: BaseGraph, id: string): Node.Node;
|
|
121
|
+
export declare function getNodeOrThrow(id: string): (graph: BaseGraph) => Node.Node;
|
|
122
|
+
/**
|
|
123
|
+
* Get the root node of the graph.
|
|
124
|
+
* This is an alias for `getNodeOrThrow(graph, ROOT_ID)`.
|
|
125
|
+
*/
|
|
126
|
+
export declare function getRoot(graph: BaseGraph): Node.Node;
|
|
127
|
+
/**
|
|
128
|
+
* Get all nodes connected to the node with the given id by the given relation from the graph's registry.
|
|
129
|
+
*/
|
|
130
|
+
export declare function getConnections(graph: BaseGraph, id: string, relation?: Node.Relation): Node.Node[];
|
|
131
|
+
export declare function getConnections(id: string, relation?: Node.Relation): (graph: BaseGraph) => Node.Node[];
|
|
132
|
+
/**
|
|
133
|
+
* Get all actions connected to the node with the given id from the graph's registry.
|
|
134
|
+
*/
|
|
135
|
+
export declare function getActions(graph: BaseGraph, id: string): Node.Node[];
|
|
136
|
+
export declare function getActions(id: string): (graph: BaseGraph) => Node.Node[];
|
|
137
|
+
/**
|
|
138
|
+
* Get the edges from the node with the given id from the graph's registry.
|
|
139
|
+
*/
|
|
140
|
+
export declare function getEdges(graph: BaseGraph, id: string): Edges;
|
|
141
|
+
export declare function getEdges(id: string): (graph: BaseGraph) => Edges;
|
|
142
|
+
/**
|
|
143
|
+
* Traverse the graph with the given options.
|
|
144
|
+
*/
|
|
145
|
+
export declare function traverse(graph: BaseGraph, options: GraphTraversalOptions, path?: string[]): void;
|
|
146
|
+
export declare function traverse(options: GraphTraversalOptions, path?: string[]): (graph: BaseGraph) => void;
|
|
147
|
+
/**
|
|
148
|
+
* Get the path between two nodes in the graph.
|
|
149
|
+
*/
|
|
150
|
+
export declare function getPath(graph: BaseGraph, params: {
|
|
151
|
+
source?: string;
|
|
152
|
+
target: string;
|
|
153
|
+
}): Option.Option<string[]>;
|
|
154
|
+
export declare function getPath(params: {
|
|
155
|
+
source?: string;
|
|
156
|
+
target: string;
|
|
157
|
+
}): (graph: BaseGraph) => Option.Option<string[]>;
|
|
158
|
+
/**
|
|
159
|
+
* Wait for the path between two nodes in the graph to be established.
|
|
160
|
+
*/
|
|
161
|
+
export declare function waitForPath(graph: BaseGraph, params: {
|
|
162
|
+
source?: string;
|
|
163
|
+
target: string;
|
|
164
|
+
}, options?: {
|
|
165
|
+
timeout?: number;
|
|
166
|
+
interval?: number;
|
|
167
|
+
}): Promise<string[]>;
|
|
168
|
+
export declare function waitForPath(params: {
|
|
169
|
+
source?: string;
|
|
170
|
+
target: string;
|
|
171
|
+
}, options?: {
|
|
172
|
+
timeout?: number;
|
|
173
|
+
interval?: number;
|
|
174
|
+
}): (graph: BaseGraph) => Promise<string[]>;
|
|
175
|
+
/**
|
|
176
|
+
* Initialize a node in the graph.
|
|
177
|
+
*
|
|
178
|
+
* Fires the `onInitialize` callback to provide initial data for a node.
|
|
179
|
+
*/
|
|
180
|
+
export declare function initialize<T extends ExpandableGraph | WritableGraph>(graph: T, id: string): Promise<T>;
|
|
181
|
+
export declare function initialize(id: string): <T extends ExpandableGraph | WritableGraph>(graph: T) => Promise<T>;
|
|
182
|
+
/**
|
|
183
|
+
* Expand a node in the graph.
|
|
184
|
+
*
|
|
185
|
+
* Fires the `onExpand` callback to add connections to the node.
|
|
186
|
+
*/
|
|
187
|
+
export declare function expand<T extends ExpandableGraph | WritableGraph>(graph: T, id: string, relation?: Node.Relation): T;
|
|
188
|
+
export declare function expand(id: string, relation?: Node.Relation): <T extends ExpandableGraph | WritableGraph>(graph: T) => T;
|
|
189
|
+
/**
|
|
190
|
+
* Sort the edges of the node with the given id.
|
|
191
|
+
*/
|
|
192
|
+
export declare function sortEdges<T extends ExpandableGraph | WritableGraph>(graph: T, id: string, relation: Node.Relation, order: string[]): T;
|
|
193
|
+
export declare function sortEdges(id: string, relation: Node.Relation, order: string[]): <T extends ExpandableGraph | WritableGraph>(graph: T) => T;
|
|
194
|
+
/**
|
|
195
|
+
* Add nodes to the graph.
|
|
196
|
+
*/
|
|
197
|
+
export declare function addNodes<T extends WritableGraph>(graph: T, nodes: Node.NodeArg<any, Record<string, any>>[]): T;
|
|
198
|
+
export declare function addNodes(nodes: Node.NodeArg<any, Record<string, any>>[]): <T extends WritableGraph>(graph: T) => T;
|
|
199
|
+
/**
|
|
200
|
+
* Add a node to the graph.
|
|
201
|
+
*/
|
|
202
|
+
export declare function addNode<T extends WritableGraph>(graph: T, nodeArg: Node.NodeArg<any, Record<string, any>>): T;
|
|
203
|
+
export declare function addNode(nodeArg: Node.NodeArg<any, Record<string, any>>): <T extends WritableGraph>(graph: T) => T;
|
|
204
|
+
/**
|
|
205
|
+
* Remove nodes from the graph.
|
|
206
|
+
*/
|
|
207
|
+
export declare function removeNodes<T extends WritableGraph>(graph: T, ids: string[], edges?: boolean): T;
|
|
208
|
+
export declare function removeNodes(ids: string[], edges?: boolean): <T extends WritableGraph>(graph: T) => T;
|
|
209
|
+
/**
|
|
210
|
+
* Remove a node from the graph.
|
|
211
|
+
*/
|
|
212
|
+
export declare function removeNode<T extends WritableGraph>(graph: T, id: string, edges?: boolean): T;
|
|
213
|
+
export declare function removeNode(id: string, edges?: boolean): <T extends WritableGraph>(graph: T) => T;
|
|
214
|
+
/**
|
|
215
|
+
* Add edges to the graph.
|
|
216
|
+
*/
|
|
217
|
+
export declare function addEdges<T extends WritableGraph>(graph: T, edges: Edge[]): T;
|
|
218
|
+
export declare function addEdges(edges: Edge[]): <T extends WritableGraph>(graph: T) => T;
|
|
219
|
+
/**
|
|
220
|
+
* Add an edge to the graph.
|
|
221
|
+
*/
|
|
222
|
+
export declare function addEdge<T extends WritableGraph>(graph: T, edgeArg: Edge): T;
|
|
223
|
+
export declare function addEdge(edgeArg: Edge): <T extends WritableGraph>(graph: T) => T;
|
|
224
|
+
/**
|
|
225
|
+
* Remove edges from the graph.
|
|
226
|
+
*/
|
|
227
|
+
export declare function removeEdges<T extends WritableGraph>(graph: T, edges: Edge[], removeOrphans?: boolean): T;
|
|
228
|
+
export declare function removeEdges(edges: Edge[], removeOrphans?: boolean): <T extends WritableGraph>(graph: T) => T;
|
|
229
|
+
/**
|
|
230
|
+
* Remove an edge from the graph.
|
|
231
|
+
*/
|
|
232
|
+
export declare function removeEdge<T extends WritableGraph>(graph: T, edgeArg: Edge, removeOrphans?: boolean): T;
|
|
233
|
+
export declare function removeEdge(edgeArg: Edge, removeOrphans?: boolean): <T extends WritableGraph>(graph: T) => T;
|
|
234
|
+
/**
|
|
235
|
+
* Creates a new Graph instance.
|
|
236
|
+
*/
|
|
237
|
+
export declare const make: (params?: GraphProps) => Graph;
|
|
268
238
|
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/graph.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/graph.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,KAAK,EAAW,MAAM,aAAa,CAAC;AAI7C,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,YAAY,CAAC;AAE9D,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAU/B;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,IAAI,CAAC,IAAI,KAAG,KAI1C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;;OAIG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,GAAG,IAAI,CAAC;IAE7D;;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wD9G;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,aAAa,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC;AACzG,wBAAgB,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,aAAa,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,SAAS,aAAa,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;AAwB7G;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,SAAS,UAAU,KAAG,KAE1C,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './graph
|
|
3
|
-
export * from './
|
|
1
|
+
export * as CreateAtom from './atoms';
|
|
2
|
+
export * as Graph from './graph';
|
|
3
|
+
export * as GraphBuilder from './graph-builder';
|
|
4
|
+
export * as Node from './node';
|
|
5
|
+
export * as NodeMatcher from './node-matcher';
|
|
6
|
+
export type { BuilderExtensions } from './graph-builder';
|
|
4
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAG9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
|