@graphrefly/ts 0.0.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/LICENSE +21 -0
- package/dist/adapters/index.cjs +9015 -0
- package/dist/adapters/index.cjs.map +1 -0
- package/dist/adapters/index.d.cts +678 -0
- package/dist/adapters/index.d.ts +678 -0
- package/dist/adapters/index.js +2894 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/observe-storage.cjs +260 -0
- package/dist/adapters/observe-storage.cjs.map +1 -0
- package/dist/adapters/observe-storage.d.cts +77 -0
- package/dist/adapters/observe-storage.d.ts +77 -0
- package/dist/adapters/observe-storage.js +161 -0
- package/dist/adapters/observe-storage.js.map +1 -0
- package/dist/append-log-DisvEReb.d.cts +189 -0
- package/dist/append-log-DzKMmjxx.d.ts +189 -0
- package/dist/chunk-2ILL7HQI.js +1189 -0
- package/dist/chunk-2ILL7HQI.js.map +1 -0
- package/dist/chunk-4VLAQHZI.js +330 -0
- package/dist/chunk-4VLAQHZI.js.map +1 -0
- package/dist/chunk-6PHB5CJS.js +229 -0
- package/dist/chunk-6PHB5CJS.js.map +1 -0
- package/dist/chunk-COHO25CZ.js +2449 -0
- package/dist/chunk-COHO25CZ.js.map +1 -0
- package/dist/chunk-D6BG7U6A.js +161 -0
- package/dist/chunk-D6BG7U6A.js.map +1 -0
- package/dist/chunk-DJC4CHLQ.js +818 -0
- package/dist/chunk-DJC4CHLQ.js.map +1 -0
- package/dist/chunk-DK554R7P.js +67 -0
- package/dist/chunk-DK554R7P.js.map +1 -0
- package/dist/chunk-DKP56CSW.js +322 -0
- package/dist/chunk-DKP56CSW.js.map +1 -0
- package/dist/chunk-G4M3NHRJ.js +688 -0
- package/dist/chunk-G4M3NHRJ.js.map +1 -0
- package/dist/chunk-GAJW5I5P.js +1 -0
- package/dist/chunk-GAJW5I5P.js.map +1 -0
- package/dist/chunk-GDL26N2T.js +282 -0
- package/dist/chunk-GDL26N2T.js.map +1 -0
- package/dist/chunk-GTPCOEOZ.js +741 -0
- package/dist/chunk-GTPCOEOZ.js.map +1 -0
- package/dist/chunk-H2HTHFVN.js +1 -0
- package/dist/chunk-H2HTHFVN.js.map +1 -0
- package/dist/chunk-HDRL4VQQ.js +218 -0
- package/dist/chunk-HDRL4VQQ.js.map +1 -0
- package/dist/chunk-I3IHOHCJ.js +2267 -0
- package/dist/chunk-I3IHOHCJ.js.map +1 -0
- package/dist/chunk-JIMUDQN3.js +965 -0
- package/dist/chunk-JIMUDQN3.js.map +1 -0
- package/dist/chunk-JR4IKCR2.js +462 -0
- package/dist/chunk-JR4IKCR2.js.map +1 -0
- package/dist/chunk-K3FXTC3I.js +165 -0
- package/dist/chunk-K3FXTC3I.js.map +1 -0
- package/dist/chunk-OOEN33FB.js +65 -0
- package/dist/chunk-OOEN33FB.js.map +1 -0
- package/dist/chunk-PKVBHGBM.js +554 -0
- package/dist/chunk-PKVBHGBM.js.map +1 -0
- package/dist/chunk-RIIOUTGM.js +1857 -0
- package/dist/chunk-RIIOUTGM.js.map +1 -0
- package/dist/chunk-SCRFRCGR.js +33 -0
- package/dist/chunk-SCRFRCGR.js.map +1 -0
- package/dist/chunk-SWTLEQL6.js +53 -0
- package/dist/chunk-SWTLEQL6.js.map +1 -0
- package/dist/chunk-SZAETNNA.js +1 -0
- package/dist/chunk-SZAETNNA.js.map +1 -0
- package/dist/chunk-TEW47IVR.js +49 -0
- package/dist/chunk-TEW47IVR.js.map +1 -0
- package/dist/chunk-Y3ZLRGHC.js +1482 -0
- package/dist/chunk-Y3ZLRGHC.js.map +1 -0
- package/dist/chunk-Z2ANQ6JW.js +149 -0
- package/dist/chunk-Z2ANQ6JW.js.map +1 -0
- package/dist/codec-BB7p8fJc.d.cts +38 -0
- package/dist/codec-BB7p8fJc.d.ts +38 -0
- package/dist/composition/index.cjs +2505 -0
- package/dist/composition/index.cjs.map +1 -0
- package/dist/composition/index.d.cts +95 -0
- package/dist/composition/index.d.ts +95 -0
- package/dist/composition/index.js +19 -0
- package/dist/composition/index.js.map +1 -0
- package/dist/core/index.cjs +2475 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +25 -0
- package/dist/core/index.d.ts +25 -0
- package/dist/core/index.js +74 -0
- package/dist/core/index.js.map +1 -0
- package/dist/cqrs/index.cjs +595 -0
- package/dist/cqrs/index.cjs.map +1 -0
- package/dist/cqrs/index.d.cts +200 -0
- package/dist/cqrs/index.d.ts +200 -0
- package/dist/cqrs/index.js +557 -0
- package/dist/cqrs/index.js.map +1 -0
- package/dist/data-structures/index.cjs +4277 -0
- package/dist/data-structures/index.cjs.map +1 -0
- package/dist/data-structures/index.d.cts +22 -0
- package/dist/data-structures/index.d.ts +22 -0
- package/dist/data-structures/index.js +31 -0
- package/dist/data-structures/index.js.map +1 -0
- package/dist/describe-BZb7AS2y.d.ts +57 -0
- package/dist/describe-Ciu8SUnN.d.cts +57 -0
- package/dist/graph/index.cjs +7832 -0
- package/dist/graph/index.cjs.map +1 -0
- package/dist/graph/index.d.cts +251 -0
- package/dist/graph/index.d.ts +251 -0
- package/dist/graph/index.js +131 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph-DfdF9zy4.d.ts +666 -0
- package/dist/graph-s23RbbFO.d.cts +666 -0
- package/dist/index-CAEmLCYF.d.cts +166 -0
- package/dist/index-SnzZu3x7.d.ts +166 -0
- package/dist/index.cjs +15409 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +23 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +582 -0
- package/dist/index.js.map +1 -0
- package/dist/messages-BZqrGGm1.d.cts +55 -0
- package/dist/messages-BZqrGGm1.d.ts +55 -0
- package/dist/messaging/index.cjs +818 -0
- package/dist/messaging/index.cjs.map +1 -0
- package/dist/messaging/index.d.cts +235 -0
- package/dist/messaging/index.d.ts +235 -0
- package/dist/messaging/index.js +767 -0
- package/dist/messaging/index.js.map +1 -0
- package/dist/observe-event-log-0SVsx7JG.d.cts +88 -0
- package/dist/observe-event-log-Dnm76owp.d.ts +88 -0
- package/dist/operators/index.cjs +3774 -0
- package/dist/operators/index.cjs.map +1 -0
- package/dist/operators/index.d.cts +308 -0
- package/dist/operators/index.d.ts +308 -0
- package/dist/operators/index.js +112 -0
- package/dist/operators/index.js.map +1 -0
- package/dist/orchestration/index.cjs +3541 -0
- package/dist/orchestration/index.cjs.map +1 -0
- package/dist/orchestration/index.d.cts +302 -0
- package/dist/orchestration/index.d.ts +302 -0
- package/dist/orchestration/index.js +1004 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/patterns/index.cjs +1045 -0
- package/dist/patterns/index.cjs.map +1 -0
- package/dist/patterns/index.d.cts +39 -0
- package/dist/patterns/index.d.ts +39 -0
- package/dist/patterns/index.js +33 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/reactive-collection-BxBqtIOE.d.cts +344 -0
- package/dist/reactive-collection-Cb1II1Fi.d.ts +344 -0
- package/dist/reactive-collection-storage-BNiEc-Gd.d.ts +217 -0
- package/dist/reactive-collection-storage-D-KmjE0J.d.cts +217 -0
- package/dist/reactive-map-BcB4KsQR.d.ts +256 -0
- package/dist/reactive-map-D-g3dv8I.d.cts +256 -0
- package/dist/read-through-B1CYPfq_.d.cts +82 -0
- package/dist/read-through-DwyJhGs1.d.ts +82 -0
- package/dist/render/index.cjs +250 -0
- package/dist/render/index.cjs.map +1 -0
- package/dist/render/index.d.cts +58 -0
- package/dist/render/index.d.ts +58 -0
- package/dist/render/index.js +20 -0
- package/dist/render/index.js.map +1 -0
- package/dist/resilience-Dig3Q7n0.d.cts +45 -0
- package/dist/resilience-Dig3Q7n0.d.ts +45 -0
- package/dist/semantic-memory-graph-BYoIlP35.d.cts +356 -0
- package/dist/semantic-memory-graph-CxyXLms3.d.ts +356 -0
- package/dist/solutions/index.cjs +3249 -0
- package/dist/solutions/index.cjs.map +1 -0
- package/dist/solutions/index.d.cts +520 -0
- package/dist/solutions/index.d.ts +520 -0
- package/dist/solutions/index.js +31 -0
- package/dist/solutions/index.js.map +1 -0
- package/dist/sources/browser.cjs +3095 -0
- package/dist/sources/browser.cjs.map +1 -0
- package/dist/sources/browser.d.cts +39 -0
- package/dist/sources/browser.d.ts +39 -0
- package/dist/sources/browser.js +137 -0
- package/dist/sources/browser.js.map +1 -0
- package/dist/sources/index.cjs +3021 -0
- package/dist/sources/index.cjs.map +1 -0
- package/dist/sources/index.d.cts +7 -0
- package/dist/sources/index.d.ts +7 -0
- package/dist/sources/index.js +63 -0
- package/dist/sources/index.js.map +1 -0
- package/dist/sources/node.cjs +675 -0
- package/dist/sources/node.cjs.map +1 -0
- package/dist/sources/node.d.cts +109 -0
- package/dist/sources/node.d.ts +109 -0
- package/dist/sources/node.js +639 -0
- package/dist/sources/node.js.map +1 -0
- package/dist/storage/browser.cjs +777 -0
- package/dist/storage/browser.cjs.map +1 -0
- package/dist/storage/browser.d.cts +40 -0
- package/dist/storage/browser.d.ts +40 -0
- package/dist/storage/browser.js +275 -0
- package/dist/storage/browser.js.map +1 -0
- package/dist/storage/index.cjs +1989 -0
- package/dist/storage/index.cjs.map +1 -0
- package/dist/storage/index.d.cts +92 -0
- package/dist/storage/index.d.ts +92 -0
- package/dist/storage/index.js +161 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/node.cjs +898 -0
- package/dist/storage/node.cjs.map +1 -0
- package/dist/storage/node.d.cts +66 -0
- package/dist/storage/node.d.ts +66 -0
- package/dist/storage/node.js +402 -0
- package/dist/storage/node.js.map +1 -0
- package/dist/testing/index.cjs +95 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +20 -0
- package/dist/testing/index.d.ts +20 -0
- package/dist/testing/index.js +8 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/types-bNMSWKqF.d.cts +732 -0
- package/dist/types-h12mNYbq.d.ts +732 -0
- package/package.json +250 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { N as Node, n as NodeOptions, h as HttpResponse, g as HttpRequest, x as ProcessResult, z as SseEvent, A as SseRequest, J as WebSocketEvent, M as WebSocketRequest, X as WebhookEvent, Y as WebhookRegistration, w as ProcessCommand } from './types-bNMSWKqF.cjs';
|
|
2
|
+
import { L as Operator } from './graph-s23RbbFO.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Async + sync sources (binding-layer sugar, D43 / D40 / feedback_async_sources_binding_layer).
|
|
6
|
+
*
|
|
7
|
+
* Sources are depless {@link Operator}`<never, T>` specs built on the `producer`/`node` path:
|
|
8
|
+
* the body runs ONCE on activation (node `_activate`), schedules its work, and emits later via
|
|
9
|
+
* the captured `ctx.down` (an external tier-3 emit → the leading DIRTY is synthesized for it,
|
|
10
|
+
* R-dirty-before-data). Async lives ONLY here (R-no-raw-async / F-SYNC-CORE): `setTimeout` /
|
|
11
|
+
* `Promise` / `for await` are confined to source bodies; the wave core stays sync. Cleanup is
|
|
12
|
+
* `ctx.onDeactivation` (D28), NOT a returned object. Per-language (D6/D24), never in parity.
|
|
13
|
+
*
|
|
14
|
+
* Instantiate via `g.initNode(timer(1000), [])` (graph-bound, inspectable) or
|
|
15
|
+
* {@link initNode}(timer(1000), []) (bare). Pool/pause defaults (D43): timer/interval =
|
|
16
|
+
* sync + pausable:false (keep producing through PAUSE); fromPromise/fromAsyncIter = async
|
|
17
|
+
* (default pausable, so a paused source buffers its late emits — R-async-paused).
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Values accepted by {@link fromAny}: an existing Node, a Promise, an (a)sync iterable, or a
|
|
22
|
+
* bare scalar. The universal coercion target for higher-order operators (CSP-2.7).
|
|
23
|
+
*/
|
|
24
|
+
type NodeInput<T> = Node<T> | PromiseLike<T> | AsyncIterable<T> | Iterable<T> | T;
|
|
25
|
+
/** Host-boundary options for {@link singleFromAny}. */
|
|
26
|
+
interface SingleFromAnyOptions<K> {
|
|
27
|
+
/**
|
|
28
|
+
* Map a caller key to the in-flight dedupe key. Defaults to key identity; object keys dedupe only
|
|
29
|
+
* when the same object reference is reused. Return a stable string/canonical value for structural
|
|
30
|
+
* object-key dedupe.
|
|
31
|
+
*/
|
|
32
|
+
keyOf?: (key: K) => unknown;
|
|
33
|
+
/** Treat a sync iterable result as a stream and take its first item. Defaults to scalar value. */
|
|
34
|
+
iter?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** Options shared by async/timer sources: an optional AbortSignal → ERROR on abort. */
|
|
37
|
+
interface AsyncSourceOpts {
|
|
38
|
+
signal?: AbortSignal;
|
|
39
|
+
}
|
|
40
|
+
interface TimerSourceOpts extends AsyncSourceOpts {
|
|
41
|
+
period?: number;
|
|
42
|
+
}
|
|
43
|
+
/** Options for {@link fromCron}. */
|
|
44
|
+
interface FromCronOptions extends AsyncSourceOpts {
|
|
45
|
+
/** Cron matcher polling interval in milliseconds. Default: 60_000. */
|
|
46
|
+
tickMs?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Emitted value shape. `timestamp_ns` is a decimal string so it cannot lose precision as a
|
|
49
|
+
* JavaScript number; use `timestamp_ms` when numeric millisecond precision is enough.
|
|
50
|
+
*/
|
|
51
|
+
output?: "date" | "timestamp_ms" | "timestamp_ns";
|
|
52
|
+
}
|
|
53
|
+
/** Minimal five-field cron schedule: minute hour day-of-month month day-of-week. */
|
|
54
|
+
interface CronSchedule {
|
|
55
|
+
readonly minutes: ReadonlySet<number>;
|
|
56
|
+
readonly hours: ReadonlySet<number>;
|
|
57
|
+
readonly daysOfMonth: ReadonlySet<number>;
|
|
58
|
+
readonly months: ReadonlySet<number>;
|
|
59
|
+
readonly daysOfWeek: ReadonlySet<number>;
|
|
60
|
+
}
|
|
61
|
+
/** DOM/EventEmitter-style target accepted by {@link fromEvent}. */
|
|
62
|
+
interface EventTargetLike {
|
|
63
|
+
addEventListener(type: string, listener: (event: unknown) => void, options?: EventListenerOptionsLike): void;
|
|
64
|
+
removeEventListener(type: string, listener: (event: unknown) => void, options?: EventListenerOptionsLike): void;
|
|
65
|
+
}
|
|
66
|
+
interface EventListenerOptionsLike {
|
|
67
|
+
capture?: boolean;
|
|
68
|
+
passive?: boolean;
|
|
69
|
+
once?: boolean;
|
|
70
|
+
}
|
|
71
|
+
type FromEventOptions = EventListenerOptionsLike;
|
|
72
|
+
/** Host push registration callback accepted by {@link fromPushNotification}. */
|
|
73
|
+
type PushUnsubscribe = () => void;
|
|
74
|
+
type PushRegister<T> = (deliver: (payload: T) => void) => PushUnsubscribe | undefined;
|
|
75
|
+
/** Parse a standard five-field cron expression. */
|
|
76
|
+
declare function parseCron(expr: string): CronSchedule;
|
|
77
|
+
/** Test whether a local Date matches a parsed cron schedule. */
|
|
78
|
+
declare function matchesCron(schedule: CronSchedule, date: Date): boolean;
|
|
79
|
+
declare function fromCron(expr: string, opts: FromCronOptions & {
|
|
80
|
+
output: "date";
|
|
81
|
+
}): Operator<never, Date>;
|
|
82
|
+
declare function fromCron(expr: string, opts: FromCronOptions & {
|
|
83
|
+
output: "timestamp_ms";
|
|
84
|
+
}): Operator<never, number>;
|
|
85
|
+
declare function fromCron(expr: string, opts?: FromCronOptions & {
|
|
86
|
+
output?: "timestamp_ns";
|
|
87
|
+
}): Operator<never, string>;
|
|
88
|
+
declare function fromCron(expr: string, opts?: FromCronOptions): Operator<never, Date | number | string>;
|
|
89
|
+
declare function runProcess(program: string, args?: readonly string[]): Operator<never, ProcessResult>;
|
|
90
|
+
declare function fromProcess(program: string, args?: readonly string[]): Operator<never, ProcessResult>;
|
|
91
|
+
declare function runProcessWithOptions(command: ProcessCommand): Operator<never, ProcessResult>;
|
|
92
|
+
declare function fromHttp(url: string): Operator<never, HttpResponse>;
|
|
93
|
+
declare function fromHttpWithOptions(request: HttpRequest): Operator<never, HttpResponse>;
|
|
94
|
+
declare function fromSSE(url: string): Operator<never, SseEvent>;
|
|
95
|
+
declare function fromSSEWithOptions(request: SseRequest): Operator<never, SseEvent>;
|
|
96
|
+
declare function fromWebSocket(url: string): Operator<never, WebSocketEvent>;
|
|
97
|
+
declare function fromWebSocketWithOptions(request: WebSocketRequest): Operator<never, WebSocketEvent>;
|
|
98
|
+
declare function fromWebhook(id: string): Operator<never, WebhookEvent>;
|
|
99
|
+
declare function fromWebhookWithOptions(registration: WebhookRegistration): Operator<never, WebhookEvent>;
|
|
100
|
+
/**
|
|
101
|
+
* Timer source: one-shot (first tick then COMPLETE) or periodic (`{period}` → 0, 1, 2, …).
|
|
102
|
+
* sync pool + pausable:false (a timer keeps producing through PAUSE, R-pause-modes). Emits the
|
|
103
|
+
* tick counter from 0; deactivation clears the timers.
|
|
104
|
+
*/
|
|
105
|
+
declare function timer(ms: number, opts?: TimerSourceOpts): Operator<never, number>;
|
|
106
|
+
/** Frozen pure-ts name for {@link timer}; preserves the real factory name in describe(). */
|
|
107
|
+
declare function fromTimer(ms: number, opts?: TimerSourceOpts): Operator<never, number>;
|
|
108
|
+
/** interval: periodic ticks (0, 1, 2, …), first at `ms`, then every `ms` (RxJS semantics). */
|
|
109
|
+
declare function interval(ms: number): Operator<never, number>;
|
|
110
|
+
/**
|
|
111
|
+
* Lift a Promise (or thenable) to a single-value stream: one DATA then COMPLETE, or ERROR on
|
|
112
|
+
* rejection. async pool (default pausable → a paused source buffers its late emit). Optional
|
|
113
|
+
* `signal` aborts to ERROR.
|
|
114
|
+
*/
|
|
115
|
+
declare function fromPromise<T>(p: Promise<T> | PromiseLike<T>, opts?: AsyncSourceOpts): Operator<never, T>;
|
|
116
|
+
/**
|
|
117
|
+
* Read an async iterable: each value → DATA; COMPLETE when done; ERROR on failure. async pool.
|
|
118
|
+
* Optional `signal` aborts the pump.
|
|
119
|
+
*/
|
|
120
|
+
declare function fromAsyncIter<T>(iterable: AsyncIterable<T>, opts?: AsyncSourceOpts): Operator<never, T>;
|
|
121
|
+
/**
|
|
122
|
+
* of: synchronous values — each argument as DATA, then COMPLETE. `of()` is the EMPTY source.
|
|
123
|
+
*/
|
|
124
|
+
declare function of<T = never>(...values: T[]): Operator<never, T>;
|
|
125
|
+
/** fromIter: a sync iterable — each value → DATA (in order), then COMPLETE, on activation. */
|
|
126
|
+
declare function fromIter<T>(iterable: Iterable<T>): Operator<never, T>;
|
|
127
|
+
/** EMPTY analogue: complete immediately with no DATA. */
|
|
128
|
+
declare function empty<T = never>(): Operator<never, T>;
|
|
129
|
+
/** NEVER analogue: activate and remain silent until deactivation. */
|
|
130
|
+
declare function never<T = never>(): Operator<never, T>;
|
|
131
|
+
/** Error source: terminate with ERROR on activation, coercing invalid host-language payloads. */
|
|
132
|
+
declare function throwError(err: unknown): Operator<never, never>;
|
|
133
|
+
/**
|
|
134
|
+
* Wrap a DOM-style event target. Each event becomes DATA; deactivation removes the listener.
|
|
135
|
+
* External callbacks are source boundaries (D43), so no polling or operator-level async leaks in.
|
|
136
|
+
*/
|
|
137
|
+
declare function fromEvent<T = unknown>(target: EventTargetLike, type: string, opts?: FromEventOptions): Operator<never, T>;
|
|
138
|
+
/**
|
|
139
|
+
* Wrap a host push transport. The host owns network/native setup; this factory owns reactive
|
|
140
|
+
* delivery and teardown only, preserving async-at-source-boundary discipline.
|
|
141
|
+
*/
|
|
142
|
+
declare function fromPushNotification<T = unknown>(register: PushRegister<T>): Operator<never, T>;
|
|
143
|
+
/**
|
|
144
|
+
* Coerce a {@link NodeInput}`<T>` to a `Node<T>` (D43 — coercion prerequisite for the CSP-2.7
|
|
145
|
+
* higher-order operators). An existing Node passes through; a thenable → {@link fromPromise};
|
|
146
|
+
* an async iterable → {@link fromAsyncIter}; with `{iter:true}` a sync iterable →
|
|
147
|
+
* {@link fromIter}; everything else → {@link of}. Coerced nodes are bare (use
|
|
148
|
+
* `opts.dispatcher` to bind one, default = process-global D26).
|
|
149
|
+
*/
|
|
150
|
+
declare function fromAny<T>(input: NodeInput<T>, opts?: NodeOptions<T> & {
|
|
151
|
+
iter?: boolean;
|
|
152
|
+
}): Node<T>;
|
|
153
|
+
/**
|
|
154
|
+
* Resolve the first DATA from a Node as a Promise. This is a host-boundary escape hatch, not a
|
|
155
|
+
* graph operator; do not call it from reactive node bodies. ERROR rejects, and COMPLETE before DATA
|
|
156
|
+
* rejects because no value exists.
|
|
157
|
+
*/
|
|
158
|
+
declare function firstValueFrom<T>(source: Node<T>): Promise<T>;
|
|
159
|
+
/**
|
|
160
|
+
* Keyed singleflight over {@link NodeInput}. Concurrent calls with the same key share one Promise;
|
|
161
|
+
* once that input resolves/rejects, the in-flight entry is cleared and a later call re-runs the
|
|
162
|
+
* factory. Host-boundary helper only; it does not create graph topology.
|
|
163
|
+
*/
|
|
164
|
+
declare function singleFromAny<K, T>(factory: (key: K) => NodeInput<T>, opts?: SingleFromAnyOptions<K>): (key: K) => Promise<T>;
|
|
165
|
+
|
|
166
|
+
export { type AsyncSourceOpts as A, parseCron as B, type CronSchedule as C, runProcess as D, type EventListenerOptionsLike as E, type FromCronOptions as F, runProcessWithOptions as G, singleFromAny as H, throwError as I, timer as J, type NodeInput as N, type PushRegister as P, type SingleFromAnyOptions as S, type TimerSourceOpts as T, type EventTargetLike as a, type FromEventOptions as b, type PushUnsubscribe as c, fromAny as d, empty as e, firstValueFrom as f, fromAsyncIter as g, fromCron as h, fromEvent as i, fromHttp as j, fromHttpWithOptions as k, fromIter as l, fromProcess as m, fromPromise as n, fromPushNotification as o, fromSSE as p, fromSSEWithOptions as q, fromTimer as r, fromWebSocket as s, fromWebSocketWithOptions as t, fromWebhook as u, fromWebhookWithOptions as v, interval as w, matchesCron as x, never as y, of as z };
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { N as Node, n as NodeOptions, h as HttpResponse, g as HttpRequest, x as ProcessResult, z as SseEvent, A as SseRequest, J as WebSocketEvent, M as WebSocketRequest, X as WebhookEvent, Y as WebhookRegistration, w as ProcessCommand } from './types-h12mNYbq.js';
|
|
2
|
+
import { L as Operator } from './graph-DfdF9zy4.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Async + sync sources (binding-layer sugar, D43 / D40 / feedback_async_sources_binding_layer).
|
|
6
|
+
*
|
|
7
|
+
* Sources are depless {@link Operator}`<never, T>` specs built on the `producer`/`node` path:
|
|
8
|
+
* the body runs ONCE on activation (node `_activate`), schedules its work, and emits later via
|
|
9
|
+
* the captured `ctx.down` (an external tier-3 emit → the leading DIRTY is synthesized for it,
|
|
10
|
+
* R-dirty-before-data). Async lives ONLY here (R-no-raw-async / F-SYNC-CORE): `setTimeout` /
|
|
11
|
+
* `Promise` / `for await` are confined to source bodies; the wave core stays sync. Cleanup is
|
|
12
|
+
* `ctx.onDeactivation` (D28), NOT a returned object. Per-language (D6/D24), never in parity.
|
|
13
|
+
*
|
|
14
|
+
* Instantiate via `g.initNode(timer(1000), [])` (graph-bound, inspectable) or
|
|
15
|
+
* {@link initNode}(timer(1000), []) (bare). Pool/pause defaults (D43): timer/interval =
|
|
16
|
+
* sync + pausable:false (keep producing through PAUSE); fromPromise/fromAsyncIter = async
|
|
17
|
+
* (default pausable, so a paused source buffers its late emits — R-async-paused).
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Values accepted by {@link fromAny}: an existing Node, a Promise, an (a)sync iterable, or a
|
|
22
|
+
* bare scalar. The universal coercion target for higher-order operators (CSP-2.7).
|
|
23
|
+
*/
|
|
24
|
+
type NodeInput<T> = Node<T> | PromiseLike<T> | AsyncIterable<T> | Iterable<T> | T;
|
|
25
|
+
/** Host-boundary options for {@link singleFromAny}. */
|
|
26
|
+
interface SingleFromAnyOptions<K> {
|
|
27
|
+
/**
|
|
28
|
+
* Map a caller key to the in-flight dedupe key. Defaults to key identity; object keys dedupe only
|
|
29
|
+
* when the same object reference is reused. Return a stable string/canonical value for structural
|
|
30
|
+
* object-key dedupe.
|
|
31
|
+
*/
|
|
32
|
+
keyOf?: (key: K) => unknown;
|
|
33
|
+
/** Treat a sync iterable result as a stream and take its first item. Defaults to scalar value. */
|
|
34
|
+
iter?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** Options shared by async/timer sources: an optional AbortSignal → ERROR on abort. */
|
|
37
|
+
interface AsyncSourceOpts {
|
|
38
|
+
signal?: AbortSignal;
|
|
39
|
+
}
|
|
40
|
+
interface TimerSourceOpts extends AsyncSourceOpts {
|
|
41
|
+
period?: number;
|
|
42
|
+
}
|
|
43
|
+
/** Options for {@link fromCron}. */
|
|
44
|
+
interface FromCronOptions extends AsyncSourceOpts {
|
|
45
|
+
/** Cron matcher polling interval in milliseconds. Default: 60_000. */
|
|
46
|
+
tickMs?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Emitted value shape. `timestamp_ns` is a decimal string so it cannot lose precision as a
|
|
49
|
+
* JavaScript number; use `timestamp_ms` when numeric millisecond precision is enough.
|
|
50
|
+
*/
|
|
51
|
+
output?: "date" | "timestamp_ms" | "timestamp_ns";
|
|
52
|
+
}
|
|
53
|
+
/** Minimal five-field cron schedule: minute hour day-of-month month day-of-week. */
|
|
54
|
+
interface CronSchedule {
|
|
55
|
+
readonly minutes: ReadonlySet<number>;
|
|
56
|
+
readonly hours: ReadonlySet<number>;
|
|
57
|
+
readonly daysOfMonth: ReadonlySet<number>;
|
|
58
|
+
readonly months: ReadonlySet<number>;
|
|
59
|
+
readonly daysOfWeek: ReadonlySet<number>;
|
|
60
|
+
}
|
|
61
|
+
/** DOM/EventEmitter-style target accepted by {@link fromEvent}. */
|
|
62
|
+
interface EventTargetLike {
|
|
63
|
+
addEventListener(type: string, listener: (event: unknown) => void, options?: EventListenerOptionsLike): void;
|
|
64
|
+
removeEventListener(type: string, listener: (event: unknown) => void, options?: EventListenerOptionsLike): void;
|
|
65
|
+
}
|
|
66
|
+
interface EventListenerOptionsLike {
|
|
67
|
+
capture?: boolean;
|
|
68
|
+
passive?: boolean;
|
|
69
|
+
once?: boolean;
|
|
70
|
+
}
|
|
71
|
+
type FromEventOptions = EventListenerOptionsLike;
|
|
72
|
+
/** Host push registration callback accepted by {@link fromPushNotification}. */
|
|
73
|
+
type PushUnsubscribe = () => void;
|
|
74
|
+
type PushRegister<T> = (deliver: (payload: T) => void) => PushUnsubscribe | undefined;
|
|
75
|
+
/** Parse a standard five-field cron expression. */
|
|
76
|
+
declare function parseCron(expr: string): CronSchedule;
|
|
77
|
+
/** Test whether a local Date matches a parsed cron schedule. */
|
|
78
|
+
declare function matchesCron(schedule: CronSchedule, date: Date): boolean;
|
|
79
|
+
declare function fromCron(expr: string, opts: FromCronOptions & {
|
|
80
|
+
output: "date";
|
|
81
|
+
}): Operator<never, Date>;
|
|
82
|
+
declare function fromCron(expr: string, opts: FromCronOptions & {
|
|
83
|
+
output: "timestamp_ms";
|
|
84
|
+
}): Operator<never, number>;
|
|
85
|
+
declare function fromCron(expr: string, opts?: FromCronOptions & {
|
|
86
|
+
output?: "timestamp_ns";
|
|
87
|
+
}): Operator<never, string>;
|
|
88
|
+
declare function fromCron(expr: string, opts?: FromCronOptions): Operator<never, Date | number | string>;
|
|
89
|
+
declare function runProcess(program: string, args?: readonly string[]): Operator<never, ProcessResult>;
|
|
90
|
+
declare function fromProcess(program: string, args?: readonly string[]): Operator<never, ProcessResult>;
|
|
91
|
+
declare function runProcessWithOptions(command: ProcessCommand): Operator<never, ProcessResult>;
|
|
92
|
+
declare function fromHttp(url: string): Operator<never, HttpResponse>;
|
|
93
|
+
declare function fromHttpWithOptions(request: HttpRequest): Operator<never, HttpResponse>;
|
|
94
|
+
declare function fromSSE(url: string): Operator<never, SseEvent>;
|
|
95
|
+
declare function fromSSEWithOptions(request: SseRequest): Operator<never, SseEvent>;
|
|
96
|
+
declare function fromWebSocket(url: string): Operator<never, WebSocketEvent>;
|
|
97
|
+
declare function fromWebSocketWithOptions(request: WebSocketRequest): Operator<never, WebSocketEvent>;
|
|
98
|
+
declare function fromWebhook(id: string): Operator<never, WebhookEvent>;
|
|
99
|
+
declare function fromWebhookWithOptions(registration: WebhookRegistration): Operator<never, WebhookEvent>;
|
|
100
|
+
/**
|
|
101
|
+
* Timer source: one-shot (first tick then COMPLETE) or periodic (`{period}` → 0, 1, 2, …).
|
|
102
|
+
* sync pool + pausable:false (a timer keeps producing through PAUSE, R-pause-modes). Emits the
|
|
103
|
+
* tick counter from 0; deactivation clears the timers.
|
|
104
|
+
*/
|
|
105
|
+
declare function timer(ms: number, opts?: TimerSourceOpts): Operator<never, number>;
|
|
106
|
+
/** Frozen pure-ts name for {@link timer}; preserves the real factory name in describe(). */
|
|
107
|
+
declare function fromTimer(ms: number, opts?: TimerSourceOpts): Operator<never, number>;
|
|
108
|
+
/** interval: periodic ticks (0, 1, 2, …), first at `ms`, then every `ms` (RxJS semantics). */
|
|
109
|
+
declare function interval(ms: number): Operator<never, number>;
|
|
110
|
+
/**
|
|
111
|
+
* Lift a Promise (or thenable) to a single-value stream: one DATA then COMPLETE, or ERROR on
|
|
112
|
+
* rejection. async pool (default pausable → a paused source buffers its late emit). Optional
|
|
113
|
+
* `signal` aborts to ERROR.
|
|
114
|
+
*/
|
|
115
|
+
declare function fromPromise<T>(p: Promise<T> | PromiseLike<T>, opts?: AsyncSourceOpts): Operator<never, T>;
|
|
116
|
+
/**
|
|
117
|
+
* Read an async iterable: each value → DATA; COMPLETE when done; ERROR on failure. async pool.
|
|
118
|
+
* Optional `signal` aborts the pump.
|
|
119
|
+
*/
|
|
120
|
+
declare function fromAsyncIter<T>(iterable: AsyncIterable<T>, opts?: AsyncSourceOpts): Operator<never, T>;
|
|
121
|
+
/**
|
|
122
|
+
* of: synchronous values — each argument as DATA, then COMPLETE. `of()` is the EMPTY source.
|
|
123
|
+
*/
|
|
124
|
+
declare function of<T = never>(...values: T[]): Operator<never, T>;
|
|
125
|
+
/** fromIter: a sync iterable — each value → DATA (in order), then COMPLETE, on activation. */
|
|
126
|
+
declare function fromIter<T>(iterable: Iterable<T>): Operator<never, T>;
|
|
127
|
+
/** EMPTY analogue: complete immediately with no DATA. */
|
|
128
|
+
declare function empty<T = never>(): Operator<never, T>;
|
|
129
|
+
/** NEVER analogue: activate and remain silent until deactivation. */
|
|
130
|
+
declare function never<T = never>(): Operator<never, T>;
|
|
131
|
+
/** Error source: terminate with ERROR on activation, coercing invalid host-language payloads. */
|
|
132
|
+
declare function throwError(err: unknown): Operator<never, never>;
|
|
133
|
+
/**
|
|
134
|
+
* Wrap a DOM-style event target. Each event becomes DATA; deactivation removes the listener.
|
|
135
|
+
* External callbacks are source boundaries (D43), so no polling or operator-level async leaks in.
|
|
136
|
+
*/
|
|
137
|
+
declare function fromEvent<T = unknown>(target: EventTargetLike, type: string, opts?: FromEventOptions): Operator<never, T>;
|
|
138
|
+
/**
|
|
139
|
+
* Wrap a host push transport. The host owns network/native setup; this factory owns reactive
|
|
140
|
+
* delivery and teardown only, preserving async-at-source-boundary discipline.
|
|
141
|
+
*/
|
|
142
|
+
declare function fromPushNotification<T = unknown>(register: PushRegister<T>): Operator<never, T>;
|
|
143
|
+
/**
|
|
144
|
+
* Coerce a {@link NodeInput}`<T>` to a `Node<T>` (D43 — coercion prerequisite for the CSP-2.7
|
|
145
|
+
* higher-order operators). An existing Node passes through; a thenable → {@link fromPromise};
|
|
146
|
+
* an async iterable → {@link fromAsyncIter}; with `{iter:true}` a sync iterable →
|
|
147
|
+
* {@link fromIter}; everything else → {@link of}. Coerced nodes are bare (use
|
|
148
|
+
* `opts.dispatcher` to bind one, default = process-global D26).
|
|
149
|
+
*/
|
|
150
|
+
declare function fromAny<T>(input: NodeInput<T>, opts?: NodeOptions<T> & {
|
|
151
|
+
iter?: boolean;
|
|
152
|
+
}): Node<T>;
|
|
153
|
+
/**
|
|
154
|
+
* Resolve the first DATA from a Node as a Promise. This is a host-boundary escape hatch, not a
|
|
155
|
+
* graph operator; do not call it from reactive node bodies. ERROR rejects, and COMPLETE before DATA
|
|
156
|
+
* rejects because no value exists.
|
|
157
|
+
*/
|
|
158
|
+
declare function firstValueFrom<T>(source: Node<T>): Promise<T>;
|
|
159
|
+
/**
|
|
160
|
+
* Keyed singleflight over {@link NodeInput}. Concurrent calls with the same key share one Promise;
|
|
161
|
+
* once that input resolves/rejects, the in-flight entry is cleared and a later call re-runs the
|
|
162
|
+
* factory. Host-boundary helper only; it does not create graph topology.
|
|
163
|
+
*/
|
|
164
|
+
declare function singleFromAny<K, T>(factory: (key: K) => NodeInput<T>, opts?: SingleFromAnyOptions<K>): (key: K) => Promise<T>;
|
|
165
|
+
|
|
166
|
+
export { type AsyncSourceOpts as A, parseCron as B, type CronSchedule as C, runProcess as D, type EventListenerOptionsLike as E, type FromCronOptions as F, runProcessWithOptions as G, singleFromAny as H, throwError as I, timer as J, type NodeInput as N, type PushRegister as P, type SingleFromAnyOptions as S, type TimerSourceOpts as T, type EventTargetLike as a, type FromEventOptions as b, type PushUnsubscribe as c, fromAny as d, empty as e, firstValueFrom as f, fromAsyncIter as g, fromCron as h, fromEvent as i, fromHttp as j, fromHttpWithOptions as k, fromIter as l, fromProcess as m, fromPromise as n, fromPushNotification as o, fromSSE as p, fromSSEWithOptions as q, fromTimer as r, fromWebSocket as s, fromWebSocketWithOptions as t, fromWebhook as u, fromWebhookWithOptions as v, interval as w, matchesCron as x, never as y, of as z };
|