spana-test 0.19.0 → 0.20.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.
- package/README.md +4 -3
- package/dist/agent/index.js +15 -15
- package/dist/api/app.d.ts +1 -0
- package/dist/api/app.d.ts.map +1 -1
- package/dist/api/expect.d.ts +25 -11
- package/dist/api/expect.d.ts.map +1 -1
- package/dist/{app-LGNFQMU7.js → app-ZSRJ3VFR.js} +3 -3
- package/dist/{appium-2PJWZXJI.js → appium-LOAWWZXA.js} +9 -9
- package/dist/build-info-KFFGVWDQ.js +9 -0
- package/dist/build-info.d.ts +5 -0
- package/dist/build-info.d.ts.map +1 -0
- package/dist/build-info.json +4 -0
- package/dist/channels/cdp-client.d.ts +36 -1
- package/dist/channels/cdp-client.d.ts.map +1 -1
- package/dist/channels/dom-channel.d.ts +14 -2
- package/dist/channels/dom-channel.d.ts.map +1 -1
- package/dist/{chunk-7K24Q7V3.js → chunk-26XIUSVS.js} +129 -29
- package/dist/chunk-26XIUSVS.js.map +1 -0
- package/dist/{chunk-E67QUGT3.js → chunk-2SDRH7ST.js} +7 -14
- package/dist/chunk-2SDRH7ST.js.map +1 -0
- package/dist/{chunk-NR4QAM5W.js → chunk-2TK77LXY.js} +18 -16
- package/dist/chunk-2TK77LXY.js.map +1 -0
- package/dist/{chunk-AP5SGSO7.js → chunk-42D5LOGH.js} +8 -8
- package/dist/{chunk-6X2SK2XO.js → chunk-5NZPLX2Y.js} +4 -5
- package/dist/chunk-5NZPLX2Y.js.map +1 -0
- package/dist/{chunk-CQ67PB3R.js → chunk-6GLL6SMP.js} +2 -2
- package/dist/{chunk-44U3F2RY.js → chunk-7GDO4XAI.js} +214 -6
- package/dist/chunk-7GDO4XAI.js.map +1 -0
- package/dist/{chunk-IJWAAODK.js → chunk-7QJY2HJO.js} +2 -2
- package/dist/{chunk-DNWVDGKS.js → chunk-GBV3XDWM.js} +8 -8
- package/dist/{chunk-C7HZJIGQ.js → chunk-HX2PKESI.js} +2 -2
- package/dist/{chunk-NC32K762.js → chunk-QNCTEV2P.js} +14 -14
- package/dist/{chunk-FLPPA2XY.js → chunk-VWOTHDSE.js} +9 -4
- package/dist/chunk-VWOTHDSE.js.map +1 -0
- package/dist/chunk-XLHJCJ4O.js +15 -0
- package/dist/chunk-XLHJCJ4O.js.map +1 -0
- package/dist/{chunk-G4ZUJCEN.js → chunk-XORHAB3R.js} +101 -47
- package/dist/chunk-XORHAB3R.js.map +1 -0
- package/dist/{chunk-C2YM5GNF.js → chunk-XUKBM64A.js} +3 -3
- package/dist/{chunk-FZ7EMXIM.js → chunk-XZQGSUV7.js} +10 -8
- package/dist/chunk-XZQGSUV7.js.map +1 -0
- package/dist/{chunk-3ONT32BO.js → chunk-ZVUIG6A4.js} +30 -24
- package/dist/{chunk-3ONT32BO.js.map → chunk-ZVUIG6A4.js.map} +1 -1
- package/dist/cli.js +16 -15
- package/dist/cli.js.map +1 -1
- package/dist/{config-loader-MX232REU.js → config-loader-IDIKOQ4T.js} +3 -3
- package/dist/{console-OHKVJLW3.js → console-Z7F7X3WY.js} +40 -39
- package/dist/console-Z7F7X3WY.js.map +1 -0
- package/dist/{doctor-command-YTT5SMQW.js → doctor-command-2PSDOREK.js} +7 -7
- package/dist/{driver-X4FWTDNU.js → driver-TNQ6HSID.js} +6 -6
- package/dist/{driver-AN3I4H6O.js → driver-TTJVCWCD.js} +7 -7
- package/dist/drivers/appium/android.d.ts +1 -1
- package/dist/drivers/appium/ios.d.ts +1 -1
- package/dist/drivers/cdp-browser.d.ts +1 -1
- package/dist/drivers/cdp-browser.d.ts.map +1 -1
- package/dist/drivers/device-controls.d.ts +1 -1
- package/dist/drivers/electrobun.d.ts +1 -1
- package/dist/drivers/electron.d.ts +1 -1
- package/dist/drivers/playwright.d.ts +2 -1
- package/dist/drivers/playwright.d.ts.map +1 -1
- package/dist/drivers/raw-driver.d.ts +2 -1
- package/dist/drivers/uiautomator2/driver.d.ts +1 -1
- package/dist/drivers/wasm.d.ts +1 -1
- package/dist/drivers/wda/driver.d.ts +1 -1
- package/dist/{electrobun-OUTYOM5G.js → electrobun-6ZJ6QFVQ.js} +5 -5
- package/dist/errors.d.ts +12 -12
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -45
- package/dist/index.js.map +1 -1
- package/dist/{json-QVHG6I3O.js → json-RNYQ54R7.js} +8 -7
- package/dist/json-RNYQ54R7.js.map +1 -0
- package/dist/{local-UWIYOREU.js → local-E6FJI3QK.js} +5 -5
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/{playwright-KBWUBU5S.js → playwright-LS35WXQ6.js} +6 -6
- package/dist/report/console.d.ts +2 -0
- package/dist/report/console.d.ts.map +1 -1
- package/dist/report/json.d.ts +5 -1
- package/dist/report/json.d.ts.map +1 -1
- package/dist/runtime/local.d.ts.map +1 -1
- package/dist/runtime/web-server.d.ts.map +1 -1
- package/dist/schemas/config.d.ts +39 -484
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/device.d.ts +1 -1
- package/dist/schemas/element.d.ts +1 -1
- package/dist/schemas/selector.d.ts +1 -1
- package/dist/{server-CWCMC244.js → server-A6Y6ZMET.js} +2 -2
- package/dist/{server-BS3O4WVU.js → server-D3HOIPQE.js} +16 -16
- package/dist/{session-YWYRRXXR.js → session-2VIEKA6A.js} +16 -16
- package/dist/session-2VIEKA6A.js.map +1 -0
- package/dist/smart/auto-wait.d.ts +1 -1
- package/dist/smart/channel-resolver.d.ts +1 -1
- package/dist/smart/channel-resolver.d.ts.map +1 -1
- package/dist/smart/coordinator.d.ts +6 -2
- package/dist/smart/coordinator.d.ts.map +1 -1
- package/dist/smart/hierarchy-cache.d.ts +1 -1
- package/dist/studio/context.d.ts +1 -1
- package/dist/studio/effect-handler.d.ts +3 -1
- package/dist/{studio-command-XJDGLNAJ.js → studio-command-SPHIXFIW.js} +2 -2
- package/dist/{test-command-3IRGNEPB.js → test-command-OYMJNT23.js} +19 -19
- package/dist/vendor/effect/Array.d.ts +841 -0
- package/dist/vendor/effect/BigDecimal.d.ts +227 -0
- package/dist/vendor/effect/Brand.d.ts +71 -0
- package/dist/vendor/effect/ByteSize.d.ts +218 -0
- package/dist/vendor/effect/Cache.d.ts +104 -0
- package/dist/vendor/effect/Cause.d.ts +242 -0
- package/dist/vendor/effect/Channel.d.ts +1004 -0
- package/dist/vendor/effect/Chunk.d.ts +499 -0
- package/dist/vendor/effect/Clock.d.ts +31 -0
- package/dist/vendor/effect/Combiner.d.ts +23 -0
- package/dist/vendor/effect/Context.d.ts +167 -0
- package/dist/vendor/effect/Cron.d.ts +79 -0
- package/dist/vendor/effect/Data.d.ts +146 -0
- package/dist/vendor/effect/DateTime.d.ts +554 -0
- package/dist/vendor/effect/Deferred.d.ts +135 -0
- package/dist/vendor/effect/Differ.d.ts +8 -0
- package/dist/vendor/effect/Duration.d.ts +270 -0
- package/dist/vendor/effect/Effect.d.ts +2606 -0
- package/dist/vendor/effect/Equal.d.ts +20 -0
- package/dist/vendor/effect/Equivalence.d.ts +55 -0
- package/dist/vendor/effect/ExecutionPlan.d.ts +131 -0
- package/dist/vendor/effect/Exit.d.ts +114 -0
- package/dist/vendor/effect/Fiber.d.ts +90 -0
- package/dist/vendor/effect/FileSystem.d.ts +227 -0
- package/dist/vendor/effect/Filter.d.ts +133 -0
- package/dist/vendor/effect/Formatter.d.ts +13 -0
- package/dist/vendor/effect/Function.d.ts +91 -0
- package/dist/vendor/effect/Graph.d.ts +638 -0
- package/dist/vendor/effect/HKT.d.ts +30 -0
- package/dist/vendor/effect/Hash.d.ts +31 -0
- package/dist/vendor/effect/HashMap.d.ts +225 -0
- package/dist/vendor/effect/HashSet.d.ts +122 -0
- package/dist/vendor/effect/Inspectable.d.ts +25 -0
- package/dist/vendor/effect/JsonPatch.d.ts +26 -0
- package/dist/vendor/effect/JsonSchema.d.ts +43 -0
- package/dist/vendor/effect/LICENSE +21 -0
- package/dist/vendor/effect/Latch.d.ts +48 -0
- package/dist/vendor/effect/Layer.d.ts +273 -0
- package/dist/vendor/effect/LogLevel.d.ts +46 -0
- package/dist/vendor/effect/Logger.d.ts +106 -0
- package/dist/vendor/effect/ManagedRuntime.d.ts +52 -0
- package/dist/vendor/effect/Metric.d.ts +266 -0
- package/dist/vendor/effect/MutableHashMap.d.ts +80 -0
- package/dist/vendor/effect/MutableList.d.ts +52 -0
- package/dist/vendor/effect/MutableRef.d.ts +76 -0
- package/dist/vendor/effect/NonEmptyIterable.d.ts +9 -0
- package/dist/vendor/effect/Optic.d.ts +155 -0
- package/dist/vendor/effect/Option.d.ts +380 -0
- package/dist/vendor/effect/Order.d.ts +110 -0
- package/dist/vendor/effect/Ordering.d.ts +24 -0
- package/dist/vendor/effect/Path.d.ts +44 -0
- package/dist/vendor/effect/Pipeable.d.ts +38 -0
- package/dist/vendor/effect/PlatformError.d.ts +63 -0
- package/dist/vendor/effect/Predicate.d.ts +227 -0
- package/dist/vendor/effect/PrimaryKey.d.ts +11 -0
- package/dist/vendor/effect/PubSub.d.ts +229 -0
- package/dist/vendor/effect/Pull.d.ts +54 -0
- package/dist/vendor/effect/Queue.d.ts +212 -0
- package/dist/vendor/effect/Rational.d.ts +212 -0
- package/dist/vendor/effect/Record.d.ts +247 -0
- package/dist/vendor/effect/Redactable.d.ts +14 -0
- package/dist/vendor/effect/Redacted.d.ts +34 -0
- package/dist/vendor/effect/Reducer.d.ts +13 -0
- package/dist/vendor/effect/References.d.ts +53 -0
- package/dist/vendor/effect/Request.d.ts +106 -0
- package/dist/vendor/effect/RequestResolver.d.ts +159 -0
- package/dist/vendor/effect/Result.d.ts +285 -0
- package/dist/vendor/effect/Schedule.d.ts +172 -0
- package/dist/vendor/effect/Scheduler.d.ts +45 -0
- package/dist/vendor/effect/Schema.d.ts +3205 -0
- package/dist/vendor/effect/SchemaAST.d.ts +356 -0
- package/dist/vendor/effect/SchemaGetter.d.ts +181 -0
- package/dist/vendor/effect/SchemaIssue.d.ts +147 -0
- package/dist/vendor/effect/SchemaParser.d.ts +57 -0
- package/dist/vendor/effect/SchemaRepresentation.d.ts +563 -0
- package/dist/vendor/effect/SchemaTransformation.d.ts +155 -0
- package/dist/vendor/effect/Scope.d.ts +69 -0
- package/dist/vendor/effect/SemVer.d.ts +209 -0
- package/dist/vendor/effect/SemVerRange.d.ts +74 -0
- package/dist/vendor/effect/Semaphore.d.ts +87 -0
- package/dist/vendor/effect/Sink.d.ts +337 -0
- package/dist/vendor/effect/StandardSchema.d.ts +112 -0
- package/dist/vendor/effect/Stream.d.ts +1762 -0
- package/dist/vendor/effect/Struct.d.ts +162 -0
- package/dist/vendor/effect/Take.d.ts +8 -0
- package/dist/vendor/effect/Tracer.d.ts +150 -0
- package/dist/vendor/effect/TxRef.d.ts +40 -0
- package/dist/vendor/effect/Types.d.ts +139 -0
- package/dist/vendor/effect/Unify.d.ts +50 -0
- package/dist/vendor/effect/Utils.d.ts +31 -0
- package/dist/vendor/effect/crypto/Aead.d.ts +72 -0
- package/dist/vendor/effect/crypto/Cipher.d.ts +54 -0
- package/dist/vendor/effect/crypto/CryptoError.d.ts +81 -0
- package/dist/vendor/effect/crypto/Digest.d.ts +32 -0
- package/dist/vendor/effect/crypto/KeyAgreement.d.ts +80 -0
- package/dist/vendor/effect/crypto/KeyFormat.d.ts +82 -0
- package/dist/vendor/effect/crypto/KeyWrap.d.ts +97 -0
- package/dist/vendor/effect/crypto/Mac.d.ts +56 -0
- package/dist/vendor/effect/crypto/SecureRandom.d.ts +63 -0
- package/dist/vendor/effect/crypto/Signature.d.ts +122 -0
- package/dist/vendor/effect/crypto/WebCrypto.d.ts +18 -0
- package/dist/vendor/effect/http/Cookies.d.ts +185 -0
- package/dist/vendor/effect/http/Headers.d.ts +144 -0
- package/dist/vendor/effect/http/UrlParams.d.ts +122 -0
- package/dist/vendor/effect/internal/schemaError.d.ts +3 -0
- package/dist/vendor/effect/net/Dns.d.ts +166 -0
- package/dist/vendor/effect/net/Host.d.ts +80 -0
- package/dist/vendor/effect/net/IpInterface.d.ts +65 -0
- package/dist/vendor/effect/net/IpNetwork.d.ts +89 -0
- package/dist/vendor/effect/net/NetAddress.d.ts +350 -0
- package/dist/vendor/effect/persistence/KeyValueStore.d.ts +138 -0
- package/dist/vendor/effect/persistence/Persistable.d.ts +56 -0
- package/dist/vendor/effect/persistence/Persistence.d.ts +83 -0
- package/dist/vendor/effect/persistence/Redis.d.ts +98 -0
- package/dist/vendor/effect/reactivity/Reactivity.d.ts +59 -0
- package/dist/vendor/effect/sql/SqlClient.d.ts +121 -0
- package/dist/vendor/effect/sql/SqlConnection.d.ts +26 -0
- package/dist/vendor/effect/sql/SqlError.d.ts +186 -0
- package/dist/vendor/effect/sql/Statement.d.ts +225 -0
- package/native/win32-x64/spana_native.dll +0 -0
- package/package.json +4 -3
- package/dist/chunk-44U3F2RY.js.map +0 -1
- package/dist/chunk-6X2SK2XO.js.map +0 -1
- package/dist/chunk-7K24Q7V3.js.map +0 -1
- package/dist/chunk-E67QUGT3.js.map +0 -1
- package/dist/chunk-FLPPA2XY.js.map +0 -1
- package/dist/chunk-FZ7EMXIM.js.map +0 -1
- package/dist/chunk-G4ZUJCEN.js.map +0 -1
- package/dist/chunk-NR4QAM5W.js.map +0 -1
- package/dist/console-OHKVJLW3.js.map +0 -1
- package/dist/json-QVHG6I3O.js.map +0 -1
- /package/dist/{app-LGNFQMU7.js.map → app-ZSRJ3VFR.js.map} +0 -0
- /package/dist/{appium-2PJWZXJI.js.map → appium-LOAWWZXA.js.map} +0 -0
- /package/dist/{config-loader-MX232REU.js.map → build-info-KFFGVWDQ.js.map} +0 -0
- /package/dist/{chunk-AP5SGSO7.js.map → chunk-42D5LOGH.js.map} +0 -0
- /package/dist/{chunk-CQ67PB3R.js.map → chunk-6GLL6SMP.js.map} +0 -0
- /package/dist/{chunk-IJWAAODK.js.map → chunk-7QJY2HJO.js.map} +0 -0
- /package/dist/{chunk-DNWVDGKS.js.map → chunk-GBV3XDWM.js.map} +0 -0
- /package/dist/{chunk-C7HZJIGQ.js.map → chunk-HX2PKESI.js.map} +0 -0
- /package/dist/{chunk-NC32K762.js.map → chunk-QNCTEV2P.js.map} +0 -0
- /package/dist/{chunk-C2YM5GNF.js.map → chunk-XUKBM64A.js.map} +0 -0
- /package/dist/{driver-AN3I4H6O.js.map → config-loader-IDIKOQ4T.js.map} +0 -0
- /package/dist/{doctor-command-YTT5SMQW.js.map → doctor-command-2PSDOREK.js.map} +0 -0
- /package/dist/{driver-X4FWTDNU.js.map → driver-TNQ6HSID.js.map} +0 -0
- /package/dist/{electrobun-OUTYOM5G.js.map → driver-TTJVCWCD.js.map} +0 -0
- /package/dist/{local-UWIYOREU.js.map → electrobun-6ZJ6QFVQ.js.map} +0 -0
- /package/dist/{playwright-KBWUBU5S.js.map → local-E6FJI3QK.js.map} +0 -0
- /package/dist/{server-CWCMC244.js.map → playwright-LS35WXQ6.js.map} +0 -0
- /package/dist/{session-YWYRRXXR.js.map → server-A6Y6ZMET.js.map} +0 -0
- /package/dist/{server-BS3O4WVU.js.map → server-D3HOIPQE.js.map} +0 -0
- /package/dist/{studio-command-XJDGLNAJ.js.map → studio-command-SPHIXFIW.js.map} +0 -0
- /package/dist/{test-command-3IRGNEPB.js.map → test-command-OYMJNT23.js.map} +0 -0
|
@@ -0,0 +1,638 @@
|
|
|
1
|
+
|
|
2
|
+
import * as Equal from "./Equal.ts";
|
|
3
|
+
import type { Inspectable } from "./Inspectable.ts";
|
|
4
|
+
import * as Option from "./Option.ts";
|
|
5
|
+
import type { Pipeable } from "./Pipeable.ts";
|
|
6
|
+
import type { Covariant, Invariant } from "./Types.ts";
|
|
7
|
+
declare const TypeId = "~effect/Graph";
|
|
8
|
+
|
|
9
|
+
export type NodeIndex = number;
|
|
10
|
+
|
|
11
|
+
export type EdgeIndex = number;
|
|
12
|
+
|
|
13
|
+
export interface Edge<out E> {
|
|
14
|
+
readonly source: NodeIndex;
|
|
15
|
+
readonly target: NodeIndex;
|
|
16
|
+
readonly data: E;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type Kind = "directed" | "undirected";
|
|
20
|
+
|
|
21
|
+
export interface IndexedNode<out N> {
|
|
22
|
+
readonly index: NodeIndex;
|
|
23
|
+
readonly data: N;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface IndexedEdge<out E> extends Edge<E> {
|
|
27
|
+
readonly index: EdgeIndex;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface Snapshot<out N, out E, out T extends Kind> {
|
|
31
|
+
readonly type: T;
|
|
32
|
+
readonly nodes: ReadonlyArray<IndexedNode<N>>;
|
|
33
|
+
readonly edges: ReadonlyArray<IndexedEdge<E>>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface Graph<out N, out E, T extends Kind = "directed"> extends Iterable<readonly [NodeIndex, N]>, Equal.Equal, Pipeable, Inspectable {
|
|
37
|
+
readonly [TypeId]: Graph.Variance<N, E>;
|
|
38
|
+
readonly type: T;
|
|
39
|
+
readonly mutable: false;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export declare namespace Graph {
|
|
43
|
+
|
|
44
|
+
interface Variance<out N, out E> {
|
|
45
|
+
readonly _N: Covariant<N>;
|
|
46
|
+
readonly _E: Covariant<E>;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface MutableGraph<in out N, in out E, T extends Kind = "directed"> extends Iterable<readonly [NodeIndex, N]>, Equal.Equal, Pipeable, Inspectable {
|
|
51
|
+
readonly [TypeId]: MutableGraph.Variance<N, E>;
|
|
52
|
+
readonly type: T;
|
|
53
|
+
readonly mutable: true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export declare namespace MutableGraph {
|
|
57
|
+
|
|
58
|
+
interface Variance<in out N, in out E> {
|
|
59
|
+
readonly _N: Invariant<N>;
|
|
60
|
+
readonly _E: Invariant<E>;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type DirectedGraph<N, E> = Graph<N, E, "directed">;
|
|
65
|
+
|
|
66
|
+
export type UndirectedGraph<N, E> = Graph<N, E, "undirected">;
|
|
67
|
+
|
|
68
|
+
export type MutableDirectedGraph<N, E> = MutableGraph<N, E, "directed">;
|
|
69
|
+
|
|
70
|
+
export type MutableUndirectedGraph<N, E> = MutableGraph<N, E, "undirected">;
|
|
71
|
+
declare const GraphError_base: new <A extends Record<string, any> = {}>(args: import("./Types.ts").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("./Cause.ts").YieldableError & {
|
|
72
|
+
readonly _tag: "GraphError";
|
|
73
|
+
} & Readonly<A>;
|
|
74
|
+
|
|
75
|
+
export declare class GraphError extends GraphError_base<{
|
|
76
|
+
readonly message: string;
|
|
77
|
+
}> {
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export declare const isGraph: <N = unknown, E = unknown, T extends Kind = Kind, U = never>(u: U | Graph<N, E, T> | MutableGraph<N, E, T>) => u is Graph<N, E, T> | MutableGraph<N, E, T>;
|
|
81
|
+
|
|
82
|
+
export declare const fromSnapshot: <N, E, T extends Kind>(snapshot: Snapshot<N, E, T>) => Graph<N, E, T>;
|
|
83
|
+
|
|
84
|
+
export declare const toSnapshot: <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Snapshot<N, E, T>;
|
|
85
|
+
|
|
86
|
+
export declare const make: <T extends Kind>(type: T) => <N, E>(mutate?: (mutable: MutableGraph<N, E, T>) => undefined) => Graph<N, E, T>;
|
|
87
|
+
|
|
88
|
+
export declare const directed: <N, E>(mutate?: (mutable: MutableDirectedGraph<N, E>) => undefined) => DirectedGraph<N, E>;
|
|
89
|
+
|
|
90
|
+
export declare const undirected: <N, E>(mutate?: (mutable: MutableUndirectedGraph<N, E>) => undefined) => UndirectedGraph<N, E>;
|
|
91
|
+
|
|
92
|
+
export declare const beginMutation: <N, E, T extends Kind = "directed">(graph: Graph<N, E, T>) => MutableGraph<N, E, T>;
|
|
93
|
+
|
|
94
|
+
export declare const endMutation: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>) => Graph<N, E, T>;
|
|
95
|
+
|
|
96
|
+
export declare const mutate: {
|
|
97
|
+
|
|
98
|
+
<N, E, T extends Kind = "directed">(f: (mutable: MutableGraph<N, E, T>) => undefined): (graph: Graph<N, E, T>) => Graph<N, E, T>;
|
|
99
|
+
|
|
100
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T>, f: (mutable: MutableGraph<N, E, T>) => undefined): Graph<N, E, T>;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export interface IdentityOptions<N, E, NI = N, EI = E> {
|
|
104
|
+
readonly nodeIdentity?: (node: N) => NI;
|
|
105
|
+
readonly edgeIdentity?: (edge: E) => EI;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export declare const compose: {
|
|
109
|
+
|
|
110
|
+
<N, E, T extends Kind = "directed", NI = N, EI = E>(that: Graph<N, E, T>, options?: IdentityOptions<N, E, NI, EI>): (self: Graph<N, E, NoInfer<T>>) => Graph<N, E, T>;
|
|
111
|
+
|
|
112
|
+
<N, E, T extends Kind = "directed", NI = N, EI = E>(self: Graph<N, E, T>, that: Graph<N, E, NoInfer<T>>, options?: IdentityOptions<N, E, NI, EI>): Graph<N, E, T>;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export declare const intersection: {
|
|
116
|
+
|
|
117
|
+
<N, E, T extends Kind = "directed", NI = N, EI = E>(that: Graph<N, E, T>, options?: IdentityOptions<N, E, NI, EI>): (self: Graph<N, E, NoInfer<T>>) => Graph<N, E, T>;
|
|
118
|
+
|
|
119
|
+
<N, E, T extends Kind = "directed", NI = N, EI = E>(self: Graph<N, E, T>, that: Graph<N, E, NoInfer<T>>, options?: IdentityOptions<N, E, NI, EI>): Graph<N, E, T>;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export declare const difference: {
|
|
123
|
+
|
|
124
|
+
<N, E, T extends Kind = "directed", NI = N, EI = E>(that: Graph<N, E, T>, options?: IdentityOptions<N, E, NI, EI>): (self: Graph<N, E, NoInfer<T>>) => Graph<N, E, T>;
|
|
125
|
+
|
|
126
|
+
<N, E, T extends Kind = "directed", NI = N, EI = E>(self: Graph<N, E, T>, that: Graph<N, E, NoInfer<T>>, options?: IdentityOptions<N, E, NI, EI>): Graph<N, E, T>;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export declare const symmetricDifference: {
|
|
130
|
+
|
|
131
|
+
<N, E, T extends Kind = "directed", NI = N, EI = E>(that: Graph<N, E, T>, options?: IdentityOptions<N, E, NI, EI>): (self: Graph<N, E, NoInfer<T>>) => Graph<N, E, T>;
|
|
132
|
+
|
|
133
|
+
<N, E, T extends Kind = "directed", NI = N, EI = E>(self: Graph<N, E, T>, that: Graph<N, E, NoInfer<T>>, options?: IdentityOptions<N, E, NI, EI>): Graph<N, E, T>;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export declare const complement: {
|
|
137
|
+
|
|
138
|
+
<N, E>(createEdge: (source: N, target: N) => E): <T extends Kind = "directed">(self: Graph<N, E, T>) => Graph<N, E, T>;
|
|
139
|
+
|
|
140
|
+
<N, E, T extends Kind = "directed">(self: Graph<N, E, T>, createEdge: (source: N, target: N) => E): Graph<N, E, T>;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export interface NeighborhoodConfig {
|
|
144
|
+
readonly radius?: number;
|
|
145
|
+
readonly direction?: TraversalDirection;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export declare const neighborhood: {
|
|
149
|
+
|
|
150
|
+
(nodeIndex: NodeIndex, options?: NeighborhoodConfig): <N, E, T extends Kind = "directed">(self: Graph<N, E, T>) => Graph<N, E, T>;
|
|
151
|
+
|
|
152
|
+
<N, E, T extends Kind = "directed">(self: Graph<N, E, T>, nodeIndex: NodeIndex, options?: NeighborhoodConfig): Graph<N, E, T>;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export declare const inducedSubgraph: {
|
|
156
|
+
|
|
157
|
+
(nodeIndices: Iterable<NodeIndex>): <N, E, T extends Kind = "directed">(self: Graph<N, E, T>) => Graph<N, E, T>;
|
|
158
|
+
|
|
159
|
+
<N, E, T extends Kind = "directed">(self: Graph<N, E, T>, nodeIndices: Iterable<NodeIndex>): Graph<N, E, T>;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export declare const sum: {
|
|
163
|
+
|
|
164
|
+
<N, E, T extends Kind>(that: Graph<N, E, T>): (self: Graph<N, E, NoInfer<T>>) => Graph<N, E, T>;
|
|
165
|
+
|
|
166
|
+
<N, E, T extends Kind>(self: Graph<N, E, T>, that: Graph<N, E, NoInfer<T>>): Graph<N, E, T>;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export declare const addNode: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>, data: N) => NodeIndex;
|
|
170
|
+
|
|
171
|
+
export declare const getNode: {
|
|
172
|
+
|
|
173
|
+
(nodeIndex: NodeIndex): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<N>;
|
|
174
|
+
|
|
175
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, nodeIndex: NodeIndex): Option.Option<N>;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export declare const hasNode: {
|
|
179
|
+
|
|
180
|
+
(nodeIndex: NodeIndex): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => boolean;
|
|
181
|
+
|
|
182
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, nodeIndex: NodeIndex): boolean;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export declare const nodeCount: <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => number;
|
|
186
|
+
|
|
187
|
+
export declare const findNode: {
|
|
188
|
+
|
|
189
|
+
<N>(predicate: (data: N) => boolean): <E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<NodeIndex>;
|
|
190
|
+
|
|
191
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, predicate: (data: N) => boolean): Option.Option<NodeIndex>;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export declare const findNodes: {
|
|
195
|
+
|
|
196
|
+
<N>(predicate: (data: N) => boolean): <E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Array<NodeIndex>;
|
|
197
|
+
|
|
198
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, predicate: (data: N) => boolean): Array<NodeIndex>;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export declare const findEdge: {
|
|
202
|
+
|
|
203
|
+
<E>(predicate: (data: E, source: NodeIndex, target: NodeIndex) => boolean): <N, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<EdgeIndex>;
|
|
204
|
+
|
|
205
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, predicate: (data: E, source: NodeIndex, target: NodeIndex) => boolean): Option.Option<EdgeIndex>;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
export declare const findEdges: {
|
|
209
|
+
|
|
210
|
+
<E>(predicate: (data: E, source: NodeIndex, target: NodeIndex) => boolean): <N, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Array<EdgeIndex>;
|
|
211
|
+
|
|
212
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, predicate: (data: E, source: NodeIndex, target: NodeIndex) => boolean): Array<EdgeIndex>;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
export declare const updateNode: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>, index: NodeIndex, f: (data: N) => N) => void;
|
|
216
|
+
|
|
217
|
+
export declare const updateEdge: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>, edgeIndex: EdgeIndex, f: (data: E) => E) => void;
|
|
218
|
+
|
|
219
|
+
export declare const mapNodes: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>, f: (data: N) => N) => void;
|
|
220
|
+
|
|
221
|
+
export declare const mapEdges: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>, f: (data: E) => E) => void;
|
|
222
|
+
|
|
223
|
+
export declare const reverse: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>) => void;
|
|
224
|
+
|
|
225
|
+
export declare const filterMapNodes: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>, f: (data: N) => Option.Option<N>) => void;
|
|
226
|
+
|
|
227
|
+
export declare const filterMapEdges: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>, f: (data: E) => Option.Option<E>) => void;
|
|
228
|
+
|
|
229
|
+
export declare const filterNodes: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>, predicate: (data: N) => boolean) => void;
|
|
230
|
+
|
|
231
|
+
export declare const filterEdges: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>, predicate: (data: E) => boolean) => void;
|
|
232
|
+
|
|
233
|
+
export declare const addEdge: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>, source: NodeIndex, target: NodeIndex, data: E) => EdgeIndex;
|
|
234
|
+
|
|
235
|
+
export declare const removeNode: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>, nodeIndex: NodeIndex) => void;
|
|
236
|
+
|
|
237
|
+
export declare const removeNodes: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>, nodeIndices: Iterable<NodeIndex>) => void;
|
|
238
|
+
|
|
239
|
+
export declare const removeEdge: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>, edgeIndex: EdgeIndex) => void;
|
|
240
|
+
|
|
241
|
+
export declare const removeEdges: <N, E, T extends Kind = "directed">(mutable: MutableGraph<N, E, T>, edgeIndices: Iterable<EdgeIndex>) => void;
|
|
242
|
+
|
|
243
|
+
export declare const getEdge: {
|
|
244
|
+
|
|
245
|
+
(edgeIndex: EdgeIndex): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<Edge<E>>;
|
|
246
|
+
|
|
247
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, edgeIndex: EdgeIndex): Option.Option<Edge<E>>;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
export declare const hasEdge: {
|
|
251
|
+
|
|
252
|
+
(source: NodeIndex, target: NodeIndex): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => boolean;
|
|
253
|
+
|
|
254
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, source: NodeIndex, target: NodeIndex): boolean;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export declare const edgeCount: <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => number;
|
|
258
|
+
|
|
259
|
+
export declare const incidentEdges: {
|
|
260
|
+
|
|
261
|
+
(nodeIndex: NodeIndex): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Array<EdgeIndex>;
|
|
262
|
+
|
|
263
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, nodeIndex: NodeIndex): Array<EdgeIndex>;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
export declare const outgoingEdges: {
|
|
267
|
+
|
|
268
|
+
(nodeIndex: NodeIndex): <N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => Array<EdgeIndex>;
|
|
269
|
+
|
|
270
|
+
<N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">, nodeIndex: NodeIndex): Array<EdgeIndex>;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export declare const incomingEdges: {
|
|
274
|
+
|
|
275
|
+
(nodeIndex: NodeIndex): <N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => Array<EdgeIndex>;
|
|
276
|
+
|
|
277
|
+
<N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">, nodeIndex: NodeIndex): Array<EdgeIndex>;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
export declare const edgesBetween: {
|
|
281
|
+
|
|
282
|
+
(source: NodeIndex, target: NodeIndex): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Array<EdgeIndex>;
|
|
283
|
+
|
|
284
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, source: NodeIndex, target: NodeIndex): Array<EdgeIndex>;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
export declare const degree: {
|
|
288
|
+
|
|
289
|
+
(nodeIndex: NodeIndex): <N, E>(graph: Graph<N, E, "undirected"> | MutableGraph<N, E, "undirected">) => number;
|
|
290
|
+
|
|
291
|
+
<N, E>(graph: Graph<N, E, "undirected"> | MutableGraph<N, E, "undirected">, nodeIndex: NodeIndex): number;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
export declare const outDegree: {
|
|
295
|
+
|
|
296
|
+
(nodeIndex: NodeIndex): <N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => number;
|
|
297
|
+
|
|
298
|
+
<N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">, nodeIndex: NodeIndex): number;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
export declare const inDegree: {
|
|
302
|
+
|
|
303
|
+
(nodeIndex: NodeIndex): <N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => number;
|
|
304
|
+
|
|
305
|
+
<N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">, nodeIndex: NodeIndex): number;
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
export declare const neighbors: {
|
|
309
|
+
|
|
310
|
+
(nodeIndex: NodeIndex): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Array<NodeIndex>;
|
|
311
|
+
|
|
312
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, nodeIndex: NodeIndex): Array<NodeIndex>;
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
export declare const successors: {
|
|
316
|
+
|
|
317
|
+
(nodeIndex: NodeIndex): <N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => Array<NodeIndex>;
|
|
318
|
+
|
|
319
|
+
<N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">, nodeIndex: NodeIndex): Array<NodeIndex>;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
export declare const predecessors: {
|
|
323
|
+
|
|
324
|
+
(nodeIndex: NodeIndex): <N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => Array<NodeIndex>;
|
|
325
|
+
|
|
326
|
+
<N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">, nodeIndex: NodeIndex): Array<NodeIndex>;
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
export declare const neighborsDirected: {
|
|
330
|
+
|
|
331
|
+
(nodeIndex: NodeIndex, direction: Direction): <N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => Array<NodeIndex>;
|
|
332
|
+
|
|
333
|
+
<N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">, nodeIndex: NodeIndex, direction: Direction): Array<NodeIndex>;
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
export interface GraphVizOptions<N, E> {
|
|
337
|
+
|
|
338
|
+
readonly nodeLabel?: (data: N) => string;
|
|
339
|
+
|
|
340
|
+
readonly edgeLabel?: (data: E) => string;
|
|
341
|
+
|
|
342
|
+
readonly graphName?: string;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export declare const toGraphViz: {
|
|
346
|
+
|
|
347
|
+
<N, E>(options?: GraphVizOptions<N, E>): <T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => string;
|
|
348
|
+
|
|
349
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, options?: GraphVizOptions<N, E>): string;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
export type MermaidNodeShape = "rectangle" | "rounded" | "circle" | "diamond" | "hexagon" | "stadium" | "subroutine" | "cylindrical";
|
|
353
|
+
|
|
354
|
+
export type MermaidDirection = "TB" | "TD" | "BT" | "RL" | "LR";
|
|
355
|
+
|
|
356
|
+
export type MermaidDiagramType = "flowchart" | "graph";
|
|
357
|
+
|
|
358
|
+
export interface MermaidOptions<N, E> {
|
|
359
|
+
|
|
360
|
+
readonly nodeLabel?: (data: N) => string;
|
|
361
|
+
|
|
362
|
+
readonly edgeLabel?: (data: E) => string;
|
|
363
|
+
|
|
364
|
+
readonly diagramType?: MermaidDiagramType;
|
|
365
|
+
|
|
366
|
+
readonly direction?: MermaidDirection;
|
|
367
|
+
|
|
368
|
+
readonly nodeShape?: (data: N) => MermaidNodeShape;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export declare const toMermaid: {
|
|
372
|
+
|
|
373
|
+
<N, E>(options?: MermaidOptions<N, E>): <T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => string;
|
|
374
|
+
|
|
375
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, options?: MermaidOptions<N, E>): string;
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
export type Direction = "outgoing" | "incoming";
|
|
379
|
+
|
|
380
|
+
export type TraversalDirection = Direction | "undirected";
|
|
381
|
+
|
|
382
|
+
export interface CycleResult {
|
|
383
|
+
readonly path: Array<NodeIndex>;
|
|
384
|
+
readonly edges: Array<EdgeIndex>;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export declare const findCycle: <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<CycleResult>;
|
|
388
|
+
|
|
389
|
+
export declare const isAcyclic: <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => boolean;
|
|
390
|
+
|
|
391
|
+
export declare const isBipartite: <N, E>(graph: Graph<N, E, "undirected"> | MutableGraph<N, E, "undirected">) => boolean;
|
|
392
|
+
|
|
393
|
+
export interface BipartiteMatch {
|
|
394
|
+
readonly left: NodeIndex;
|
|
395
|
+
readonly right: NodeIndex;
|
|
396
|
+
readonly edge: EdgeIndex;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export declare const maximumBipartiteMatching: <N, E>(graph: Graph<N, E, "undirected"> | MutableGraph<N, E, "undirected">) => Array<BipartiteMatch>;
|
|
400
|
+
|
|
401
|
+
export interface ReachabilityConfig {
|
|
402
|
+
readonly direction?: TraversalDirection;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export declare const unweightedDistances: {
|
|
406
|
+
|
|
407
|
+
(source: NodeIndex, options?: ReachabilityConfig): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Map<NodeIndex, number>;
|
|
408
|
+
|
|
409
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, source: NodeIndex, options?: ReachabilityConfig): Map<NodeIndex, number>;
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
export declare const hasPath: {
|
|
413
|
+
|
|
414
|
+
(source: NodeIndex, target: NodeIndex, options?: ReachabilityConfig): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => boolean;
|
|
415
|
+
|
|
416
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, source: NodeIndex, target: NodeIndex, options?: ReachabilityConfig): boolean;
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
export declare const connectedComponents: <N, E>(graph: Graph<N, E, "undirected"> | MutableGraph<N, E, "undirected">) => Array<Array<NodeIndex>>;
|
|
420
|
+
|
|
421
|
+
export declare const bridges: <N, E>(graph: Graph<N, E, "undirected"> | MutableGraph<N, E, "undirected">) => Array<EdgeIndex>;
|
|
422
|
+
|
|
423
|
+
export declare const articulationPoints: <N, E>(graph: Graph<N, E, "undirected"> | MutableGraph<N, E, "undirected">) => Array<NodeIndex>;
|
|
424
|
+
|
|
425
|
+
export declare const biconnectedComponents: <N, E>(graph: Graph<N, E, "undirected"> | MutableGraph<N, E, "undirected">) => Array<Array<NodeIndex>>;
|
|
426
|
+
|
|
427
|
+
export interface MaximumFlowConfig<E> {
|
|
428
|
+
readonly source: NodeIndex;
|
|
429
|
+
readonly target: NodeIndex;
|
|
430
|
+
readonly capacity: (edge: E) => number;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export interface MaximumFlowResult {
|
|
434
|
+
readonly value: number;
|
|
435
|
+
readonly flows: Map<EdgeIndex, number>;
|
|
436
|
+
readonly cut: Array<EdgeIndex>;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
export interface MinimumCutResult {
|
|
440
|
+
readonly value: number;
|
|
441
|
+
readonly edges: Array<EdgeIndex>;
|
|
442
|
+
readonly source: Array<NodeIndex>;
|
|
443
|
+
readonly target: Array<NodeIndex>;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export declare const maximumFlow: {
|
|
447
|
+
|
|
448
|
+
<E>(config: MaximumFlowConfig<E>): <N>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => MaximumFlowResult;
|
|
449
|
+
|
|
450
|
+
<N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">, config: MaximumFlowConfig<E>): MaximumFlowResult;
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
export declare const minimumCut: {
|
|
454
|
+
|
|
455
|
+
<E>(config: MaximumFlowConfig<E>): <N>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => MinimumCutResult;
|
|
456
|
+
|
|
457
|
+
<N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">, config: MaximumFlowConfig<E>): MinimumCutResult;
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
export declare const weaklyConnectedComponents: <N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => Array<Array<NodeIndex>>;
|
|
461
|
+
|
|
462
|
+
export declare const stronglyConnectedComponents: <N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => Array<Array<NodeIndex>>;
|
|
463
|
+
|
|
464
|
+
export declare const isConnected: <N, E>(graph: Graph<N, E, "undirected"> | MutableGraph<N, E, "undirected">) => boolean;
|
|
465
|
+
|
|
466
|
+
export declare const isWeaklyConnected: <N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => boolean;
|
|
467
|
+
|
|
468
|
+
export declare const isStronglyConnected: <N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => boolean;
|
|
469
|
+
|
|
470
|
+
export declare const isTree: <N, E>(graph: Graph<N, E, "undirected"> | MutableGraph<N, E, "undirected">) => boolean;
|
|
471
|
+
|
|
472
|
+
export declare const minimumSpanningForest: {
|
|
473
|
+
|
|
474
|
+
<E>(cost: (edgeData: E) => number): <N>(graph: Graph<N, E, "undirected"> | MutableGraph<N, E, "undirected">) => Graph<N, E, "undirected">;
|
|
475
|
+
|
|
476
|
+
<N, E>(graph: Graph<N, E, "undirected"> | MutableGraph<N, E, "undirected">, cost: (edgeData: E) => number): Graph<N, E, "undirected">;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
export declare const transitiveReduction: <N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => Graph<N, E, "directed">;
|
|
480
|
+
|
|
481
|
+
export interface PathResult<E> {
|
|
482
|
+
readonly path: Array<NodeIndex>;
|
|
483
|
+
readonly edges: Array<EdgeIndex>;
|
|
484
|
+
readonly distance: number;
|
|
485
|
+
readonly costs: Array<E>;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export interface DijkstraConfig<E> {
|
|
489
|
+
source: NodeIndex;
|
|
490
|
+
target: NodeIndex;
|
|
491
|
+
cost: (edgeData: E) => number;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export declare const dijkstra: {
|
|
495
|
+
|
|
496
|
+
<E>(config: DijkstraConfig<E>): <N, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<PathResult<E>>;
|
|
497
|
+
|
|
498
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config: DijkstraConfig<E>): Option.Option<PathResult<E>>;
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
export interface AllPairsResult<E> {
|
|
502
|
+
readonly distances: Map<NodeIndex, Map<NodeIndex, number>>;
|
|
503
|
+
readonly paths: Map<NodeIndex, Map<NodeIndex, Array<NodeIndex> | null>>;
|
|
504
|
+
readonly edges: Map<NodeIndex, Map<NodeIndex, Array<EdgeIndex>>>;
|
|
505
|
+
readonly costs: Map<NodeIndex, Map<NodeIndex, Array<E>>>;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
export declare const floydWarshall: {
|
|
509
|
+
|
|
510
|
+
<E>(cost: (edgeData: E) => number): <N, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => AllPairsResult<E>;
|
|
511
|
+
|
|
512
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, cost: (edgeData: E) => number): AllPairsResult<E>;
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
export interface AstarConfig<E, N> {
|
|
516
|
+
source: NodeIndex;
|
|
517
|
+
target: NodeIndex;
|
|
518
|
+
cost: (edgeData: E) => number;
|
|
519
|
+
heuristic: (sourceNodeData: N, targetNodeData: N) => number;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
export declare const astar: {
|
|
523
|
+
|
|
524
|
+
<E, N>(config: AstarConfig<E, N>): <T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<PathResult<E>>;
|
|
525
|
+
|
|
526
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config: AstarConfig<E, N>): Option.Option<PathResult<E>>;
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
export interface BellmanFordConfig<E> {
|
|
530
|
+
source: NodeIndex;
|
|
531
|
+
target: NodeIndex;
|
|
532
|
+
cost: (edgeData: E) => number;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
export declare const bellmanFord: {
|
|
536
|
+
|
|
537
|
+
<E>(config: BellmanFordConfig<E>): <N, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => Option.Option<PathResult<E>>;
|
|
538
|
+
|
|
539
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config: BellmanFordConfig<E>): Option.Option<PathResult<E>>;
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
export interface PathWalker<E> extends Iterable<PathResult<E>> {
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
export interface SimplePathsConfig {
|
|
546
|
+
readonly source: NodeIndex;
|
|
547
|
+
readonly target: NodeIndex;
|
|
548
|
+
readonly limit?: number;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
export interface AllShortestPathsConfig<E> extends DijkstraConfig<E> {
|
|
552
|
+
readonly limit?: number;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
export declare const simplePaths: {
|
|
556
|
+
|
|
557
|
+
<E>(config: SimplePathsConfig): <N, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => PathWalker<E>;
|
|
558
|
+
|
|
559
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config: SimplePathsConfig): PathWalker<E>;
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
export declare const allShortestPaths: {
|
|
563
|
+
|
|
564
|
+
<E>(config: AllShortestPathsConfig<E>): <N, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => PathWalker<E>;
|
|
565
|
+
|
|
566
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config: AllShortestPathsConfig<E>): PathWalker<E>;
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
export declare class Walker<T, N> implements Iterable<[T, N]> {
|
|
570
|
+
readonly [Symbol.iterator]: () => Iterator<[T, N]>;
|
|
571
|
+
|
|
572
|
+
readonly visit: <U>(f: (index: T, data: N) => U) => Iterable<U>;
|
|
573
|
+
constructor(visit: <U>(f: (index: T, data: N) => U) => Iterable<U>);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
export type NodeWalker<N> = Walker<NodeIndex, N>;
|
|
577
|
+
|
|
578
|
+
export type EdgeWalker<E> = Walker<EdgeIndex, Edge<E>>;
|
|
579
|
+
|
|
580
|
+
export declare const indices: <T, N>(walker: Walker<T, N>) => Iterable<T>;
|
|
581
|
+
|
|
582
|
+
export declare const values: <T, N>(walker: Walker<T, N>) => Iterable<N>;
|
|
583
|
+
|
|
584
|
+
export declare const entries: <T, N>(walker: Walker<T, N>) => Iterable<[T, N]>;
|
|
585
|
+
|
|
586
|
+
export interface SearchConfig {
|
|
587
|
+
readonly start?: Array<NodeIndex>;
|
|
588
|
+
readonly direction?: TraversalDirection;
|
|
589
|
+
readonly radius?: number;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
export declare const dfs: {
|
|
593
|
+
|
|
594
|
+
(config?: SearchConfig): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => NodeWalker<N>;
|
|
595
|
+
|
|
596
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config?: SearchConfig): NodeWalker<N>;
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
export declare const bfs: {
|
|
600
|
+
|
|
601
|
+
(config?: SearchConfig): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => NodeWalker<N>;
|
|
602
|
+
|
|
603
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config?: SearchConfig): NodeWalker<N>;
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
export interface TopoConfig {
|
|
607
|
+
readonly initials?: Array<NodeIndex>;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
export declare const topo: {
|
|
611
|
+
|
|
612
|
+
(config?: TopoConfig): <N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">) => NodeWalker<N>;
|
|
613
|
+
|
|
614
|
+
<N, E>(graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">, config?: TopoConfig): NodeWalker<N>;
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
export declare const dfsPostOrder: {
|
|
618
|
+
|
|
619
|
+
(config?: SearchConfig): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => NodeWalker<N>;
|
|
620
|
+
|
|
621
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config?: SearchConfig): NodeWalker<N>;
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
export declare const nodes: <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => NodeWalker<N>;
|
|
625
|
+
|
|
626
|
+
export declare const edges: <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => EdgeWalker<E>;
|
|
627
|
+
|
|
628
|
+
export interface ExternalsConfig {
|
|
629
|
+
readonly direction?: Direction;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
export declare const externals: {
|
|
633
|
+
|
|
634
|
+
(config?: ExternalsConfig): <N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>) => NodeWalker<N>;
|
|
635
|
+
|
|
636
|
+
<N, E, T extends Kind = "directed">(graph: Graph<N, E, T> | MutableGraph<N, E, T>, config?: ExternalsConfig): NodeWalker<N>;
|
|
637
|
+
};
|
|
638
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
import type * as Types from "./Types.ts";
|
|
3
|
+
|
|
4
|
+
export declare const URI: unique symbol;
|
|
5
|
+
|
|
6
|
+
export interface TypeClass<F extends TypeLambda> {
|
|
7
|
+
readonly [URI]?: F;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface TypeLambda {
|
|
11
|
+
readonly In: unknown;
|
|
12
|
+
readonly Out2: unknown;
|
|
13
|
+
readonly Out1: unknown;
|
|
14
|
+
readonly Target: unknown;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type Kind<F extends TypeLambda, In, Out2, Out1, Target> = F extends {
|
|
18
|
+
readonly type: unknown;
|
|
19
|
+
} ? (F & {
|
|
20
|
+
readonly In: In;
|
|
21
|
+
readonly Out2: Out2;
|
|
22
|
+
readonly Out1: Out1;
|
|
23
|
+
readonly Target: Target;
|
|
24
|
+
})["type"] : {
|
|
25
|
+
readonly F: F;
|
|
26
|
+
readonly In: Types.Contravariant<In>;
|
|
27
|
+
readonly Out2: Types.Covariant<Out2>;
|
|
28
|
+
readonly Out1: Types.Covariant<Out1>;
|
|
29
|
+
readonly Target: Types.Invariant<Target>;
|
|
30
|
+
};
|