@securitydept/client 0.2.0-beta.4 → 0.2.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth-coordination/index.d.mts +1 -1
- package/dist/auth-coordination/index.mjs +1 -1
- package/dist/events/index.d.mts +2 -0
- package/dist/events/index.mjs +2 -0
- package/dist/events-BUlfsRfl.mjs +127 -0
- package/dist/events-BUlfsRfl.mjs.map +1 -0
- package/dist/{fetch-transport-CMG4tfDu.d.mts → fetch-transport-Bd5RyWj2.d.mts} +4 -33
- package/dist/index-C_wgl6dW.d.mts +102 -0
- package/dist/{index-XkwmYaJF.d.mts → index-DbYSFHDe.d.mts} +2 -2
- package/dist/index.d.mts +31 -104
- package/dist/index.mjs +3 -168
- package/dist/index.mjs.map +1 -1
- package/dist/persistence/index.d.mts +2 -2
- package/dist/persistence/index.mjs +1 -1
- package/dist/persistence/web/index.d.mts +1 -1
- package/dist/{persistence-Db2CIFbx.mjs → persistence-CSB8770k.mjs} +1 -1
- package/dist/{persistence-Db2CIFbx.mjs.map → persistence-CSB8770k.mjs.map} +1 -1
- package/dist/{planner-host-DUZCkLj3.d.mts → planner-host-CPyGNyQV.d.mts} +1 -1
- package/dist/{planner-host-CcEpcHws.mjs → planner-host-CV38bMSn.mjs} +1 -1
- package/dist/{planner-host-CcEpcHws.mjs.map → planner-host-CV38bMSn.mjs.map} +1 -1
- package/dist/{types-DKluXsWS.d.mts → types-C59fcM5W.d.mts} +1 -1
- package/dist/types-DQc088ZP.d.mts +32 -0
- package/dist/web/index.d.mts +39 -2
- package/dist/web/index.mjs +92 -2
- package/dist/web/index.mjs.map +1 -1
- package/dist/web-router/index.d.mts +1 -1
- package/dist/web-router/index.mjs +1 -1
- package/package.json +7 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as PlannerHostResult, c as ScopedRequirementsClientSet, i as PlannerHost, l as createPlannerHost, n as CandidateSelector, o as RequirementsClientSet, r as CreatePlannerHostOptions, s as RequirementsClientSetComposition, t as AuthGuardClientOption, u as resolveEffectiveClientSet } from "../planner-host-
|
|
1
|
+
import { a as PlannerHostResult, c as ScopedRequirementsClientSet, i as PlannerHost, l as createPlannerHost, n as CandidateSelector, o as RequirementsClientSet, r as CreatePlannerHostOptions, s as RequirementsClientSetComposition, t as AuthGuardClientOption, u as resolveEffectiveClientSet } from "../planner-host-CPyGNyQV.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/auth-coordination/requirement-planner.d.ts
|
|
4
4
|
/** A single auth requirement within an orchestration plan. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as RequirementPlannerError, i as PlanStatus, n as createPlannerHost, o as ResolutionStatus, r as resolveEffectiveClientSet, s as createRequirementPlanner, t as RequirementsClientSetComposition } from "../planner-host-
|
|
1
|
+
import { a as RequirementPlannerError, i as PlanStatus, n as createPlannerHost, o as ResolutionStatus, r as resolveEffectiveClientSet, s as createRequirementPlanner, t as RequirementsClientSetComposition } from "../planner-host-CV38bMSn.mjs";
|
|
2
2
|
//#region src/auth-coordination/route-orchestrator.ts
|
|
3
3
|
/** Merge a matched route chain into a flat requirement list (parent-first). */
|
|
4
4
|
function mergeChainRequirements(chain) {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as EventSource, D as ReplaySubjectTrait, E as EventSubscriptionTrait, O as RuntimeEventEnvelope, S as EventObserver, T as EventStreamTrait, _ as createEventStream, a as filter, b as fromRxObservable, c as merge, d as shareReplay, f as switchMap, g as withLatestFromSignal, h as throttleTime, i as exhaustMap, k as SubjectTrait, l as pipe, m as tap, n as concatMap, o as finalize, p as takeUntil, r as debounceTime, s as map, t as EventOperator, u as share, v as createReplaySubject, w as EventSourceKind, x as toRxObservable, y as createSubject } from "../index-C_wgl6dW.mjs";
|
|
2
|
+
export { EventObserver, EventOperator, EventSource, EventSourceKind, EventStreamTrait, EventSubscriptionTrait, ReplaySubjectTrait, RuntimeEventEnvelope, SubjectTrait, concatMap, createEventStream, createReplaySubject, createSubject, debounceTime, exhaustMap, filter, finalize, fromRxObservable, map, merge, pipe, share, shareReplay, switchMap, takeUntil, tap, throttleTime, toRxObservable, withLatestFromSignal };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { _ as createEventStream, a as filter, b as fromRxObservable, c as merge, d as shareReplay, f as switchMap, g as withLatestFromSignal, h as throttleTime, i as exhaustMap, l as pipe, m as tap, n as concatMap, o as finalize, p as takeUntil, r as debounceTime, s as map, t as EventSourceKind, u as share, v as createReplaySubject, x as toRxObservable, y as createSubject } from "../events-BUlfsRfl.mjs";
|
|
2
|
+
export { EventSourceKind, concatMap, createEventStream, createReplaySubject, createSubject, debounceTime, exhaustMap, filter, finalize, fromRxObservable, map, merge, pipe, share, shareReplay, switchMap, takeUntil, tap, throttleTime, toRxObservable, withLatestFromSignal };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Observable, ReplaySubject, Subject, merge } from "rxjs";
|
|
2
|
+
import { concatMap, debounceTime, exhaustMap, filter, finalize, map, share, shareReplay, switchMap, takeUntil, tap, throttleTime, withLatestFrom } from "rxjs/operators";
|
|
3
|
+
//#region src/events/event-stream.ts
|
|
4
|
+
const RX_OBSERVABLE = Symbol("securitydept.rxObservable");
|
|
5
|
+
/**
|
|
6
|
+
* Create a new event stream from a producer function.
|
|
7
|
+
*
|
|
8
|
+
* The producer receives an observer and should call `next()` to emit values,
|
|
9
|
+
* `error()` to signal an error, and `complete()` to signal completion.
|
|
10
|
+
* It may return a teardown function that will be called on unsubscribe.
|
|
11
|
+
*/
|
|
12
|
+
function createEventStream(producer) {
|
|
13
|
+
return fromRxObservable(new Observable((subscriber) => {
|
|
14
|
+
const teardown = producer({
|
|
15
|
+
next: (value) => subscriber.next(value),
|
|
16
|
+
error: (error) => subscriber.error(error),
|
|
17
|
+
complete: () => subscriber.complete()
|
|
18
|
+
});
|
|
19
|
+
return () => teardown?.();
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
function createSubject() {
|
|
23
|
+
return wrapSubject(new Subject());
|
|
24
|
+
}
|
|
25
|
+
function createReplaySubject(bufferSize = 1) {
|
|
26
|
+
const subject = wrapSubject(new ReplaySubject(bufferSize));
|
|
27
|
+
return Object.assign(subject, { bufferSize });
|
|
28
|
+
}
|
|
29
|
+
function toRxObservable(stream) {
|
|
30
|
+
const maybeBacked = stream;
|
|
31
|
+
if (maybeBacked[RX_OBSERVABLE]) return maybeBacked[RX_OBSERVABLE];
|
|
32
|
+
return new Observable((subscriber) => {
|
|
33
|
+
const subscription = stream.subscribe({
|
|
34
|
+
next: (value) => subscriber.next(value),
|
|
35
|
+
error: (error) => subscriber.error(error),
|
|
36
|
+
complete: () => subscriber.complete()
|
|
37
|
+
});
|
|
38
|
+
return () => subscription.unsubscribe();
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function fromRxObservable(observable) {
|
|
42
|
+
return {
|
|
43
|
+
[RX_OBSERVABLE]: observable,
|
|
44
|
+
subscribe(observer) {
|
|
45
|
+
const subscription = observable.subscribe({
|
|
46
|
+
next: (value) => observer.next?.(value),
|
|
47
|
+
error: (error) => observer.error?.(error),
|
|
48
|
+
complete: () => observer.complete?.()
|
|
49
|
+
});
|
|
50
|
+
return { unsubscribe: () => subscription.unsubscribe() };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function wrapSubject(subject) {
|
|
55
|
+
return Object.assign(fromRxObservable(subject.asObservable()), {
|
|
56
|
+
next: (value) => subject.next(value),
|
|
57
|
+
error: (error) => subject.error(error),
|
|
58
|
+
complete: () => subject.complete()
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/events/operators.ts
|
|
63
|
+
function pipe(source, ...operators) {
|
|
64
|
+
return operators.reduce((acc, op) => op(acc), source);
|
|
65
|
+
}
|
|
66
|
+
function map$1(fn) {
|
|
67
|
+
return (source) => fromRxObservable(toRxObservable(source).pipe(map(fn)));
|
|
68
|
+
}
|
|
69
|
+
function filter$1(predicate) {
|
|
70
|
+
return (source) => fromRxObservable(toRxObservable(source).pipe(filter(predicate)));
|
|
71
|
+
}
|
|
72
|
+
function tap$1(fn) {
|
|
73
|
+
return (source) => fromRxObservable(toRxObservable(source).pipe(tap(fn)));
|
|
74
|
+
}
|
|
75
|
+
function takeUntil$1(notifier) {
|
|
76
|
+
return (source) => fromRxObservable(toRxObservable(source).pipe(takeUntil(toRxObservable(notifier))));
|
|
77
|
+
}
|
|
78
|
+
function finalize$1(fn) {
|
|
79
|
+
return (source) => fromRxObservable(toRxObservable(source).pipe(finalize(fn)));
|
|
80
|
+
}
|
|
81
|
+
function merge$1(...sources) {
|
|
82
|
+
return fromRxObservable(merge(...sources.map(toRxObservable)));
|
|
83
|
+
}
|
|
84
|
+
function share$1() {
|
|
85
|
+
return (source) => fromRxObservable(toRxObservable(source).pipe(share()));
|
|
86
|
+
}
|
|
87
|
+
function shareReplay$1(bufferSize = 1) {
|
|
88
|
+
return (source) => fromRxObservable(toRxObservable(source).pipe(shareReplay({
|
|
89
|
+
bufferSize,
|
|
90
|
+
refCount: true
|
|
91
|
+
})));
|
|
92
|
+
}
|
|
93
|
+
function switchMap$1(fn) {
|
|
94
|
+
return (source) => fromRxObservable(toRxObservable(source).pipe(switchMap((value) => toRxObservable(fn(value)))));
|
|
95
|
+
}
|
|
96
|
+
function concatMap$1(fn) {
|
|
97
|
+
return (source) => fromRxObservable(toRxObservable(source).pipe(concatMap((value) => toRxObservable(fn(value)))));
|
|
98
|
+
}
|
|
99
|
+
function exhaustMap$1(fn) {
|
|
100
|
+
return (source) => fromRxObservable(toRxObservable(source).pipe(exhaustMap((value) => toRxObservable(fn(value)))));
|
|
101
|
+
}
|
|
102
|
+
function debounceTime$1(durationMs) {
|
|
103
|
+
return (source) => fromRxObservable(toRxObservable(source).pipe(debounceTime(durationMs)));
|
|
104
|
+
}
|
|
105
|
+
function throttleTime$1(durationMs) {
|
|
106
|
+
return (source) => fromRxObservable(toRxObservable(source).pipe(throttleTime(durationMs)));
|
|
107
|
+
}
|
|
108
|
+
function withLatestFromSignal(signal) {
|
|
109
|
+
return (source) => fromRxObservable(toRxObservable(source).pipe(withLatestFrom(toRxObservable(createEventStream((observer) => {
|
|
110
|
+
observer.next?.(signal.get());
|
|
111
|
+
return signal.subscribe(() => observer.next?.(signal.get()));
|
|
112
|
+
})))));
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/events/types.ts
|
|
116
|
+
const EventSourceKind = {
|
|
117
|
+
User: "user",
|
|
118
|
+
Timer: "timer",
|
|
119
|
+
Http: "http",
|
|
120
|
+
Storage: "storage",
|
|
121
|
+
Framework: "framework",
|
|
122
|
+
System: "system"
|
|
123
|
+
};
|
|
124
|
+
//#endregion
|
|
125
|
+
export { createEventStream as _, filter$1 as a, fromRxObservable as b, merge$1 as c, shareReplay$1 as d, switchMap$1 as f, withLatestFromSignal as g, throttleTime$1 as h, exhaustMap$1 as i, pipe as l, tap$1 as m, concatMap$1 as n, finalize$1 as o, takeUntil$1 as p, debounceTime$1 as r, map$1 as s, EventSourceKind as t, share$1 as u, createReplaySubject as v, toRxObservable as x, createSubject as y };
|
|
126
|
+
|
|
127
|
+
//# sourceMappingURL=events-BUlfsRfl.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-BUlfsRfl.mjs","names":["map","rxMap","filter","rxFilter","tap","rxTap","takeUntil","rxTakeUntil","finalize","rxFinalize","merge","rxMerge","share","rxShare","shareReplay","rxShareReplay","switchMap","rxSwitchMap","concatMap","rxConcatMap","exhaustMap","rxExhaustMap","debounceTime","rxDebounceTime","throttleTime","rxThrottleTime","rxWithLatestFrom"],"sources":["../src/events/event-stream.ts","../src/events/operators.ts","../src/events/types.ts"],"sourcesContent":["import { Observable, ReplaySubject, Subject } from \"rxjs\";\nimport type {\n\tEventObserver,\n\tEventStreamTrait,\n\tEventSubscriptionTrait,\n\tReplaySubjectTrait,\n\tSubjectTrait,\n} from \"./types\";\n\nconst RX_OBSERVABLE = Symbol(\"securitydept.rxObservable\");\n\ntype RxBackedEventStream<T> = EventStreamTrait<T> & {\n\treadonly [RX_OBSERVABLE]: Observable<T>;\n};\n\n/**\n * Create a new event stream from a producer function.\n *\n * The producer receives an observer and should call `next()` to emit values,\n * `error()` to signal an error, and `complete()` to signal completion.\n * It may return a teardown function that will be called on unsubscribe.\n */\nexport function createEventStream<T>(\n\tproducer: (observer: EventObserver<T>) => (() => void) | void,\n): EventStreamTrait<T> {\n\treturn fromRxObservable(\n\t\tnew Observable<T>((subscriber) => {\n\t\t\tconst teardown = producer({\n\t\t\t\tnext: (value) => subscriber.next(value),\n\t\t\t\terror: (error) => subscriber.error(error),\n\t\t\t\tcomplete: () => subscriber.complete(),\n\t\t\t});\n\t\t\treturn () => teardown?.();\n\t\t}),\n\t);\n}\n\nexport function createSubject<T>(): SubjectTrait<T> {\n\treturn wrapSubject(new Subject<T>());\n}\n\nexport function createReplaySubject<T>(bufferSize = 1): ReplaySubjectTrait<T> {\n\tconst subject = wrapSubject(new ReplaySubject<T>(bufferSize));\n\treturn Object.assign(subject, { bufferSize });\n}\n\nexport function toRxObservable<T>(stream: EventStreamTrait<T>): Observable<T> {\n\tconst maybeBacked = stream as Partial<RxBackedEventStream<T>>;\n\tif (maybeBacked[RX_OBSERVABLE]) {\n\t\treturn maybeBacked[RX_OBSERVABLE];\n\t}\n\n\treturn new Observable<T>((subscriber) => {\n\t\tconst subscription = stream.subscribe({\n\t\t\tnext: (value) => subscriber.next(value),\n\t\t\terror: (error) => subscriber.error(error),\n\t\t\tcomplete: () => subscriber.complete(),\n\t\t});\n\t\treturn () => subscription.unsubscribe();\n\t});\n}\n\nexport function fromRxObservable<T>(\n\tobservable: Observable<T>,\n): EventStreamTrait<T> {\n\treturn {\n\t\t[RX_OBSERVABLE]: observable,\n\t\tsubscribe(observer: EventObserver<T>): EventSubscriptionTrait {\n\t\t\tconst subscription = observable.subscribe({\n\t\t\t\tnext: (value) => observer.next?.(value),\n\t\t\t\terror: (error) => observer.error?.(error),\n\t\t\t\tcomplete: () => observer.complete?.(),\n\t\t\t});\n\t\t\treturn { unsubscribe: () => subscription.unsubscribe() };\n\t\t},\n\t} as RxBackedEventStream<T>;\n}\n\nfunction wrapSubject<T>(subject: Subject<T>): SubjectTrait<T> {\n\treturn Object.assign(fromRxObservable(subject.asObservable()), {\n\t\tnext: (value: T) => subject.next(value),\n\t\terror: (error: unknown) => subject.error(error),\n\t\tcomplete: () => subject.complete(),\n\t});\n}\n","import { merge as rxMerge } from \"rxjs\";\nimport {\n\tconcatMap as rxConcatMap,\n\tdebounceTime as rxDebounceTime,\n\texhaustMap as rxExhaustMap,\n\tfilter as rxFilter,\n\tfinalize as rxFinalize,\n\tmap as rxMap,\n\tshare as rxShare,\n\tshareReplay as rxShareReplay,\n\tswitchMap as rxSwitchMap,\n\ttakeUntil as rxTakeUntil,\n\ttap as rxTap,\n\tthrottleTime as rxThrottleTime,\n\twithLatestFrom as rxWithLatestFrom,\n} from \"rxjs/operators\";\nimport type { ReadableSignalTrait } from \"../signals\";\nimport {\n\tcreateEventStream,\n\tfromRxObservable,\n\ttoRxObservable,\n} from \"./event-stream\";\nimport type { EventStreamTrait } from \"./types\";\n\n// --- Operator types ---\n\nexport type EventOperator<A, B> = (\n\tsource: EventStreamTrait<A>,\n) => EventStreamTrait<B>;\n\n// --- pipe ---\n\nexport function pipe<A>(source: EventStreamTrait<A>): EventStreamTrait<A>;\nexport function pipe<A, B>(\n\tsource: EventStreamTrait<A>,\n\top1: EventOperator<A, B>,\n): EventStreamTrait<B>;\nexport function pipe<A, B, C>(\n\tsource: EventStreamTrait<A>,\n\top1: EventOperator<A, B>,\n\top2: EventOperator<B, C>,\n): EventStreamTrait<C>;\nexport function pipe<A, B, C, D>(\n\tsource: EventStreamTrait<A>,\n\top1: EventOperator<A, B>,\n\top2: EventOperator<B, C>,\n\top3: EventOperator<C, D>,\n): EventStreamTrait<D>;\nexport function pipe(\n\tsource: EventStreamTrait<unknown>,\n\t...operators: EventOperator<unknown, unknown>[]\n): EventStreamTrait<unknown> {\n\treturn operators.reduce((acc, op) => op(acc), source);\n}\n\n// --- map ---\n\nexport function map<A, B>(fn: (value: A) => B): EventOperator<A, B> {\n\treturn (source) => fromRxObservable(toRxObservable(source).pipe(rxMap(fn)));\n}\n\n// --- filter ---\n\nexport function filter<A>(\n\tpredicate: (value: A) => boolean,\n): EventOperator<A, A> {\n\treturn (source) =>\n\t\tfromRxObservable(toRxObservable(source).pipe(rxFilter(predicate)));\n}\n\n// --- tap ---\n\nexport function tap<A>(fn: (value: A) => void): EventOperator<A, A> {\n\treturn (source) => fromRxObservable(toRxObservable(source).pipe(rxTap(fn)));\n}\n\n// --- takeUntil ---\n\nexport function takeUntil<A>(\n\tnotifier: EventStreamTrait<unknown>,\n): EventOperator<A, A> {\n\treturn (source) =>\n\t\tfromRxObservable(\n\t\t\ttoRxObservable(source).pipe(rxTakeUntil(toRxObservable(notifier))),\n\t\t);\n}\n\n// --- finalize ---\n\nexport function finalize<A>(fn: () => void): EventOperator<A, A> {\n\treturn (source) =>\n\t\tfromRxObservable(toRxObservable(source).pipe(rxFinalize(fn)));\n}\n\n// --- merge ---\n\nexport function merge<A>(\n\t...sources: EventStreamTrait<A>[]\n): EventStreamTrait<A> {\n\treturn fromRxObservable(rxMerge(...sources.map(toRxObservable)));\n}\n\nexport function share<A>(): EventOperator<A, A> {\n\treturn (source) => fromRxObservable(toRxObservable(source).pipe(rxShare()));\n}\n\nexport function shareReplay<A>(bufferSize = 1): EventOperator<A, A> {\n\treturn (source) =>\n\t\tfromRxObservable(\n\t\t\ttoRxObservable(source).pipe(\n\t\t\t\trxShareReplay({ bufferSize, refCount: true }),\n\t\t\t),\n\t\t);\n}\n\nexport function switchMap<A, B>(\n\tfn: (value: A) => EventStreamTrait<B>,\n): EventOperator<A, B> {\n\treturn (source) =>\n\t\tfromRxObservable(\n\t\t\ttoRxObservable(source).pipe(\n\t\t\t\trxSwitchMap((value) => toRxObservable(fn(value))),\n\t\t\t),\n\t\t);\n}\n\nexport function concatMap<A, B>(\n\tfn: (value: A) => EventStreamTrait<B>,\n): EventOperator<A, B> {\n\treturn (source) =>\n\t\tfromRxObservable(\n\t\t\ttoRxObservable(source).pipe(\n\t\t\t\trxConcatMap((value) => toRxObservable(fn(value))),\n\t\t\t),\n\t\t);\n}\n\nexport function exhaustMap<A, B>(\n\tfn: (value: A) => EventStreamTrait<B>,\n): EventOperator<A, B> {\n\treturn (source) =>\n\t\tfromRxObservable(\n\t\t\ttoRxObservable(source).pipe(\n\t\t\t\trxExhaustMap((value) => toRxObservable(fn(value))),\n\t\t\t),\n\t\t);\n}\n\nexport function debounceTime<A>(durationMs: number): EventOperator<A, A> {\n\treturn (source) =>\n\t\tfromRxObservable(toRxObservable(source).pipe(rxDebounceTime(durationMs)));\n}\n\nexport function throttleTime<A>(durationMs: number): EventOperator<A, A> {\n\treturn (source) =>\n\t\tfromRxObservable(toRxObservable(source).pipe(rxThrottleTime(durationMs)));\n}\n\nexport function withLatestFromSignal<A, B>(\n\tsignal: ReadableSignalTrait<B>,\n): EventOperator<A, [A, B]> {\n\treturn (source) =>\n\t\tfromRxObservable(\n\t\t\ttoRxObservable(source).pipe(\n\t\t\t\trxWithLatestFrom(\n\t\t\t\t\ttoRxObservable(\n\t\t\t\t\t\tcreateEventStream<B>((observer) => {\n\t\t\t\t\t\t\tobserver.next?.(signal.get());\n\t\t\t\t\t\t\treturn signal.subscribe(() => observer.next?.(signal.get()));\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n}\n","// --- Event system trait types ---\n\n/** Subscription handle with explicit unsubscribe. */\nexport interface EventSubscriptionTrait {\n\tunsubscribe(): void;\n}\n\n/** Observer for event streams — mirrors the Observable observer pattern. */\nexport interface EventObserver<T> {\n\tnext?(value: T): void;\n\terror?(error: unknown): void;\n\tcomplete?(): void;\n}\n\n/** Read-only event stream — lazy push-based sequence. */\nexport interface EventStreamTrait<T> {\n\tsubscribe(observer: EventObserver<T>): EventSubscriptionTrait;\n}\n\n/** Hot event producer. */\nexport interface SubjectTrait<T> extends EventStreamTrait<T> {\n\tnext(value: T): void;\n\terror(error: unknown): void;\n\tcomplete(): void;\n}\n\n/** Hot event producer that replays recent values to late subscribers. */\nexport interface ReplaySubjectTrait<T> extends SubjectTrait<T> {\n\treadonly bufferSize: number;\n}\n\n// --- Event envelope ---\n\nexport const EventSourceKind = {\n\tUser: \"user\",\n\tTimer: \"timer\",\n\tHttp: \"http\",\n\tStorage: \"storage\",\n\tFramework: \"framework\",\n\tSystem: \"system\",\n} as const;\n\nexport type EventSourceKind =\n\t(typeof EventSourceKind)[keyof typeof EventSourceKind];\n\nexport type EventSource =\n\t| { kind: typeof EventSourceKind.User; actor?: string }\n\t| { kind: typeof EventSourceKind.Timer; timer: string }\n\t| { kind: typeof EventSourceKind.Http; requestId: string; endpoint?: string }\n\t| { kind: typeof EventSourceKind.Storage; operation: string }\n\t| { kind: typeof EventSourceKind.Framework; name: string }\n\t| { kind: typeof EventSourceKind.System; subsystem: string };\n\nexport interface RuntimeEventEnvelope<TType extends string, TPayload> {\n\tid: string;\n\ttype: TType;\n\tat: number;\n\tsource: EventSource;\n\tpayload: TPayload;\n}\n"],"mappings":"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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as ReadableSignalTrait } from "./types-DQc088ZP.mjs";
|
|
2
|
+
import { a as RecordStore } from "./types-C59fcM5W.mjs";
|
|
2
3
|
|
|
3
4
|
//#region src/cancellation/types.d.ts
|
|
4
5
|
/** Disposable resource handle. */
|
|
@@ -129,36 +130,6 @@ interface ClientRuntime {
|
|
|
129
130
|
sessionStore?: RecordStore;
|
|
130
131
|
}
|
|
131
132
|
//#endregion
|
|
132
|
-
//#region src/signals/types.d.ts
|
|
133
|
-
/**
|
|
134
|
-
* Read-only signal interface.
|
|
135
|
-
* Semantics align with TC39 Signals proposal, but uses an SDK-owned thin protocol
|
|
136
|
-
* to avoid coupling to any specific polyfill or standard implementation.
|
|
137
|
-
*/
|
|
138
|
-
interface ReadableSignalTrait<T> {
|
|
139
|
-
/** Return the current snapshot value. */
|
|
140
|
-
get(): T;
|
|
141
|
-
/**
|
|
142
|
-
* Subscribe to value changes.
|
|
143
|
-
* The listener is called whenever the value changes (not on subscribe).
|
|
144
|
-
* @returns An unsubscribe function.
|
|
145
|
-
*/
|
|
146
|
-
subscribe(listener: () => void): () => void;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Writable signal interface.
|
|
150
|
-
* State transitions should be controlled by the client / service layer;
|
|
151
|
-
* external consumers typically only see the read-only projection.
|
|
152
|
-
*/
|
|
153
|
-
interface WritableSignalTrait<T> extends ReadableSignalTrait<T> {
|
|
154
|
-
set(value: T): void;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Computed (derived) signal — always read-only, value is derived from
|
|
158
|
-
* other signals automatically.
|
|
159
|
-
*/
|
|
160
|
-
interface ComputedSignalTrait<T> extends ReadableSignalTrait<T> {}
|
|
161
|
-
//#endregion
|
|
162
133
|
//#region src/scheduling/helpers.d.ts
|
|
163
134
|
/** Subscription handle returned by input-source adapters. */
|
|
164
135
|
interface Subscription {
|
|
@@ -364,5 +335,5 @@ interface FetchTransportOptions {
|
|
|
364
335
|
*/
|
|
365
336
|
declare function createFetchTransport(options?: FetchTransportOptions): HttpTransport;
|
|
366
337
|
//#endregion
|
|
367
|
-
export {
|
|
368
|
-
//# sourceMappingURL=fetch-transport-
|
|
338
|
+
export { OperationTraceEventType as A, CancelableHandle as C, LogLevel as D, LogEntry as E, CancellationTokenSourceTrait as F, CancellationTokenTrait as I, DisposableTrait as L, TraceEvent as M, TraceEventSinkTrait as N, LoggerTrait as O, CancelableHandle$1 as P, HttpTransport as S, Scheduler as T, scheduleAt as _, FromPromiseOptions as a, HttpRequest as b, PromiseSettlement as c, Subscription as d, TimerOptions as f, interval as g, fromSignal as h, FromEventPatternOptions as i, OperationTracerTrait as j, OperationScope as k, PromiseSettlementKind as l, fromPromise as m, FetchTransportRedirectKind as n, FromSignalOptions as o, fromEventPattern as p, createFetchTransport as r, IntervalOptions as s, FetchTransportOptions as t, ScheduleAtOptions as u, timer as v, Clock as w, HttpResponse as x, ClientRuntime as y };
|
|
339
|
+
//# sourceMappingURL=fetch-transport-Bd5RyWj2.d.mts.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { n as ReadableSignalTrait } from "./types-DQc088ZP.mjs";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
|
|
4
|
+
//#region src/events/types.d.ts
|
|
5
|
+
/** Subscription handle with explicit unsubscribe. */
|
|
6
|
+
interface EventSubscriptionTrait {
|
|
7
|
+
unsubscribe(): void;
|
|
8
|
+
}
|
|
9
|
+
/** Observer for event streams — mirrors the Observable observer pattern. */
|
|
10
|
+
interface EventObserver<T> {
|
|
11
|
+
next?(value: T): void;
|
|
12
|
+
error?(error: unknown): void;
|
|
13
|
+
complete?(): void;
|
|
14
|
+
}
|
|
15
|
+
/** Read-only event stream — lazy push-based sequence. */
|
|
16
|
+
interface EventStreamTrait<T> {
|
|
17
|
+
subscribe(observer: EventObserver<T>): EventSubscriptionTrait;
|
|
18
|
+
}
|
|
19
|
+
/** Hot event producer. */
|
|
20
|
+
interface SubjectTrait<T> extends EventStreamTrait<T> {
|
|
21
|
+
next(value: T): void;
|
|
22
|
+
error(error: unknown): void;
|
|
23
|
+
complete(): void;
|
|
24
|
+
}
|
|
25
|
+
/** Hot event producer that replays recent values to late subscribers. */
|
|
26
|
+
interface ReplaySubjectTrait<T> extends SubjectTrait<T> {
|
|
27
|
+
readonly bufferSize: number;
|
|
28
|
+
}
|
|
29
|
+
declare const EventSourceKind: {
|
|
30
|
+
readonly User: "user";
|
|
31
|
+
readonly Timer: "timer";
|
|
32
|
+
readonly Http: "http";
|
|
33
|
+
readonly Storage: "storage";
|
|
34
|
+
readonly Framework: "framework";
|
|
35
|
+
readonly System: "system";
|
|
36
|
+
};
|
|
37
|
+
type EventSourceKind = (typeof EventSourceKind)[keyof typeof EventSourceKind];
|
|
38
|
+
type EventSource = {
|
|
39
|
+
kind: typeof EventSourceKind.User;
|
|
40
|
+
actor?: string;
|
|
41
|
+
} | {
|
|
42
|
+
kind: typeof EventSourceKind.Timer;
|
|
43
|
+
timer: string;
|
|
44
|
+
} | {
|
|
45
|
+
kind: typeof EventSourceKind.Http;
|
|
46
|
+
requestId: string;
|
|
47
|
+
endpoint?: string;
|
|
48
|
+
} | {
|
|
49
|
+
kind: typeof EventSourceKind.Storage;
|
|
50
|
+
operation: string;
|
|
51
|
+
} | {
|
|
52
|
+
kind: typeof EventSourceKind.Framework;
|
|
53
|
+
name: string;
|
|
54
|
+
} | {
|
|
55
|
+
kind: typeof EventSourceKind.System;
|
|
56
|
+
subsystem: string;
|
|
57
|
+
};
|
|
58
|
+
interface RuntimeEventEnvelope<TType extends string, TPayload> {
|
|
59
|
+
id: string;
|
|
60
|
+
type: TType;
|
|
61
|
+
at: number;
|
|
62
|
+
source: EventSource;
|
|
63
|
+
payload: TPayload;
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/events/event-stream.d.ts
|
|
67
|
+
/**
|
|
68
|
+
* Create a new event stream from a producer function.
|
|
69
|
+
*
|
|
70
|
+
* The producer receives an observer and should call `next()` to emit values,
|
|
71
|
+
* `error()` to signal an error, and `complete()` to signal completion.
|
|
72
|
+
* It may return a teardown function that will be called on unsubscribe.
|
|
73
|
+
*/
|
|
74
|
+
declare function createEventStream<T>(producer: (observer: EventObserver<T>) => (() => void) | void): EventStreamTrait<T>;
|
|
75
|
+
declare function createSubject<T>(): SubjectTrait<T>;
|
|
76
|
+
declare function createReplaySubject<T>(bufferSize?: number): ReplaySubjectTrait<T>;
|
|
77
|
+
declare function toRxObservable<T>(stream: EventStreamTrait<T>): Observable<T>;
|
|
78
|
+
declare function fromRxObservable<T>(observable: Observable<T>): EventStreamTrait<T>;
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/events/operators.d.ts
|
|
81
|
+
type EventOperator<A, B> = (source: EventStreamTrait<A>) => EventStreamTrait<B>;
|
|
82
|
+
declare function pipe<A>(source: EventStreamTrait<A>): EventStreamTrait<A>;
|
|
83
|
+
declare function pipe<A, B>(source: EventStreamTrait<A>, op1: EventOperator<A, B>): EventStreamTrait<B>;
|
|
84
|
+
declare function pipe<A, B, C>(source: EventStreamTrait<A>, op1: EventOperator<A, B>, op2: EventOperator<B, C>): EventStreamTrait<C>;
|
|
85
|
+
declare function pipe<A, B, C, D>(source: EventStreamTrait<A>, op1: EventOperator<A, B>, op2: EventOperator<B, C>, op3: EventOperator<C, D>): EventStreamTrait<D>;
|
|
86
|
+
declare function map<A, B>(fn: (value: A) => B): EventOperator<A, B>;
|
|
87
|
+
declare function filter<A>(predicate: (value: A) => boolean): EventOperator<A, A>;
|
|
88
|
+
declare function tap<A>(fn: (value: A) => void): EventOperator<A, A>;
|
|
89
|
+
declare function takeUntil<A>(notifier: EventStreamTrait<unknown>): EventOperator<A, A>;
|
|
90
|
+
declare function finalize<A>(fn: () => void): EventOperator<A, A>;
|
|
91
|
+
declare function merge$1<A>(...sources: EventStreamTrait<A>[]): EventStreamTrait<A>;
|
|
92
|
+
declare function share<A>(): EventOperator<A, A>;
|
|
93
|
+
declare function shareReplay<A>(bufferSize?: number): EventOperator<A, A>;
|
|
94
|
+
declare function switchMap<A, B>(fn: (value: A) => EventStreamTrait<B>): EventOperator<A, B>;
|
|
95
|
+
declare function concatMap<A, B>(fn: (value: A) => EventStreamTrait<B>): EventOperator<A, B>;
|
|
96
|
+
declare function exhaustMap<A, B>(fn: (value: A) => EventStreamTrait<B>): EventOperator<A, B>;
|
|
97
|
+
declare function debounceTime<A>(durationMs: number): EventOperator<A, A>;
|
|
98
|
+
declare function throttleTime<A>(durationMs: number): EventOperator<A, A>;
|
|
99
|
+
declare function withLatestFromSignal<A, B>(signal: ReadableSignalTrait<B>): EventOperator<A, [A, B]>;
|
|
100
|
+
//#endregion
|
|
101
|
+
export { EventSource as C, ReplaySubjectTrait as D, EventSubscriptionTrait as E, RuntimeEventEnvelope as O, EventObserver as S, EventStreamTrait as T, createEventStream as _, filter as a, fromRxObservable as b, merge$1 as c, shareReplay as d, switchMap as f, withLatestFromSignal as g, throttleTime as h, exhaustMap as i, SubjectTrait as k, pipe as l, tap as m, concatMap as n, finalize as o, takeUntil as p, debounceTime as r, map as s, EventOperator as t, share as u, createReplaySubject as v, EventSourceKind as w, toRxObservable as x, createSubject as y };
|
|
102
|
+
//# sourceMappingURL=index-C_wgl6dW.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as RecordStore, n as EphemeralFlowStore, r as KeyedEphemeralFlowStore, t as Codec } from "./types-
|
|
1
|
+
import { a as RecordStore, n as EphemeralFlowStore, r as KeyedEphemeralFlowStore, t as Codec } from "./types-C59fcM5W.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/persistence/ephemeral-flow-store.d.ts
|
|
4
4
|
interface CreateEphemeralFlowStoreOptions<T> {
|
|
@@ -36,4 +36,4 @@ declare function createJsonCodec<T>(): Codec<T>;
|
|
|
36
36
|
declare function createInMemoryRecordStore(): RecordStore;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { createEphemeralFlowStore as a, CreateKeyedEphemeralFlowStoreOptions as i, createJsonCodec as n, createKeyedEphemeralFlowStore as o, CreateEphemeralFlowStoreOptions as r, createInMemoryRecordStore as t };
|
|
39
|
-
//# sourceMappingURL=index-
|
|
39
|
+
//# sourceMappingURL=index-DbYSFHDe.d.mts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
1
|
+
import { C as EventSource, D as ReplaySubjectTrait, E as EventSubscriptionTrait, O as RuntimeEventEnvelope, S as EventObserver, T as EventStreamTrait, _ as createEventStream, a as filter, b as fromRxObservable, c as merge, d as shareReplay, f as switchMap, g as withLatestFromSignal, h as throttleTime, i as exhaustMap, k as SubjectTrait, l as pipe, m as tap, n as concatMap, o as finalize, p as takeUntil, r as debounceTime, s as map, t as EventOperator, u as share, v as createReplaySubject, w as EventSourceKind, x as toRxObservable, y as createSubject } from "./index-C_wgl6dW.mjs";
|
|
2
|
+
import { n as ReadableSignalTrait, r as WritableSignalTrait, t as ComputedSignalTrait } from "./types-DQc088ZP.mjs";
|
|
3
|
+
import { A as OperationTraceEventType, C as CancelableHandle$1, D as LogLevel, E as LogEntry, F as CancellationTokenSourceTrait, I as CancellationTokenTrait, L as DisposableTrait, M as TraceEvent, N as TraceEventSinkTrait, O as LoggerTrait, P as CancelableHandle, S as HttpTransport, T as Scheduler, _ as scheduleAt, a as FromPromiseOptions, b as HttpRequest, c as PromiseSettlement, d as Subscription, f as TimerOptions, g as interval, h as fromSignal, i as FromEventPatternOptions, j as OperationTracerTrait, k as OperationScope, l as PromiseSettlementKind, m as fromPromise, n as FetchTransportRedirectKind, o as FromSignalOptions, p as fromEventPattern, s as IntervalOptions, u as ScheduleAtOptions, v as timer, w as Clock, x as HttpResponse, y as ClientRuntime } from "./fetch-transport-Bd5RyWj2.mjs";
|
|
4
|
+
import { a as RecordStore, i as PersistentAuthStore, n as EphemeralFlowStore, o as RecoverableStateStore, r as KeyedEphemeralFlowStore, s as StoredEnvelope, t as Codec } from "./types-C59fcM5W.mjs";
|
|
5
|
+
import { a as createEphemeralFlowStore, n as createJsonCodec, o as createKeyedEphemeralFlowStore, t as createInMemoryRecordStore } from "./index-DbYSFHDe.mjs";
|
|
4
6
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
7
|
|
|
8
|
+
//#region src/signals/computed.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Create a computed signal that derives its value from other signals.
|
|
11
|
+
*
|
|
12
|
+
* Semantics: lazy + cached.
|
|
13
|
+
* - The compute function is NOT called at construction time.
|
|
14
|
+
* - `get()` recomputes only when dirty (a dependency changed since last read).
|
|
15
|
+
* - Subscribers are notified only when a dependency changes (dirty-flagged),
|
|
16
|
+
* and the next `get()` will produce the fresh value.
|
|
17
|
+
*
|
|
18
|
+
* Dependency subscriptions are permanent for the lifetime of the computed signal.
|
|
19
|
+
*/
|
|
20
|
+
declare function createComputed<T>(compute: () => T, deps: ReadableSignalTrait<unknown>[]): ComputedSignalTrait<T>;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/signals/signal.d.ts
|
|
23
|
+
/**
|
|
24
|
+
* Minimal writable signal implementation.
|
|
25
|
+
* Snapshot-first: values are immutable snapshots, mutations go through `set()`.
|
|
26
|
+
*/
|
|
27
|
+
declare function createSignal<T>(initial: T): WritableSignalTrait<T>;
|
|
28
|
+
/**
|
|
29
|
+
* Create a read-only view of a writable signal.
|
|
30
|
+
*/
|
|
31
|
+
declare function readonlySignal<T>(signal: WritableSignalTrait<T>): ReadableSignalTrait<T>;
|
|
32
|
+
//#endregion
|
|
6
33
|
//#region src/cancellation/cancellation-token.d.ts
|
|
7
34
|
/**
|
|
8
35
|
* Create a `CancellationTokenSource` that produces a cooperative cancellation token.
|
|
@@ -156,81 +183,6 @@ declare class ClientError extends Error {
|
|
|
156
183
|
//#region src/errors/presentation-descriptor.d.ts
|
|
157
184
|
declare function readErrorPresentationDescriptor(error: unknown, options?: ReadErrorPresentationDescriptorOptions): ErrorPresentationDescriptor;
|
|
158
185
|
//#endregion
|
|
159
|
-
//#region src/events/types.d.ts
|
|
160
|
-
/** Subscription handle with explicit unsubscribe. */
|
|
161
|
-
interface EventSubscriptionTrait {
|
|
162
|
-
unsubscribe(): void;
|
|
163
|
-
}
|
|
164
|
-
/** Observer for event streams — mirrors the Observable observer pattern. */
|
|
165
|
-
interface EventObserver<T> {
|
|
166
|
-
next?(value: T): void;
|
|
167
|
-
error?(error: unknown): void;
|
|
168
|
-
complete?(): void;
|
|
169
|
-
}
|
|
170
|
-
/** Read-only event stream — lazy push-based sequence. */
|
|
171
|
-
interface EventStreamTrait<T> {
|
|
172
|
-
subscribe(observer: EventObserver<T>): EventSubscriptionTrait;
|
|
173
|
-
}
|
|
174
|
-
declare const EventSourceKind: {
|
|
175
|
-
readonly User: "user";
|
|
176
|
-
readonly Timer: "timer";
|
|
177
|
-
readonly Http: "http";
|
|
178
|
-
readonly Storage: "storage";
|
|
179
|
-
readonly Framework: "framework";
|
|
180
|
-
readonly System: "system";
|
|
181
|
-
};
|
|
182
|
-
type EventSourceKind = (typeof EventSourceKind)[keyof typeof EventSourceKind];
|
|
183
|
-
type EventSource = {
|
|
184
|
-
kind: typeof EventSourceKind.User;
|
|
185
|
-
actor?: string;
|
|
186
|
-
} | {
|
|
187
|
-
kind: typeof EventSourceKind.Timer;
|
|
188
|
-
timer: string;
|
|
189
|
-
} | {
|
|
190
|
-
kind: typeof EventSourceKind.Http;
|
|
191
|
-
requestId: string;
|
|
192
|
-
endpoint?: string;
|
|
193
|
-
} | {
|
|
194
|
-
kind: typeof EventSourceKind.Storage;
|
|
195
|
-
operation: string;
|
|
196
|
-
} | {
|
|
197
|
-
kind: typeof EventSourceKind.Framework;
|
|
198
|
-
name: string;
|
|
199
|
-
} | {
|
|
200
|
-
kind: typeof EventSourceKind.System;
|
|
201
|
-
subsystem: string;
|
|
202
|
-
};
|
|
203
|
-
interface RuntimeEventEnvelope<TType extends string, TPayload> {
|
|
204
|
-
id: string;
|
|
205
|
-
type: TType;
|
|
206
|
-
at: number;
|
|
207
|
-
source: EventSource;
|
|
208
|
-
payload: TPayload;
|
|
209
|
-
}
|
|
210
|
-
//#endregion
|
|
211
|
-
//#region src/events/event-stream.d.ts
|
|
212
|
-
/**
|
|
213
|
-
* Create a new event stream from a producer function.
|
|
214
|
-
*
|
|
215
|
-
* The producer receives an observer and should call `next()` to emit values,
|
|
216
|
-
* `error()` to signal an error, and `complete()` to signal completion.
|
|
217
|
-
* It may return a teardown function that will be called on unsubscribe.
|
|
218
|
-
*/
|
|
219
|
-
declare function createEventStream<T>(producer: (observer: EventObserver<T>) => (() => void) | void): EventStreamTrait<T>;
|
|
220
|
-
//#endregion
|
|
221
|
-
//#region src/events/operators.d.ts
|
|
222
|
-
type EventOperator<A, B> = (source: EventStreamTrait<A>) => EventStreamTrait<B>;
|
|
223
|
-
declare function pipe<A>(source: EventStreamTrait<A>): EventStreamTrait<A>;
|
|
224
|
-
declare function pipe<A, B>(source: EventStreamTrait<A>, op1: EventOperator<A, B>): EventStreamTrait<B>;
|
|
225
|
-
declare function pipe<A, B, C>(source: EventStreamTrait<A>, op1: EventOperator<A, B>, op2: EventOperator<B, C>): EventStreamTrait<C>;
|
|
226
|
-
declare function pipe<A, B, C, D>(source: EventStreamTrait<A>, op1: EventOperator<A, B>, op2: EventOperator<B, C>, op3: EventOperator<C, D>): EventStreamTrait<D>;
|
|
227
|
-
declare function map<A, B>(fn: (value: A) => B): EventOperator<A, B>;
|
|
228
|
-
declare function filter<A>(predicate: (value: A) => boolean): EventOperator<A, A>;
|
|
229
|
-
declare function tap<A>(fn: (value: A) => void): EventOperator<A, A>;
|
|
230
|
-
declare function takeUntil<A>(notifier: EventStreamTrait<unknown>): EventOperator<A, A>;
|
|
231
|
-
declare function finalize<A>(fn: () => void): EventOperator<A, A>;
|
|
232
|
-
declare function merge<A>(...sources: EventStreamTrait<A>[]): EventStreamTrait<A>;
|
|
233
|
-
//#endregion
|
|
234
186
|
//#region src/identity/principal.d.ts
|
|
235
187
|
interface AuthenticatedPrincipal {
|
|
236
188
|
subject: string;
|
|
@@ -304,31 +256,6 @@ declare function createDefaultClock(): Clock;
|
|
|
304
256
|
/** Default scheduler backed by platform `setTimeout`. */
|
|
305
257
|
declare function createDefaultScheduler(): Scheduler;
|
|
306
258
|
//#endregion
|
|
307
|
-
//#region src/signals/computed.d.ts
|
|
308
|
-
/**
|
|
309
|
-
* Create a computed signal that derives its value from other signals.
|
|
310
|
-
*
|
|
311
|
-
* Semantics: lazy + cached.
|
|
312
|
-
* - The compute function is NOT called at construction time.
|
|
313
|
-
* - `get()` recomputes only when dirty (a dependency changed since last read).
|
|
314
|
-
* - Subscribers are notified only when a dependency changes (dirty-flagged),
|
|
315
|
-
* and the next `get()` will produce the fresh value.
|
|
316
|
-
*
|
|
317
|
-
* Dependency subscriptions are permanent for the lifetime of the computed signal.
|
|
318
|
-
*/
|
|
319
|
-
declare function createComputed<T>(compute: () => T, deps: ReadableSignalTrait<unknown>[]): ComputedSignalTrait<T>;
|
|
320
|
-
//#endregion
|
|
321
|
-
//#region src/signals/signal.d.ts
|
|
322
|
-
/**
|
|
323
|
-
* Minimal writable signal implementation.
|
|
324
|
-
* Snapshot-first: values are immutable snapshots, mutations go through `set()`.
|
|
325
|
-
*/
|
|
326
|
-
declare function createSignal<T>(initial: T): WritableSignalTrait<T>;
|
|
327
|
-
/**
|
|
328
|
-
* Create a read-only view of a writable signal.
|
|
329
|
-
*/
|
|
330
|
-
declare function readonlySignal<T>(signal: WritableSignalTrait<T>): ReadableSignalTrait<T>;
|
|
331
|
-
//#endregion
|
|
332
259
|
//#region src/validation/index.d.ts
|
|
333
260
|
/**
|
|
334
261
|
* Successful validation result.
|
|
@@ -422,5 +349,5 @@ interface CreateSchemaOptions<O> {
|
|
|
422
349
|
*/
|
|
423
350
|
declare function createSchema<O>(options: CreateSchemaOptions<O>): StandardSchemaV1<unknown, O>;
|
|
424
351
|
//#endregion
|
|
425
|
-
export { type AuthenticatedPrincipal, type CancelableHandle, type CancellationTokenSourceTrait, type CancellationTokenTrait, ClientError, ClientErrorKind, ClientErrorSource, type ClientRuntime, type Clock, type Codec, type ComputedSignalTrait, type CreateOperationTracerOptions, type CreateRuntimeOptions, type DisposableTrait, type EphemeralFlowStore, type ErrorPresentation, type ErrorPresentationActionDescriptor, type ErrorPresentationDescriptor, ErrorPresentationTone, type EventObserver, type EventOperator, type EventSource, EventSourceKind, type EventStreamTrait, type EventSubscriptionTrait, FetchTransportRedirectKind, type FromEventPatternOptions, type FromPromiseOptions, type FromSignalOptions, type HttpRequest, type HttpResponse, type HttpTransport, type IntervalOptions, type KeyedEphemeralFlowStore, type LogEntry, LogLevel, type LoggerTrait, type OperationScope, OperationTraceEventType, type OperationTracerTrait, type PersistentAuthStore, type ProjectAuthenticatedPrincipalOptions, type PromiseSettlement, PromiseSettlementKind, type ReadErrorPresentationDescriptorOptions, type ReadableSignalTrait, type RecordStore, type RecoverableStateStore, type RuntimeEventEnvelope, type ScheduleAtOptions, type Scheduler, type CancelableHandle$1 as SchedulerCancelableHandle, type StoredEnvelope, type Subscription, type TimerOptions, type TraceEvent, type TraceEventSinkTrait, type TraceTimelineEntry, type TraceTimelineStore, UserRecovery, type ValidationFailure, type ValidationResult, type ValidationSuccess, type WritableSignalTrait, createCancellationTokenSource, createComputed, createConsoleLogger, createDefaultClock, createDefaultScheduler, createEphemeralFlowStore, createEventStream, createInMemoryRecordStore, createJsonCodec, createKeyedEphemeralFlowStore, createLinkedCancellationToken, createNoopLogger, createOperationTracer, createRuntime, createSchema, createSignal, createTraceTimelineStore, filter, finalize, fromEventPattern, fromPromise, fromSignal, interval, map, merge, normalizeAuthenticatedPrincipal, normalizeAuthenticatedPrincipalWire, pipe, projectAuthenticatedPrincipal, readErrorPresentationDescriptor, readonlySignal, scheduleAt, takeUntil, tap, timer, validateWithSchema, validateWithSchemaSync };
|
|
352
|
+
export { type AuthenticatedPrincipal, type CancelableHandle, type CancellationTokenSourceTrait, type CancellationTokenTrait, ClientError, ClientErrorKind, ClientErrorSource, type ClientRuntime, type Clock, type Codec, type ComputedSignalTrait, type CreateOperationTracerOptions, type CreateRuntimeOptions, type DisposableTrait, type EphemeralFlowStore, type ErrorPresentation, type ErrorPresentationActionDescriptor, type ErrorPresentationDescriptor, ErrorPresentationTone, type EventObserver, type EventOperator, type EventSource, EventSourceKind, type EventStreamTrait, type EventSubscriptionTrait, FetchTransportRedirectKind, type FromEventPatternOptions, type FromPromiseOptions, type FromSignalOptions, type HttpRequest, type HttpResponse, type HttpTransport, type IntervalOptions, type KeyedEphemeralFlowStore, type LogEntry, LogLevel, type LoggerTrait, type OperationScope, OperationTraceEventType, type OperationTracerTrait, type PersistentAuthStore, type ProjectAuthenticatedPrincipalOptions, type PromiseSettlement, PromiseSettlementKind, type ReadErrorPresentationDescriptorOptions, type ReadableSignalTrait, type RecordStore, type RecoverableStateStore, type ReplaySubjectTrait, type RuntimeEventEnvelope, type ScheduleAtOptions, type Scheduler, type CancelableHandle$1 as SchedulerCancelableHandle, type StoredEnvelope, type SubjectTrait, type Subscription, type TimerOptions, type TraceEvent, type TraceEventSinkTrait, type TraceTimelineEntry, type TraceTimelineStore, UserRecovery, type ValidationFailure, type ValidationResult, type ValidationSuccess, type WritableSignalTrait, concatMap, createCancellationTokenSource, createComputed, createConsoleLogger, createDefaultClock, createDefaultScheduler, createEphemeralFlowStore, createEventStream, createInMemoryRecordStore, createJsonCodec, createKeyedEphemeralFlowStore, createLinkedCancellationToken, createNoopLogger, createOperationTracer, createReplaySubject, createRuntime, createSchema, createSignal, createSubject, createTraceTimelineStore, debounceTime, exhaustMap, filter, finalize, fromEventPattern, fromPromise, fromRxObservable, fromSignal, interval, map, merge, normalizeAuthenticatedPrincipal, normalizeAuthenticatedPrincipalWire, pipe, projectAuthenticatedPrincipal, readErrorPresentationDescriptor, readonlySignal, scheduleAt, share, shareReplay, switchMap, takeUntil, tap, throttleTime, timer, toRxObservable, validateWithSchema, validateWithSchemaSync, withLatestFromSignal };
|
|
426
353
|
//# sourceMappingURL=index.d.mts.map
|