@graphrefly/graphrefly 0.24.0 → 0.26.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 +8 -0
- package/dist/{chunk-QOWVNWOC.js → chunk-3ZWCKRHX.js} +27 -25
- package/dist/{chunk-QOWVNWOC.js.map → chunk-3ZWCKRHX.js.map} +1 -1
- package/dist/chunk-6LDQFTYS.js +102 -0
- package/dist/chunk-6LDQFTYS.js.map +1 -0
- package/dist/{chunk-5WGT55R4.js → chunk-AMCG74RZ.js} +195 -24
- package/dist/chunk-AMCG74RZ.js.map +1 -0
- package/dist/{chunk-AOCBDH4T.js → chunk-BVZYTZ5H.js} +76 -103
- package/dist/chunk-BVZYTZ5H.js.map +1 -0
- package/dist/chunk-FQMKGR6L.js +330 -0
- package/dist/chunk-FQMKGR6L.js.map +1 -0
- package/dist/chunk-HXZEYDUR.js +94 -0
- package/dist/chunk-HXZEYDUR.js.map +1 -0
- package/dist/{chunk-IPLKX3L2.js → chunk-IZYUSJC7.js} +16 -14
- package/dist/{chunk-IPLKX3L2.js.map → chunk-IZYUSJC7.js.map} +1 -1
- package/dist/chunk-J22W6HV3.js +107 -0
- package/dist/chunk-J22W6HV3.js.map +1 -0
- package/dist/{chunk-HWPIFSW2.js → chunk-JSCT3CR4.js} +6 -4
- package/dist/{chunk-HWPIFSW2.js.map → chunk-JSCT3CR4.js.map} +1 -1
- package/dist/chunk-JYXEWPH4.js +62 -0
- package/dist/chunk-JYXEWPH4.js.map +1 -0
- package/dist/chunk-LCE3GF5P.js +866 -0
- package/dist/chunk-LCE3GF5P.js.map +1 -0
- package/dist/chunk-MJ2NKQQL.js +119 -0
- package/dist/chunk-MJ2NKQQL.js.map +1 -0
- package/dist/chunk-N6UR7YVY.js +198 -0
- package/dist/chunk-N6UR7YVY.js.map +1 -0
- package/dist/chunk-OHISZPOJ.js +97 -0
- package/dist/chunk-OHISZPOJ.js.map +1 -0
- package/dist/{chunk-5DJTTKX3.js → chunk-PHOUUNK7.js} +74 -111
- package/dist/chunk-PHOUUNK7.js.map +1 -0
- package/dist/{chunk-PY4XCDLR.js → chunk-RB6QPHJ7.js} +8 -6
- package/dist/{chunk-PY4XCDLR.js.map → chunk-RB6QPHJ7.js.map} +1 -1
- package/dist/chunk-SN4YWWYO.js +171 -0
- package/dist/chunk-SN4YWWYO.js.map +1 -0
- package/dist/chunk-SX52TAR4.js +110 -0
- package/dist/chunk-SX52TAR4.js.map +1 -0
- package/dist/{chunk-XOFWRC73.js → chunk-THTWHNU4.js} +319 -24
- package/dist/chunk-THTWHNU4.js.map +1 -0
- package/dist/{chunk-H4RVA4VE.js → chunk-VYPWMZ6H.js} +2 -2
- package/dist/chunk-XGPU467M.js +136 -0
- package/dist/chunk-XGPU467M.js.map +1 -0
- package/dist/{chunk-TDEXAMGO.js → chunk-ZQMEI34O.js} +206 -574
- package/dist/chunk-ZQMEI34O.js.map +1 -0
- package/dist/compat/index.cjs +7656 -0
- package/dist/compat/index.cjs.map +1 -0
- package/dist/compat/index.d.cts +18 -0
- package/dist/compat/index.d.ts +18 -0
- package/dist/compat/index.js +49 -0
- package/dist/compat/index.js.map +1 -0
- package/dist/compat/jotai/index.cjs +2048 -0
- package/dist/compat/jotai/index.cjs.map +1 -0
- package/dist/compat/jotai/index.d.cts +2 -0
- package/dist/compat/jotai/index.d.ts +2 -0
- package/dist/compat/jotai/index.js +9 -0
- package/dist/compat/jotai/index.js.map +1 -0
- package/dist/compat/nanostores/index.cjs +2175 -0
- package/dist/compat/nanostores/index.cjs.map +1 -0
- package/dist/compat/nanostores/index.d.cts +2 -0
- package/dist/compat/nanostores/index.d.ts +2 -0
- package/dist/compat/nanostores/index.js +23 -0
- package/dist/compat/nanostores/index.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +350 -16
- package/dist/compat/nestjs/index.cjs.map +1 -1
- package/dist/compat/nestjs/index.d.cts +6 -6
- package/dist/compat/nestjs/index.d.ts +6 -6
- package/dist/compat/nestjs/index.js +10 -9
- package/dist/compat/react/index.cjs +141 -0
- package/dist/compat/react/index.cjs.map +1 -0
- package/dist/compat/react/index.d.cts +2 -0
- package/dist/compat/react/index.d.ts +2 -0
- package/dist/compat/react/index.js +12 -0
- package/dist/compat/react/index.js.map +1 -0
- package/dist/compat/solid/index.cjs +128 -0
- package/dist/compat/solid/index.cjs.map +1 -0
- package/dist/compat/solid/index.d.cts +2 -0
- package/dist/compat/solid/index.d.ts +2 -0
- package/dist/compat/solid/index.js +12 -0
- package/dist/compat/solid/index.js.map +1 -0
- package/dist/compat/svelte/index.cjs +131 -0
- package/dist/compat/svelte/index.cjs.map +1 -0
- package/dist/compat/svelte/index.d.cts +2 -0
- package/dist/compat/svelte/index.d.ts +2 -0
- package/dist/compat/svelte/index.js +12 -0
- package/dist/compat/svelte/index.js.map +1 -0
- package/dist/compat/vue/index.cjs +146 -0
- package/dist/compat/vue/index.cjs.map +1 -0
- package/dist/compat/vue/index.d.cts +3 -0
- package/dist/compat/vue/index.d.ts +3 -0
- package/dist/compat/vue/index.js +12 -0
- package/dist/compat/vue/index.js.map +1 -0
- package/dist/compat/zustand/index.cjs +4931 -0
- package/dist/compat/zustand/index.cjs.map +1 -0
- package/dist/compat/zustand/index.d.cts +5 -0
- package/dist/compat/zustand/index.d.ts +5 -0
- package/dist/compat/zustand/index.js +12 -0
- package/dist/compat/zustand/index.js.map +1 -0
- package/dist/core/index.cjs +53 -4
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +26 -24
- package/dist/demo-shell-26p5fVxn.d.cts +102 -0
- package/dist/demo-shell-DEp-nMTl.d.ts +102 -0
- package/dist/extra/index.cjs +290 -110
- package/dist/extra/index.cjs.map +1 -1
- package/dist/extra/index.d.cts +5 -4
- package/dist/extra/index.d.ts +5 -4
- package/dist/extra/index.js +8 -5
- package/dist/extra/sources.cjs +2486 -0
- package/dist/extra/sources.cjs.map +1 -0
- package/dist/extra/sources.d.cts +465 -0
- package/dist/extra/sources.d.ts +465 -0
- package/dist/extra/sources.js +57 -0
- package/dist/extra/sources.js.map +1 -0
- package/dist/graph/index.cjs +408 -14
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +5 -5
- package/dist/graph/index.d.ts +5 -5
- package/dist/graph/index.js +13 -5
- package/dist/{graph-D-3JIQme.d.cts → graph-6tZ5jEzr.d.cts} +195 -4
- package/dist/{graph-B6NFqv3z.d.ts → graph-DQ69XU0g.d.ts} +195 -4
- package/dist/index-B4MP_8V_.d.cts +37 -0
- package/dist/index-BEfE8H_G.d.cts +121 -0
- package/dist/{index-D7XgsUt7.d.ts → index-BW1z3BN9.d.ts} +169 -127
- package/dist/index-BYOHF0zP.d.ts +34 -0
- package/dist/index-B_IP40nB.d.cts +36 -0
- package/dist/index-Bd_fwmLf.d.cts +45 -0
- package/dist/{index-BysCTzJz.d.ts → index-BeIdBfcb.d.cts} +121 -547
- package/dist/index-BjI6ty9z.d.ts +121 -0
- package/dist/index-Bxb5ZYc9.d.cts +34 -0
- package/dist/{index-BJB7t9gg.d.cts → index-C0ZXMaXO.d.cts} +2 -2
- package/dist/{index-b5BYtczN.d.cts → index-C8mdwMXc.d.cts} +169 -127
- package/dist/index-CDAjUFIv.d.ts +36 -0
- package/dist/index-CPgZ5wRl.d.ts +44 -0
- package/dist/{index-AMWewNDe.d.cts → index-CUwyr1Kk.d.cts} +33 -4
- package/dist/index-CUyrtuOf.d.cts +127 -0
- package/dist/{index-C-TXEa7C.d.ts → index-CY2TljO4.d.ts} +2 -2
- package/dist/index-CmnuOibw.d.ts +37 -0
- package/dist/{index-DiobMNwE.d.ts → index-CuYwdKO-.d.ts} +3 -3
- package/dist/index-DFhjO4Gg.d.cts +44 -0
- package/dist/{index-1z8vRTCt.d.cts → index-DdD5MVDL.d.ts} +121 -547
- package/dist/index-DrISNAOm.d.ts +45 -0
- package/dist/index-QBpffFW-.d.cts +86 -0
- package/dist/{index-J7Kc0oIQ.d.cts → index-_oMEWlDq.d.cts} +3 -3
- package/dist/{index-CYkjxu3s.d.ts → index-eJ6T_qGM.d.ts} +33 -4
- package/dist/index-qldRdbQw.d.ts +86 -0
- package/dist/index-xdGjv0nO.d.ts +127 -0
- package/dist/index.cjs +2334 -195
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1007 -648
- package/dist/index.d.ts +1007 -648
- package/dist/index.js +1204 -1172
- package/dist/index.js.map +1 -1
- package/dist/{meta-CnkLA_43.d.ts → meta-BGqSZ7mt.d.ts} +1 -1
- package/dist/{meta-DWbkoq1s.d.cts → meta-C0-8XW6Q.d.cts} +1 -1
- package/dist/{node-B-f-Lu-k.d.cts → node-C_IBuvX2.d.cts} +26 -1
- package/dist/{node-B-f-Lu-k.d.ts → node-C_IBuvX2.d.ts} +26 -1
- package/dist/{observable-DBnrwcar.d.cts → observable-Crr1jgzx.d.cts} +1 -1
- package/dist/{observable-uP-wy_uK.d.ts → observable-DCk45RH5.d.ts} +1 -1
- package/dist/patterns/demo-shell.cjs +5604 -0
- package/dist/patterns/demo-shell.cjs.map +1 -0
- package/dist/patterns/demo-shell.d.cts +6 -0
- package/dist/patterns/demo-shell.d.ts +6 -0
- package/dist/patterns/demo-shell.js +15 -0
- package/dist/patterns/demo-shell.js.map +1 -0
- package/dist/patterns/reactive-layout/index.cjs +843 -29
- package/dist/patterns/reactive-layout/index.cjs.map +1 -1
- package/dist/patterns/reactive-layout/index.d.cts +6 -5
- package/dist/patterns/reactive-layout/index.d.ts +6 -5
- package/dist/patterns/reactive-layout/index.js +25 -10
- package/dist/reactive-layout-BaOQefHu.d.cts +183 -0
- package/dist/reactive-layout-D9gejYXE.d.ts +183 -0
- package/dist/{storage-BuTdpCI1.d.cts → storage-BMycWEh2.d.ts} +9 -1
- package/dist/{storage-F2X1U1x0.d.ts → storage-DiqWHzVI.d.cts} +9 -1
- package/package.json +32 -2
- package/dist/chunk-5DJTTKX3.js.map +0 -1
- package/dist/chunk-5WGT55R4.js.map +0 -1
- package/dist/chunk-AOCBDH4T.js.map +0 -1
- package/dist/chunk-MW4VAKAO.js +0 -47
- package/dist/chunk-MW4VAKAO.js.map +0 -1
- package/dist/chunk-TDEXAMGO.js.map +0 -1
- package/dist/chunk-XOFWRC73.js.map +0 -1
- /package/dist/{chunk-H4RVA4VE.js.map → chunk-VYPWMZ6H.js.map} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { N as Node } from './node-C_IBuvX2.js';
|
|
2
|
+
|
|
3
|
+
/** Svelte store contract — implements the minimal `subscribe` method. */
|
|
4
|
+
interface SvelteReadable<T> {
|
|
5
|
+
subscribe(run: (value: T) => void): () => void;
|
|
6
|
+
}
|
|
7
|
+
/** Svelte writable store contract. */
|
|
8
|
+
interface SvelteWritable<T> extends SvelteReadable<T> {
|
|
9
|
+
set(value: T): void;
|
|
10
|
+
update(updater: (value: T) => T): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Subscribe to a `Node<T>` as a Svelte readable store (implements Svelte store contract).
|
|
14
|
+
* Subscription lifecycle is tied to Svelte store unsubscription (not node terminal messages).
|
|
15
|
+
*/
|
|
16
|
+
declare function useSubscribe<T>(node: Node<T>): SvelteReadable<T | undefined | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Bind a writable `Node<T>` as a Svelte writable store.
|
|
19
|
+
* Reads and writes adapt seamlessly.
|
|
20
|
+
* Setter/update always forward `[[DIRTY], [DATA, value]]`, including `value === undefined`.
|
|
21
|
+
* Subscription lifecycle is tied to Svelte store unsubscription (not node terminal messages).
|
|
22
|
+
*/
|
|
23
|
+
declare function useStore<T>(node: Node<T>): SvelteWritable<T | undefined | null>;
|
|
24
|
+
/** Maps a key to an object of nodes. Used by `useSubscribeRecord`. */
|
|
25
|
+
type NodeFactory<K, R extends Record<string, any>> = (key: K) => {
|
|
26
|
+
[P in keyof R]: Node<R[P]>;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Subscribe to a dynamic keyed record of nodes as a Svelte readable store.
|
|
30
|
+
* Re-subscribes all per-key fields whenever `keysNode` changes.
|
|
31
|
+
* Key re-sync is gated to settled batches (`messageTier >= 3`) to avoid DIRTY-phase churn.
|
|
32
|
+
*/
|
|
33
|
+
declare function useSubscribeRecord<K extends string, R extends Record<string, any>>(keysNode: Node<K[]>, factory: NodeFactory<K, R>): SvelteReadable<Record<K, R>>;
|
|
34
|
+
|
|
35
|
+
type index_NodeFactory<K, R extends Record<string, any>> = NodeFactory<K, R>;
|
|
36
|
+
type index_SvelteReadable<T> = SvelteReadable<T>;
|
|
37
|
+
type index_SvelteWritable<T> = SvelteWritable<T>;
|
|
38
|
+
declare const index_useStore: typeof useStore;
|
|
39
|
+
declare const index_useSubscribe: typeof useSubscribe;
|
|
40
|
+
declare const index_useSubscribeRecord: typeof useSubscribeRecord;
|
|
41
|
+
declare namespace index {
|
|
42
|
+
export { type index_NodeFactory as NodeFactory, type index_SvelteReadable as SvelteReadable, type index_SvelteWritable as SvelteWritable, index_useStore as useStore, index_useSubscribe as useSubscribe, index_useSubscribeRecord as useSubscribeRecord };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { type NodeFactory as N, type SvelteReadable as S, type SvelteWritable as a, useSubscribe as b, useSubscribeRecord as c, index as i, useStore as u };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { N as Node } from './node-C_IBuvX2.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Options for creating an atom.
|
|
5
|
+
*
|
|
6
|
+
* @category compat
|
|
7
|
+
*/
|
|
8
|
+
interface AtomOptions {
|
|
9
|
+
/** Optional identifier for the underlying node. */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** Optional companion meta nodes. */
|
|
12
|
+
meta?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A read-only Jotai-compatible atom.
|
|
16
|
+
*
|
|
17
|
+
* @category compat
|
|
18
|
+
*/
|
|
19
|
+
interface ReadableAtom<T> {
|
|
20
|
+
/** Returns the current cached value. */
|
|
21
|
+
get(): T;
|
|
22
|
+
/** Subscribes to value changes. Returns an unsubscribe function. */
|
|
23
|
+
subscribe(callback: (value: T) => void): () => void;
|
|
24
|
+
/** Access to companion meta nodes. */
|
|
25
|
+
readonly meta: Record<string, Node>;
|
|
26
|
+
/** @internal The underlying GraphReFly node. */
|
|
27
|
+
_node: Node<T>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A writable Jotai-compatible atom.
|
|
31
|
+
*
|
|
32
|
+
* @category compat
|
|
33
|
+
*/
|
|
34
|
+
interface WritableAtom<T> extends ReadableAtom<T> {
|
|
35
|
+
/** Sets a new value. */
|
|
36
|
+
set(value: T): void;
|
|
37
|
+
/** Updates the value using a transformation function. */
|
|
38
|
+
update(fn: (current: T) => T): void;
|
|
39
|
+
}
|
|
40
|
+
/** Function type for reading other atoms inside a derived atom. */
|
|
41
|
+
type GetFn = <V>(a: ReadableAtom<V>) => V;
|
|
42
|
+
/** Function type for writing to other atoms inside a writable derived atom. */
|
|
43
|
+
type SetFn = <V>(a: WritableAtom<V>, value: V) => void;
|
|
44
|
+
/** Function that computes the atom's value. */
|
|
45
|
+
type ReadFn<T> = (get: GetFn) => T;
|
|
46
|
+
/** Function that handles writes to the atom. */
|
|
47
|
+
type WriteFn<T> = (get: GetFn, set: SetFn, value: T) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Creates a Jotai-compatible atom built on GraphReFly primitives.
|
|
50
|
+
*
|
|
51
|
+
* Supports three overloads:
|
|
52
|
+
* 1. `atom(initial)` — Writable primitive atom (wraps `state()`).
|
|
53
|
+
* 2. `atom(read)` — Read-only derived atom (wraps `dynamicNode()`).
|
|
54
|
+
* 3. `atom(read, write)` — Writable derived atom.
|
|
55
|
+
*
|
|
56
|
+
* @param initialOrRead - Initial value or a read function.
|
|
57
|
+
* @param writeOrOptions - Write function or options object.
|
|
58
|
+
* @param options - Optional configuration.
|
|
59
|
+
* @returns WritableAtom or ReadableAtom.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const count = atom(0);
|
|
64
|
+
* count.set(1);
|
|
65
|
+
* const doubled = atom((get) => get(count)! * 2);
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @category compat
|
|
69
|
+
*/
|
|
70
|
+
declare function atom<T>(initial: T, options?: AtomOptions): WritableAtom<T>;
|
|
71
|
+
declare function atom<T>(read: ReadFn<T>, options?: AtomOptions): ReadableAtom<T>;
|
|
72
|
+
declare function atom<T>(read: ReadFn<T>, write: WriteFn<T>, options?: AtomOptions): WritableAtom<T>;
|
|
73
|
+
|
|
74
|
+
type index_AtomOptions = AtomOptions;
|
|
75
|
+
type index_GetFn = GetFn;
|
|
76
|
+
type index_ReadFn<T> = ReadFn<T>;
|
|
77
|
+
type index_ReadableAtom<T> = ReadableAtom<T>;
|
|
78
|
+
type index_SetFn = SetFn;
|
|
79
|
+
type index_WritableAtom<T> = WritableAtom<T>;
|
|
80
|
+
type index_WriteFn<T> = WriteFn<T>;
|
|
81
|
+
declare const index_atom: typeof atom;
|
|
82
|
+
declare namespace index {
|
|
83
|
+
export { type index_AtomOptions as AtomOptions, type index_GetFn as GetFn, type index_ReadFn as ReadFn, type index_ReadableAtom as ReadableAtom, type index_SetFn as SetFn, type index_WritableAtom as WritableAtom, type index_WriteFn as WriteFn, index_atom as atom };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { type AtomOptions as A, type GetFn as G, type ReadFn as R, type SetFn as S, type WritableAtom as W, type ReadableAtom as a, type WriteFn as b, atom as c, index as i };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as ToObservableOptions, t as toObservable } from './observable-
|
|
1
|
+
import { T as ToObservableOptions, t as toObservable } from './observable-Crr1jgzx.cjs';
|
|
2
2
|
import { OnModuleInit, OnModuleDestroy, ExecutionContext, CanActivate, DynamicModule } from '@nestjs/common';
|
|
3
3
|
import { ModuleRef } from '@nestjs/core';
|
|
4
|
-
import { G as Graph, a as GraphOptions,
|
|
5
|
-
import { A as Actor, N as Node } from './node-
|
|
4
|
+
import { G as Graph, a as GraphOptions, c as GraphPersistSnapshot } from './graph-6tZ5jEzr.cjs';
|
|
5
|
+
import { A as Actor, N as Node } from './node-C_IBuvX2.cjs';
|
|
6
6
|
|
|
7
7
|
/** Class constructor key for decorator registries and Nest `ModuleRef.get()`. */
|
|
8
8
|
type DecoratorHostConstructor = abstract new (...args: unknown[]) => unknown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { l as GraphReFlyConfig } from './node-C_IBuvX2.js';
|
|
2
|
+
import { c as GraphPersistSnapshot, m as GraphCheckpointRecord, G as Graph, T as TopologyEvent, C as CausalChain, j as CausalStep, D as DescribeFilter, E as ExplainPathOptions, k as GRAPH_META_SEGMENT, l as GraphActorOptions, b as GraphAttachStorageOptions, d as GraphDescribeOptions, e as GraphDescribeOutput, n as GraphDiagramDirection, o as GraphDiagramOptions, p as GraphDiffChange, i as GraphDiffResult, q as GraphFactoryContext, h as GraphNodeFactory, r as GraphObserveAll, s as GraphObserveOne, a as GraphOptions, g as GraphProfileOptions, f as GraphProfileResult, t as GraphVersionChange, u as GraphWALDiff, N as NodeProfile, O as ObserveDetail, v as ObserveEvent, w as ObserveOptions, x as ObserveResult, y as ObserveTheme, z as ObserveThemeName, R as ReachableDirection, A as ReachableOptions, S as SNAPSHOT_VERSION, B as TraceEntry, F as diffForWAL, H as explainPath, I as graphProfile, J as reachable } from './graph-DQ69XU0g.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Approximate in-memory size estimation for arbitrary JS values.
|
|
@@ -254,14 +254,39 @@ declare function registerBuiltinCodecs(config: GraphReFlyConfig): void;
|
|
|
254
254
|
*/
|
|
255
255
|
declare function replayWAL(entries: readonly WALEntry[]): GraphPersistSnapshot;
|
|
256
256
|
|
|
257
|
+
/**
|
|
258
|
+
* Subscribe to structural changes across `graph` and every transitively
|
|
259
|
+
* mounted subgraph. `cb` fires on every {@link TopologyEvent} from any
|
|
260
|
+
* graph in the tree. Newly-mounted subgraphs are auto-wired when their
|
|
261
|
+
* parent emits `{kind: "added", nodeKind: "mount"}`; newly-unmounted
|
|
262
|
+
* subgraphs' subscriptions are disposed via the parent's
|
|
263
|
+
* `{kind: "removed", nodeKind: "mount"}` event plus the returned
|
|
264
|
+
* `GraphRemoveAudit`.
|
|
265
|
+
*
|
|
266
|
+
* The callback receives a third argument `prefix`: the `::`-delimited
|
|
267
|
+
* path from the root watched graph to the emitter, ending with `"::"`
|
|
268
|
+
* (empty string when the event comes from the root itself). Compute
|
|
269
|
+
* a qualified path for an added/removed entry as `prefix + event.name`.
|
|
270
|
+
*
|
|
271
|
+
* @param graph - Root graph to watch.
|
|
272
|
+
* @param cb - Receives `(event, emitterGraph, prefix)`.
|
|
273
|
+
* @returns Dispose function — tears down every active subscription.
|
|
274
|
+
*
|
|
275
|
+
* @category observability
|
|
276
|
+
*/
|
|
277
|
+
declare function watchTopologyTree(graph: Graph, cb: (event: TopologyEvent, emitter: Graph, prefix: string) => void): () => void;
|
|
278
|
+
|
|
257
279
|
/**
|
|
258
280
|
* Graph container: registry, wiring, introspection (Phase 1).
|
|
259
281
|
*/
|
|
260
282
|
|
|
283
|
+
declare const index_CausalChain: typeof CausalChain;
|
|
284
|
+
declare const index_CausalStep: typeof CausalStep;
|
|
261
285
|
declare const index_DescribeFilter: typeof DescribeFilter;
|
|
262
286
|
declare const index_ENVELOPE_VERSION: typeof ENVELOPE_VERSION;
|
|
263
287
|
type index_EvictedSubgraphInfo = EvictedSubgraphInfo;
|
|
264
288
|
type index_EvictionPolicy = EvictionPolicy;
|
|
289
|
+
declare const index_ExplainPathOptions: typeof ExplainPathOptions;
|
|
265
290
|
declare const index_GRAPH_META_SEGMENT: typeof GRAPH_META_SEGMENT;
|
|
266
291
|
declare const index_Graph: typeof Graph;
|
|
267
292
|
declare const index_GraphActorOptions: typeof GraphActorOptions;
|
|
@@ -296,6 +321,8 @@ declare const index_ObserveThemeName: typeof ObserveThemeName;
|
|
|
296
321
|
declare const index_ReachableDirection: typeof ReachableDirection;
|
|
297
322
|
declare const index_ReachableOptions: typeof ReachableOptions;
|
|
298
323
|
declare const index_SIZEOF_SYMBOL: typeof SIZEOF_SYMBOL;
|
|
324
|
+
declare const index_SNAPSHOT_VERSION: typeof SNAPSHOT_VERSION;
|
|
325
|
+
declare const index_TopologyEvent: typeof TopologyEvent;
|
|
299
326
|
declare const index_TraceEntry: typeof TraceEntry;
|
|
300
327
|
type index_WALEntry = WALEntry;
|
|
301
328
|
declare const index_createDagCborCodec: typeof createDagCborCodec;
|
|
@@ -303,13 +330,15 @@ declare const index_createDagCborZstdCodec: typeof createDagCborZstdCodec;
|
|
|
303
330
|
declare const index_decodeEnvelope: typeof decodeEnvelope;
|
|
304
331
|
declare const index_diffForWAL: typeof diffForWAL;
|
|
305
332
|
declare const index_encodeEnvelope: typeof encodeEnvelope;
|
|
333
|
+
declare const index_explainPath: typeof explainPath;
|
|
306
334
|
declare const index_graphProfile: typeof graphProfile;
|
|
307
335
|
declare const index_reachable: typeof reachable;
|
|
308
336
|
declare const index_registerBuiltinCodecs: typeof registerBuiltinCodecs;
|
|
309
337
|
declare const index_replayWAL: typeof replayWAL;
|
|
310
338
|
declare const index_sizeof: typeof sizeof;
|
|
339
|
+
declare const index_watchTopologyTree: typeof watchTopologyTree;
|
|
311
340
|
declare namespace index {
|
|
312
|
-
export { index_DescribeFilter as DescribeFilter, index_ENVELOPE_VERSION as ENVELOPE_VERSION, type index_EvictedSubgraphInfo as EvictedSubgraphInfo, type index_EvictionPolicy as EvictionPolicy, index_GRAPH_META_SEGMENT as GRAPH_META_SEGMENT, index_Graph as Graph, index_GraphActorOptions as GraphActorOptions, index_GraphAttachStorageOptions as GraphAttachStorageOptions, index_GraphCheckpointRecord as GraphCheckpointRecord, type index_GraphCodec as GraphCodec, index_GraphDescribeOptions as GraphDescribeOptions, index_GraphDescribeOutput as GraphDescribeOutput, index_GraphDiagramDirection as GraphDiagramDirection, index_GraphDiagramOptions as GraphDiagramOptions, index_GraphDiffChange as GraphDiffChange, index_GraphDiffResult as GraphDiffResult, index_GraphFactoryContext as GraphFactoryContext, index_GraphNodeFactory as GraphNodeFactory, index_GraphObserveAll as GraphObserveAll, index_GraphObserveOne as GraphObserveOne, index_GraphOptions as GraphOptions, index_GraphPersistSnapshot as GraphPersistSnapshot, index_GraphProfileOptions as GraphProfileOptions, index_GraphProfileResult as GraphProfileResult, index_GraphVersionChange as GraphVersionChange, index_GraphWALDiff as GraphWALDiff, index_JsonCodec as JsonCodec, type index_LazyGraphCodec as LazyGraphCodec, index_NodeProfile as NodeProfile, index_ObserveDetail as ObserveDetail, index_ObserveEvent as ObserveEvent, index_ObserveOptions as ObserveOptions, index_ObserveResult as ObserveResult, index_ObserveTheme as ObserveTheme, index_ObserveThemeName as ObserveThemeName, index_ReachableDirection as ReachableDirection, index_ReachableOptions as ReachableOptions, OVERHEAD as SIZEOF_OVERHEAD, index_SIZEOF_SYMBOL as SIZEOF_SYMBOL, index_TraceEntry as TraceEntry, type index_WALEntry as WALEntry, index_createDagCborCodec as createDagCborCodec, index_createDagCborZstdCodec as createDagCborZstdCodec, index_decodeEnvelope as decodeEnvelope, index_diffForWAL as diffForWAL, index_encodeEnvelope as encodeEnvelope, index_graphProfile as graphProfile, index_reachable as reachable, index_registerBuiltinCodecs as registerBuiltinCodecs, index_replayWAL as replayWAL, index_sizeof as sizeof };
|
|
341
|
+
export { index_CausalChain as CausalChain, index_CausalStep as CausalStep, index_DescribeFilter as DescribeFilter, index_ENVELOPE_VERSION as ENVELOPE_VERSION, type index_EvictedSubgraphInfo as EvictedSubgraphInfo, type index_EvictionPolicy as EvictionPolicy, index_ExplainPathOptions as ExplainPathOptions, index_GRAPH_META_SEGMENT as GRAPH_META_SEGMENT, index_Graph as Graph, index_GraphActorOptions as GraphActorOptions, index_GraphAttachStorageOptions as GraphAttachStorageOptions, index_GraphCheckpointRecord as GraphCheckpointRecord, type index_GraphCodec as GraphCodec, index_GraphDescribeOptions as GraphDescribeOptions, index_GraphDescribeOutput as GraphDescribeOutput, index_GraphDiagramDirection as GraphDiagramDirection, index_GraphDiagramOptions as GraphDiagramOptions, index_GraphDiffChange as GraphDiffChange, index_GraphDiffResult as GraphDiffResult, index_GraphFactoryContext as GraphFactoryContext, index_GraphNodeFactory as GraphNodeFactory, index_GraphObserveAll as GraphObserveAll, index_GraphObserveOne as GraphObserveOne, index_GraphOptions as GraphOptions, index_GraphPersistSnapshot as GraphPersistSnapshot, index_GraphProfileOptions as GraphProfileOptions, index_GraphProfileResult as GraphProfileResult, index_GraphVersionChange as GraphVersionChange, index_GraphWALDiff as GraphWALDiff, index_JsonCodec as JsonCodec, type index_LazyGraphCodec as LazyGraphCodec, index_NodeProfile as NodeProfile, index_ObserveDetail as ObserveDetail, index_ObserveEvent as ObserveEvent, index_ObserveOptions as ObserveOptions, index_ObserveResult as ObserveResult, index_ObserveTheme as ObserveTheme, index_ObserveThemeName as ObserveThemeName, index_ReachableDirection as ReachableDirection, index_ReachableOptions as ReachableOptions, OVERHEAD as SIZEOF_OVERHEAD, index_SIZEOF_SYMBOL as SIZEOF_SYMBOL, index_SNAPSHOT_VERSION as SNAPSHOT_VERSION, index_TopologyEvent as TopologyEvent, index_TraceEntry as TraceEntry, type index_WALEntry as WALEntry, index_createDagCborCodec as createDagCborCodec, index_createDagCborZstdCodec as createDagCborZstdCodec, index_decodeEnvelope as decodeEnvelope, index_diffForWAL as diffForWAL, index_encodeEnvelope as encodeEnvelope, index_explainPath as explainPath, index_graphProfile as graphProfile, index_reachable as reachable, index_registerBuiltinCodecs as registerBuiltinCodecs, index_replayWAL as replayWAL, index_sizeof as sizeof, index_watchTopologyTree as watchTopologyTree };
|
|
313
342
|
}
|
|
314
343
|
|
|
315
|
-
export { ENVELOPE_VERSION as E, type GraphCodec as G, JsonCodec as J, type LazyGraphCodec as L, OVERHEAD as O, SIZEOF_SYMBOL as S, type WALEntry as W, type EvictedSubgraphInfo as a, type EvictionPolicy as b, createDagCborCodec as c, createDagCborZstdCodec as d, decodeEnvelope as e, encodeEnvelope as f, replayWAL as g, index as i, registerBuiltinCodecs as r, sizeof as s };
|
|
344
|
+
export { ENVELOPE_VERSION as E, type GraphCodec as G, JsonCodec as J, type LazyGraphCodec as L, OVERHEAD as O, SIZEOF_SYMBOL as S, type WALEntry as W, type EvictedSubgraphInfo as a, type EvictionPolicy as b, createDagCborCodec as c, createDagCborZstdCodec as d, decodeEnvelope as e, encodeEnvelope as f, replayWAL as g, index as i, registerBuiltinCodecs as r, sizeof as s, watchTopologyTree as w };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { N as Node } from './node-C_IBuvX2.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Options for creating an atom.
|
|
5
|
+
*
|
|
6
|
+
* @category compat
|
|
7
|
+
*/
|
|
8
|
+
interface AtomOptions {
|
|
9
|
+
/** Optional identifier for the underlying node. */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** Optional companion meta nodes. */
|
|
12
|
+
meta?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A read-only Jotai-compatible atom.
|
|
16
|
+
*
|
|
17
|
+
* @category compat
|
|
18
|
+
*/
|
|
19
|
+
interface ReadableAtom<T> {
|
|
20
|
+
/** Returns the current cached value. */
|
|
21
|
+
get(): T;
|
|
22
|
+
/** Subscribes to value changes. Returns an unsubscribe function. */
|
|
23
|
+
subscribe(callback: (value: T) => void): () => void;
|
|
24
|
+
/** Access to companion meta nodes. */
|
|
25
|
+
readonly meta: Record<string, Node>;
|
|
26
|
+
/** @internal The underlying GraphReFly node. */
|
|
27
|
+
_node: Node<T>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A writable Jotai-compatible atom.
|
|
31
|
+
*
|
|
32
|
+
* @category compat
|
|
33
|
+
*/
|
|
34
|
+
interface WritableAtom<T> extends ReadableAtom<T> {
|
|
35
|
+
/** Sets a new value. */
|
|
36
|
+
set(value: T): void;
|
|
37
|
+
/** Updates the value using a transformation function. */
|
|
38
|
+
update(fn: (current: T) => T): void;
|
|
39
|
+
}
|
|
40
|
+
/** Function type for reading other atoms inside a derived atom. */
|
|
41
|
+
type GetFn = <V>(a: ReadableAtom<V>) => V;
|
|
42
|
+
/** Function type for writing to other atoms inside a writable derived atom. */
|
|
43
|
+
type SetFn = <V>(a: WritableAtom<V>, value: V) => void;
|
|
44
|
+
/** Function that computes the atom's value. */
|
|
45
|
+
type ReadFn<T> = (get: GetFn) => T;
|
|
46
|
+
/** Function that handles writes to the atom. */
|
|
47
|
+
type WriteFn<T> = (get: GetFn, set: SetFn, value: T) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Creates a Jotai-compatible atom built on GraphReFly primitives.
|
|
50
|
+
*
|
|
51
|
+
* Supports three overloads:
|
|
52
|
+
* 1. `atom(initial)` — Writable primitive atom (wraps `state()`).
|
|
53
|
+
* 2. `atom(read)` — Read-only derived atom (wraps `dynamicNode()`).
|
|
54
|
+
* 3. `atom(read, write)` — Writable derived atom.
|
|
55
|
+
*
|
|
56
|
+
* @param initialOrRead - Initial value or a read function.
|
|
57
|
+
* @param writeOrOptions - Write function or options object.
|
|
58
|
+
* @param options - Optional configuration.
|
|
59
|
+
* @returns WritableAtom or ReadableAtom.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const count = atom(0);
|
|
64
|
+
* count.set(1);
|
|
65
|
+
* const doubled = atom((get) => get(count)! * 2);
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @category compat
|
|
69
|
+
*/
|
|
70
|
+
declare function atom<T>(initial: T, options?: AtomOptions): WritableAtom<T>;
|
|
71
|
+
declare function atom<T>(read: ReadFn<T>, options?: AtomOptions): ReadableAtom<T>;
|
|
72
|
+
declare function atom<T>(read: ReadFn<T>, write: WriteFn<T>, options?: AtomOptions): WritableAtom<T>;
|
|
73
|
+
|
|
74
|
+
type index_AtomOptions = AtomOptions;
|
|
75
|
+
type index_GetFn = GetFn;
|
|
76
|
+
type index_ReadFn<T> = ReadFn<T>;
|
|
77
|
+
type index_ReadableAtom<T> = ReadableAtom<T>;
|
|
78
|
+
type index_SetFn = SetFn;
|
|
79
|
+
type index_WritableAtom<T> = WritableAtom<T>;
|
|
80
|
+
type index_WriteFn<T> = WriteFn<T>;
|
|
81
|
+
declare const index_atom: typeof atom;
|
|
82
|
+
declare namespace index {
|
|
83
|
+
export { type index_AtomOptions as AtomOptions, type index_GetFn as GetFn, type index_ReadFn as ReadFn, type index_ReadableAtom as ReadableAtom, type index_SetFn as SetFn, type index_WritableAtom as WritableAtom, type index_WriteFn as WriteFn, index_atom as atom };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { type AtomOptions as A, type GetFn as G, type ReadFn as R, type SetFn as S, type WritableAtom as W, type ReadableAtom as a, type WriteFn as b, atom as c, index as i };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { N as Node } from './node-C_IBuvX2.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A Nanostores-compatible atom.
|
|
5
|
+
*
|
|
6
|
+
* @category compat
|
|
7
|
+
*/
|
|
8
|
+
interface NanoAtom<T> {
|
|
9
|
+
/** Get current value. */
|
|
10
|
+
get(): T;
|
|
11
|
+
/** Set a new value (writable atoms only). */
|
|
12
|
+
set(value: T): void;
|
|
13
|
+
/** Subscribe to value changes. Callback receives the new value.
|
|
14
|
+
* Returns unsubscribe function. Called immediately with current value. */
|
|
15
|
+
subscribe(cb: (value: T) => void): () => void;
|
|
16
|
+
/** Listen to value changes (no immediate call). Returns unsubscribe. */
|
|
17
|
+
listen(cb: (value: T) => void): () => void;
|
|
18
|
+
/** The underlying GraphReFly node. */
|
|
19
|
+
readonly _node: Node<T>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A Nanostores-compatible computed store.
|
|
23
|
+
*
|
|
24
|
+
* @category compat
|
|
25
|
+
*/
|
|
26
|
+
interface NanoComputed<T> {
|
|
27
|
+
/** Get current value. */
|
|
28
|
+
get(): T;
|
|
29
|
+
/** Subscribe to value changes. Called immediately with current value.
|
|
30
|
+
* Returns unsubscribe function. */
|
|
31
|
+
subscribe(cb: (value: T) => void): () => void;
|
|
32
|
+
/** Listen to value changes (no immediate call). Returns unsubscribe. */
|
|
33
|
+
listen(cb: (value: T) => void): () => void;
|
|
34
|
+
/** The underlying GraphReFly node. */
|
|
35
|
+
readonly _node: Node<T>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A Nanostores-compatible map.
|
|
39
|
+
*
|
|
40
|
+
* @category compat
|
|
41
|
+
*/
|
|
42
|
+
interface NanoMap<T extends Record<string, unknown>> extends NanoAtom<T> {
|
|
43
|
+
/** Set a single key. */
|
|
44
|
+
setKey<K extends keyof T>(key: K, value: T[K]): void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Creates a nanostores-compatible atom.
|
|
48
|
+
*
|
|
49
|
+
* @param initial - Initial value.
|
|
50
|
+
* @returns `NanoAtom<T>`
|
|
51
|
+
*
|
|
52
|
+
* @category compat
|
|
53
|
+
*/
|
|
54
|
+
declare function atom<T>(initial: T): NanoAtom<T>;
|
|
55
|
+
/**
|
|
56
|
+
* Creates a nanostores-compatible computed store.
|
|
57
|
+
*
|
|
58
|
+
* @param stores - One or more atoms/computed stores.
|
|
59
|
+
* @param fn - Compute function.
|
|
60
|
+
* @returns `NanoComputed<T>`
|
|
61
|
+
*
|
|
62
|
+
* @category compat
|
|
63
|
+
*/
|
|
64
|
+
declare function computed<T, A>(storeA: NanoAtom<A> | NanoComputed<A>, fn: (a: A) => T): NanoComputed<T>;
|
|
65
|
+
declare function computed<T, A, B>(stores: [NanoAtom<A> | NanoComputed<A>, NanoAtom<B> | NanoComputed<B>], fn: (a: A, b: B) => T): NanoComputed<T>;
|
|
66
|
+
declare function computed<T, A, B, C>(stores: [
|
|
67
|
+
NanoAtom<A> | NanoComputed<A>,
|
|
68
|
+
NanoAtom<B> | NanoComputed<B>,
|
|
69
|
+
NanoAtom<C> | NanoComputed<C>
|
|
70
|
+
], fn: (a: A, b: B, c: C) => T): NanoComputed<T>;
|
|
71
|
+
/**
|
|
72
|
+
* Creates a nanostores-compatible map.
|
|
73
|
+
*
|
|
74
|
+
* @param initial - Initial object value.
|
|
75
|
+
* @returns `NanoMap<T>`
|
|
76
|
+
*
|
|
77
|
+
* @category compat
|
|
78
|
+
*/
|
|
79
|
+
declare function map<T extends Record<string, unknown>>(initial: T): NanoMap<T>;
|
|
80
|
+
/**
|
|
81
|
+
* Returns the current value of the store.
|
|
82
|
+
*
|
|
83
|
+
* @category compat
|
|
84
|
+
*/
|
|
85
|
+
declare function getValue<T>(store: NanoAtom<T> | NanoComputed<T>): T;
|
|
86
|
+
/**
|
|
87
|
+
* Adds a listener for the store start (first listener connected).
|
|
88
|
+
*
|
|
89
|
+
* @category compat
|
|
90
|
+
*/
|
|
91
|
+
declare function onStart(store: NanoAtom<any> | NanoComputed<any>, cb: () => void): void;
|
|
92
|
+
/**
|
|
93
|
+
* Adds a listener for the store stop (last listener disconnected).
|
|
94
|
+
*
|
|
95
|
+
* @category compat
|
|
96
|
+
*/
|
|
97
|
+
declare function onStop(store: NanoAtom<any> | NanoComputed<any>, cb: () => void): void;
|
|
98
|
+
/**
|
|
99
|
+
* Adds a listener for the store mount (first listener connected).
|
|
100
|
+
*
|
|
101
|
+
* @returns A cleanup function called when the last listener is removed.
|
|
102
|
+
* @category compat
|
|
103
|
+
*/
|
|
104
|
+
declare function onMount(store: NanoAtom<any> | NanoComputed<any>, cb: () => (() => void) | undefined): void;
|
|
105
|
+
/**
|
|
106
|
+
* Batches multiple store updates.
|
|
107
|
+
*
|
|
108
|
+
* @category compat
|
|
109
|
+
*/
|
|
110
|
+
declare function action<Args extends any[], Return>(_store: NanoAtom<any> | NanoComputed<any>, _name: string, fn: (...args: Args) => Return): (...args: Args) => Return;
|
|
111
|
+
|
|
112
|
+
type index_NanoAtom<T> = NanoAtom<T>;
|
|
113
|
+
type index_NanoComputed<T> = NanoComputed<T>;
|
|
114
|
+
type index_NanoMap<T extends Record<string, unknown>> = NanoMap<T>;
|
|
115
|
+
declare const index_action: typeof action;
|
|
116
|
+
declare const index_atom: typeof atom;
|
|
117
|
+
declare const index_computed: typeof computed;
|
|
118
|
+
declare const index_getValue: typeof getValue;
|
|
119
|
+
declare const index_map: typeof map;
|
|
120
|
+
declare const index_onMount: typeof onMount;
|
|
121
|
+
declare const index_onStart: typeof onStart;
|
|
122
|
+
declare const index_onStop: typeof onStop;
|
|
123
|
+
declare namespace index {
|
|
124
|
+
export { type index_NanoAtom as NanoAtom, type index_NanoComputed as NanoComputed, type index_NanoMap as NanoMap, index_action as action, index_atom as atom, index_computed as computed, index_getValue as getValue, index_map as map, index_onMount as onMount, index_onStart as onStart, index_onStop as onStop };
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export { type NanoAtom as N, type NanoComputed as a, type NanoMap as b, action as c, atom as d, computed as e, onStart as f, getValue as g, onStop as h, index as i, map as m, onMount as o };
|