@but212/atom-effect 0.31.0 → 0.32.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.
Files changed (42) hide show
  1. package/README.md +21 -11
  2. package/dist/atom-effect.min.js +1 -1
  3. package/dist/atom-effect.min.js.map +1 -1
  4. package/dist/constants.d.ts +157 -0
  5. package/dist/constants.d.ts.map +1 -0
  6. package/dist/core/atom.d.ts +19 -0
  7. package/dist/core/atom.d.ts.map +1 -0
  8. package/dist/core/base.d.ts +136 -0
  9. package/dist/core/base.d.ts.map +1 -0
  10. package/dist/core/buffers.d.ts +113 -0
  11. package/dist/core/buffers.d.ts.map +1 -0
  12. package/dist/core/computed.d.ts +84 -0
  13. package/dist/core/computed.d.ts.map +1 -0
  14. package/dist/core/effect.d.ts +52 -0
  15. package/dist/core/effect.d.ts.map +1 -0
  16. package/dist/core/index.d.ts +8 -0
  17. package/dist/core/index.d.ts.map +1 -0
  18. package/dist/core/lens.d.ts +102 -0
  19. package/dist/core/lens.d.ts.map +1 -0
  20. package/dist/core/scheduler.d.ts +145 -0
  21. package/dist/core/scheduler.d.ts.map +1 -0
  22. package/dist/core/tracking.d.ts +123 -0
  23. package/dist/core/tracking.d.ts.map +1 -0
  24. package/dist/errors.d.ts +163 -0
  25. package/dist/errors.d.ts.map +1 -0
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.ts +8 -488
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.mjs +1053 -937
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/symbols.d.ts +30 -0
  33. package/dist/symbols.d.ts.map +1 -0
  34. package/dist/types.d.ts +259 -0
  35. package/dist/types.d.ts.map +1 -0
  36. package/dist/utils/debug.d.ts +20 -0
  37. package/dist/utils/debug.d.ts.map +1 -0
  38. package/dist/utils/index.d.ts +13 -0
  39. package/dist/utils/index.d.ts.map +1 -0
  40. package/dist/utils/type-guards.d.ts +81 -0
  41. package/dist/utils/type-guards.d.ts.map +1 -0
  42. package/package.json +14 -13
@@ -0,0 +1,102 @@
1
+ import { Equal, MergedDependencyValue, WritableAtom } from '../types';
2
+ /**
3
+ * Logic: Numeric Key Conversion
4
+ * Casts numeric string literals to numbers for correct array index typing.
5
+ */
6
+ export type StringKeyToNumber<S extends string> = S extends `${infer N extends number}` ? N : S;
7
+ /**
8
+ * Logic: Broad Index Detection
9
+ * Detects if a type has a broad string indexer (e.g., Record<string, any>).
10
+ */
11
+ export type HasBroadStringKey<T> = string extends keyof T ? true : false;
12
+ /** @public */
13
+ export type StringIndexValue<T> = T extends Record<string, infer V> ? V : never;
14
+ /** @public */
15
+ export type ArrayElement<T> = T extends readonly (infer U)[] ? U : never;
16
+ /**
17
+ * Constraint: Depth limit for recursive path generation to prevent TypeScript
18
+ * recursion errors and IDE lag in complex schemas.
19
+ */
20
+ export type MaxDepth = 8;
21
+ /**
22
+ * Logic: Recursion Termination
23
+ * Types that stop the recursive path exploration.
24
+ */
25
+ export type TerminalTypes = Date | RegExp | Map<unknown, unknown> | Set<unknown> | Promise<unknown> | Function;
26
+ /**
27
+ * Computes a union of all valid dot-separated paths for type T.
28
+ *
29
+ * Constraint: If T has a broad string indexer, it returns `string` to avoid
30
+ * infinite union generation.
31
+ */
32
+ export type Paths<T, D extends unknown[] = []> = Equal<T, any> extends true ? string : D['length'] extends MaxDepth ? never : T extends TerminalTypes ? never : T extends readonly unknown[] ? NonNullable<ArrayElement<T>> extends object ? `${number}` | `${number}.${Paths<NonNullable<ArrayElement<T>>, [...D, 1]>}` : `${number}` : T extends object ? HasBroadStringKey<T> extends true ? string : {
33
+ [K in keyof T & (string | number)]: T[K] extends Function ? never : NonNullable<T[K]> extends object ? `${K}` | `${K}.${Paths<NonNullable<T[K]>, [...D, 1]>}` : `${K}`;
34
+ }[keyof T & (string | number)] : never;
35
+ /**
36
+ * Resolves the type of a value at a given dot-path string.
37
+ */
38
+ export type PathValue<T, P extends string> = Equal<T, any> extends true ? any : P extends `${infer K}.${infer Rest}` ? NonNullable<T> extends readonly unknown[] ? K extends `${number}` ? PathValue<NonNullable<ArrayElement<NonNullable<T>>>, Rest> : never : HasBroadStringKey<NonNullable<T>> extends true ? PathValue<NonNullable<StringIndexValue<NonNullable<T>>>, Rest> : StringKeyToNumber<K> extends keyof NonNullable<T> ? PathValue<NonNullable<NonNullable<T>[StringKeyToNumber<K> & keyof NonNullable<T>]>, Rest> : never : NonNullable<T> extends readonly unknown[] ? P extends `${number}` ? NonNullable<ArrayElement<NonNullable<T>>> : never : HasBroadStringKey<NonNullable<T>> extends true ? NonNullable<StringIndexValue<NonNullable<T>>> : StringKeyToNumber<P> extends keyof NonNullable<T> ? NonNullable<T>[StringKeyToNumber<P> & keyof NonNullable<T>] : never;
39
+ /**
40
+ * Core engine for recursive immutable deep updates.
41
+ *
42
+ * Optimization: Net-zero suppression
43
+ * Returns the original object if the leaf value is identical (Object.is),
44
+ * preventing unnecessary allocation and downstream notifications.
45
+ *
46
+ * @internal
47
+ */
48
+ export declare function setDeepValue(obj: unknown, keys: string[], index: number, value: unknown): unknown;
49
+ /**
50
+ * Reads a value from a nested path.
51
+ * Supports standard property access and Map.get().
52
+ *
53
+ * @internal
54
+ */
55
+ export declare function getPathValue(source: unknown, parts: string[]): unknown;
56
+ /**
57
+ * Creates a reactive, two-way Lens into a nested atom property.
58
+ *
59
+ * When to use:
60
+ * - When a component only needs a specific sub-field of a complex state object.
61
+ * - To implement "noise filtering": the lens only notifies subscribers if its
62
+ * specific nested value changes, even if other parts of the root atom update.
63
+ * - For type-safe deep state management.
64
+ *
65
+ * @param atom - The root WritableAtom to project from.
66
+ * @param path - A dot-separated string representing the path to the nested property.
67
+ *
68
+ * @example
69
+ * const user = atom({ profile: { name: 'Alice', score: 10 } });
70
+ * const scoreLens = atomLens(user, 'profile.score');
71
+ *
72
+ * $.effect(() => console.log('Score:', scoreLens.value));
73
+ * scoreLens.value = 20; // Propagates to 'user' atom.
74
+ */
75
+ export declare function atomLens<T extends object, P extends Paths<T>>(atom: WritableAtom<T>, path: P): WritableAtom<PathValue<T, P>>;
76
+ /**
77
+ * Chains a lens with a further sub-path to create a more specific lens.
78
+ *
79
+ * @example
80
+ * const userLens = atomLens(rootAtom, 'user');
81
+ * const nameLens = composeLens(userLens, 'name');
82
+ */
83
+ export declare const composeLens: <T extends object, P extends Paths<T>>(lens: WritableAtom<T>, path: P) => WritableAtom<PathValue<T, P>>;
84
+ /**
85
+ * Creates a factory function for generating multiple lenses from a single root atom.
86
+ *
87
+ * @example
88
+ * const fromUser = lensFor(userAtom);
89
+ * const nameLens = fromUser('name');
90
+ * const ageLens = fromUser('age');
91
+ */
92
+ export declare const lensFor: <T extends object>(atom: WritableAtom<T>) => <P extends Paths<T>>(path: P) => WritableAtom<PathValue<T, P>>;
93
+ /**
94
+ * Merges multiple writable lenses into a single unified lens with a flattened type.
95
+ *
96
+ * This utility combines the value types of all input lenses into a single
97
+ * unified object type using the {@link Merge} utility.
98
+ *
99
+ * @param lenses - A variadic list of WritableAtoms (lenses).
100
+ */
101
+ export declare function mergeLenses<L extends WritableAtom<unknown>[]>(...lenses: L): WritableAtom<MergedDependencyValue<L>>;
102
+ //# sourceMappingURL=lens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lens.d.ts","sourceRoot":"","sources":["../../src/core/lens.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI1E;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;AAEhG;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,MAAM,SAAS,MAAM,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAEzE,cAAc;AACd,MAAM,MAAM,gBAA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CAAC;AAEzB;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,YAAY,CAAC,OAAO,CAAC,EAAE,EAC3D,GAAG,MAAM,EAAE,CAAC,GACX,YAAY,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAsDxC"}
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Generates the next version number for stateful objects (Atoms).
3
+ */
4
+ export declare function nextVersion(v: number): number;
5
+ export interface SchedulerJobObject {
6
+ execute(): void;
7
+ /** Internal epoch tracking to prevent redundant scheduling in a single cycle. @internal */
8
+ _nextEpoch?: number | undefined;
9
+ }
10
+ export interface SchedulerJobFunction {
11
+ (): void;
12
+ /** Internal epoch tracking to prevent redundant scheduling in a single cycle. @internal */
13
+ _nextEpoch?: number | undefined;
14
+ }
15
+ export type SchedulerJob = SchedulerJobFunction | SchedulerJobObject;
16
+ /**
17
+ * Internal state for the scheduler.
18
+ * @internal
19
+ */
20
+ export interface SchedulerState {
21
+ size: number;
22
+ epoch: number;
23
+ batchQueueSize: number;
24
+ state: number;
25
+ batchDepth: number;
26
+ maxFlushIterations: number;
27
+ sessionActive: boolean;
28
+ sessionEpoch: number;
29
+ sessionExecutionCount: number;
30
+ /** Primary queue for the current flush cycle. */
31
+ activeBuffer: (SchedulerJob | undefined)[];
32
+ /** Secondary queue to collect new jobs scheduled during the current flush. */
33
+ standbyBuffer: (SchedulerJob | undefined)[];
34
+ /** Queue for jobs scheduled during a batch session. */
35
+ batchBuffer: (SchedulerJob | undefined)[];
36
+ onOverflow: ((droppedCount: number) => void) | null;
37
+ }
38
+ /**
39
+ * Factory for scheduler state.
40
+ * @internal
41
+ */
42
+ export declare function createSchedulerState(): SchedulerState;
43
+ /**
44
+ * Logic: Batch Queue Consolidation
45
+ * Moves jobs from the batch buffer to the active execution queue.
46
+ * @internal
47
+ */
48
+ export declare function schedulerMergeBatchQueue(state: SchedulerState, nextEpoch: () => number): void;
49
+ /**
50
+ * Logic: Recursive Queue Drainage
51
+ * Continuously flushes the queues until no more jobs are pending.
52
+ *
53
+ * Caution: Subject to maxFlushIterations to prevent infinite loops from circular dependencies.
54
+ * @internal
55
+ */
56
+ export declare function schedulerDrainQueue(state: SchedulerState, nextEpoch: () => number, processQueue: (state: SchedulerState) => void, handleOverflow: (state: SchedulerState) => void): void;
57
+ /**
58
+ * Logic: Double-Buffering Job Execution
59
+ * Swaps active/standby buffers to allow safe scheduling during execution.
60
+ * @internal
61
+ */
62
+ export declare function schedulerProcessQueue(state: SchedulerState, nextEpoch: () => number): void;
63
+ /**
64
+ * Logic: Overflow Recovery
65
+ * Cleans up state when the maximum flush iterations are exceeded.
66
+ * @internal
67
+ */
68
+ export declare function schedulerHandleFlushOverflow(state: SchedulerState): void;
69
+ /** @internal */
70
+ export declare function schedulerNextEpoch(state: SchedulerState): number;
71
+ /** @internal */
72
+ export declare function schedulerStartFlush(state: SchedulerState): boolean;
73
+ /** @internal */
74
+ export declare function schedulerEndFlush(state: SchedulerState): void;
75
+ /** @internal */
76
+ export declare function schedulerIncrementFlushExecutionCount(state: SchedulerState): number;
77
+ /** @internal */
78
+ export declare function schedulerResetFlushState(state: SchedulerState): void;
79
+ /**
80
+ * Core scheduling logic. Decisions between microtask or synchronous flush are made here.
81
+ * @internal
82
+ */
83
+ export declare function schedulerSchedule(state: SchedulerState, callback: SchedulerJob): void;
84
+ /**
85
+ * Forcefully flushes all pending jobs synchronously.
86
+ * @internal
87
+ */
88
+ export declare function schedulerFlushSync(state: SchedulerState): void;
89
+ /** @internal */
90
+ export declare function schedulerStartBatch(state: SchedulerState): void;
91
+ /** @internal */
92
+ export declare function schedulerEndBatch(state: SchedulerState): void;
93
+ /** @internal */
94
+ export declare function schedulerSetMaxFlushIterations(state: SchedulerState, max: number): void;
95
+ /** @internal */
96
+ export declare function schedulerIsBatching(state: SchedulerState): boolean;
97
+ /** @internal */
98
+ export declare function schedulerQueueSize(state: SchedulerState): number;
99
+ export declare const scheduler: SchedulerState;
100
+ export declare const nextEpoch: () => number;
101
+ export declare const currentEpoch: () => number;
102
+ export declare const currentFlushEpoch: () => number;
103
+ export declare const startFlush: () => boolean;
104
+ export declare const endFlush: () => void;
105
+ export declare const incrementFlushExecutionCount: () => number;
106
+ export declare const resetFlushState: () => void;
107
+ /**
108
+ * Groups multiple state updates into a single atomic change and flushes them synchronously.
109
+ *
110
+ * When to use:
111
+ * - Ensuring that all effects triggered by state changes are executed immediately before the function returns (Synchronous Settlement).
112
+ * - Creating a transactional scope where multiple updates are treated as one unit and settled predictably.
113
+ *
114
+ * @example
115
+ * ```typescript
116
+ * batch(() => {
117
+ * atomA.set(1);
118
+ * atomB.set(2);
119
+ * });
120
+ * // At this point, all triggered effects have already finished executing.
121
+ * ```
122
+ */
123
+ export declare function batch<T>(fn: () => T): T;
124
+ /**
125
+ * Scopes a function execution within a flush lifecycle.
126
+ * Ensures the scheduler state is cleaned up even if the provided function throws.
127
+ * @internal
128
+ */
129
+ export declare function runInFlushScope<T>(fn: () => T): T | undefined;
130
+ /**
131
+ * Returns a promise that resolves after the next scheduler flush.
132
+ *
133
+ * When to use:
134
+ * - Waiting for effects to finish in tests after state updates.
135
+ * - Synchronizing logic with the reactive system's "settled" state.
136
+ *
137
+ * @example
138
+ * ```typescript
139
+ * atom.set(100);
140
+ * await aeNextTick();
141
+ * // DOM or side effects are now guaranteed to be updated.
142
+ * ```
143
+ */
144
+ export declare function aeNextTick(fn?: () => void): Promise<void>;
145
+ //# sourceMappingURL=scheduler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../src/core/scheduler.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,IAAI,IAAI,CAAC;IAChB,2FAA2F;IAC3F,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAED,MAAM,WAA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AO,MAAM,YAAY,QAAO,MAAyB,CAAC;AAC1D,eAAO,MAAM,iBAAiB,QAAO,MAAgC,CAAC;AACtE,eAAO,MAAM,UAAU,QAAO,OAAyC,CAAC;AACxE,eAAO,MAAM,QAAQ,QAAO,IAAoC,CAAC;AACjE,eAAO,MAAM,4BAA4B,QAAO,MACE,CAAC;AACnD,eAAO,MAAM,eAAe,QAAO,IAA2C,CAAC;AAE/E;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAWvC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAO7D;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBzD"}
@@ -0,0 +1,123 @@
1
+ import { Dependency, Subscriber } from '../types';
2
+ /**
3
+ * Interface for nodes capable of recording reactive dependencies during execution.
4
+ * @internal
5
+ *
6
+ * Reason: Decouples dependency collection from the specific node implementation,
7
+ * allowing any object to participate in tracking as long as it can record dependencies.
8
+ */
9
+ export interface DependencySubscriber {
10
+ addDependency(dep: Dependency): void;
11
+ }
12
+ /**
13
+ * Interface for nodes that can be scheduled for re-execution.
14
+ * @internal
15
+ *
16
+ * Reason: Provides a unified interface for the scheduler to trigger updates
17
+ * without knowing the internal logic of the node.
18
+ */
19
+ export interface ExecutableSubscriber {
20
+ execute(): void;
21
+ }
22
+ /**
23
+ * Unified interface for nodes that both consume dependencies and execute logic.
24
+ * (e.g., Effects, Computed Atoms, Observers)
25
+ * @internal
26
+ */
27
+ export interface DependencyTracker extends DependencySubscriber, ExecutableSubscriber {
28
+ }
29
+ /**
30
+ * Represents a single directed edge in the dependency graph (Subscriber -> Dependency).
31
+ * @internal
32
+ *
33
+ * Logic: Includes a version field to implement efficient stale checks.
34
+ * If the dependency's version doesn't match this version, the subscriber may need re-evaluation.
35
+ */
36
+ export interface DependencyLink {
37
+ /** The node being watched. */
38
+ node: Dependency;
39
+ /** The version of the node when this link was established. */
40
+ version: number;
41
+ /** Cleanup function returned by the dependency. */
42
+ unsub: (() => void) | undefined;
43
+ }
44
+ /** @internal */
45
+ export declare function createDependencyLink(node: Dependency, version: number, unsub?: (() => void) | undefined): DependencyLink;
46
+ /**
47
+ * A handle for an active listener on a reactive node.
48
+ * Supports both raw callbacks and internal graph subscribers.
49
+ * @internal
50
+ */
51
+ export interface Subscription<T> {
52
+ /** Raw callback for external listeners. */
53
+ fn: ((newValue?: T, oldValue?: T) => void) | undefined;
54
+ /** Internal subscriber for graph-based updates. */
55
+ sub: Subscriber | undefined;
56
+ }
57
+ /** @internal */
58
+ export declare function createSubscription<T>(fn?: ((newValue?: T, oldValue?: T) => void) | undefined, sub?: Subscriber | undefined): Subscription<T>;
59
+ /** @internal */
60
+ export declare function notifySubscription<T>(subscription: Subscription<T> | null, newValue?: T, oldValue?: T): void;
61
+ /**
62
+ * Internal state for the reactive tracking system.
63
+ * @internal
64
+ *
65
+ * Logic: Stack-based approach
66
+ * The stack enables nested tracking. When a computed atom is read inside an effect,
67
+ * the computed atom becomes the 'current' subscriber while it calculates its value,
68
+ * and the effect is restored as 'current' after the computation finishes.
69
+ */
70
+ export interface TrackingContext {
71
+ stack: (DependencySubscriber | null)[];
72
+ current: DependencySubscriber | null;
73
+ }
74
+ /** @internal */
75
+ export declare function createTrackingContext(): TrackingContext;
76
+ /** @internal */
77
+ export declare function pushTrackingSubscriber(context: TrackingContext, subscriber: DependencySubscriber | null): void;
78
+ /** @internal */
79
+ export declare function popTrackingSubscriber(context: TrackingContext): void;
80
+ /**
81
+ * Resets the tracking stack to a specific depth.
82
+ * @internal
83
+ *
84
+ * Reason: Used during error recovery or transaction rollbacks where
85
+ * the execution stack might be corrupted or partially executed.
86
+ */
87
+ export declare function rollbackTrackingSubscriber(context: TrackingContext, depth: number): void;
88
+ /**
89
+ * Executes a function within the scope of a specific subscriber.
90
+ * @internal
91
+ */
92
+ export declare function runInTrackingContext<T>(context: TrackingContext, subscriber: DependencySubscriber, fn: () => T): T;
93
+ /** @internal */
94
+ export declare function resetTrackingContext(context: TrackingContext): void;
95
+ export declare const trackingContext: TrackingContext;
96
+ /**
97
+ * Executes a function scope where reactive dependencies are ignored.
98
+ *
99
+ * When to use:
100
+ * - Accessing atom values inside an effect or computed without creating a dependency.
101
+ * - Performing side-effects (logging, analytics) that shouldn't trigger re-runs.
102
+ * - Breaking circular dependencies by reading a value "silently".
103
+ *
104
+ * @param fn - The function to execute in an untracked scope.
105
+ * @returns The result of the function.
106
+ *
107
+ * @example
108
+ * ```typescript
109
+ * const count = atom(0);
110
+ * effect(() => {
111
+ * // This effect only runs when count changes.
112
+ * const current = count.value;
113
+ *
114
+ * untracked(() => {
115
+ * // This read does NOT create a dependency.
116
+ * // It won't cause the effect to re-run if logging was reactive.
117
+ * console.log('Logging untracked value:', count.value);
118
+ * });
119
+ * });
120
+ * ```
121
+ */
122
+ export declare function untracked<T>(fn: () => T): T;
123
+ //# sourceMappingURL=tracking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../src/core/tracking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,CAAC;CACtC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB,EAAE,oBAAoB;CAAG;AAExF;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,IAAI,EAAE,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EAAE,eAAe,EACxB,UAAU,EAAE,oBAAoB,GAAG,IAAI,GACtC,IAAI,CAGN;AAED,gBAAgB;AAChB,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAKpE;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAKxF;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,OAAO,EAAE,eAAe,EACxB,UAAU,EAAE,oBAAoB,EAChC,EAAE,EAAE,MAAM,CAAC,GACV,CAAC,CAUH;AAED,gBAAgB;AAChB,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAGnE;AAED,eAAO,MAAM,eAAe,iBAA0B,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAS3C"}
@@ -0,0 +1,163 @@
1
+ /**
2
+ * A structured JSON representation of an `AtomError` for cross-context transport.
3
+ */
4
+ export interface AtomErrorJSON {
5
+ /** The specific name of the error class. */
6
+ name: string;
7
+ /** The human-readable error message. */
8
+ message: string;
9
+ /** Machine-readable error identifier. */
10
+ code?: string | undefined;
11
+ /** When true, the reactive engine may attempt re-execution. */
12
+ recoverable: boolean;
13
+ /** Trace information. */
14
+ stack?: string | undefined;
15
+ /** The underlying cause resolved into a plain object or primitive. */
16
+ cause?: unknown | undefined;
17
+ }
18
+ /**
19
+ * Constructor signature for system-branded error classes.
20
+ * @internal
21
+ */
22
+ export type AtomErrorConstructor = new (message: string, cause?: unknown, recoverable?: boolean, code?: string) => AtomError;
23
+ /**
24
+ * The base error class for the reactive system.
25
+ *
26
+ * Logic: Execution Context Traceability
27
+ * Maintains a causal chain (`cause`) to allow developers to trace errors
28
+ * through multiple layers of atoms, computed nodes, and effects.
29
+ *
30
+ * When to use:
31
+ * - To define custom error categories within the engine.
32
+ * - To wrap third-party errors with system-specific metadata.
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * import { AtomError } from '@but212/atom-effect';
37
+ *
38
+ * throw new AtomError(
39
+ * 'Validation failed',
40
+ * rawInput,
41
+ * true,
42
+ * 'ERR_VAL_001'
43
+ * );
44
+ * ```
45
+ */
46
+ export declare class AtomError extends Error {
47
+ /** The raw value or error that triggered this instance. */
48
+ readonly cause: unknown;
49
+ /**
50
+ * Logic: Error Recovery
51
+ * When true, indicate that the state might be corrected by a subsequent
52
+ * update. When false, the node is considered permanently failed.
53
+ */
54
+ readonly recoverable: boolean;
55
+ /** Unique category identifier for programmatic handling. */
56
+ readonly code?: string | undefined;
57
+ readonly name: string;
58
+ constructor(message: string,
59
+ /** The raw value or error that triggered this instance. */
60
+ cause?: unknown,
61
+ /**
62
+ * Logic: Error Recovery
63
+ * When true, indicate that the state might be corrected by a subsequent
64
+ * update. When false, the node is considered permanently failed.
65
+ */
66
+ recoverable?: boolean,
67
+ /** Unique category identifier for programmatic handling. */
68
+ code?: string | undefined);
69
+ /**
70
+ * Retrieves the full sequence of causal errors.
71
+ *
72
+ * Logic: Trace Reconstruction
73
+ * Recursively traverses the `.cause` property while protecting against
74
+ * infinite loops caused by circular error chains.
75
+ *
76
+ * @returns Sequential array of errors, starting from the current instance.
77
+ */
78
+ getChain(): Array<AtomError | Error | unknown>;
79
+ /**
80
+ * Logic: Safe Serialization
81
+ * Converts the error into a plain JSON object.
82
+ * Automatically replaces circular references with a sentinel message to
83
+ * prevent serialization crashes in loggers.
84
+ */
85
+ toJSON(seen?: Set<unknown>): AtomErrorJSON;
86
+ /**
87
+ * Formatting utility for internal diagnostic messages.
88
+ * @internal
89
+ */
90
+ static format(source: string, context: string, message: string): string;
91
+ }
92
+ /**
93
+ * Thrown during the evaluation phase of a computed atom.
94
+ */
95
+ export declare class ComputedError extends AtomError {
96
+ readonly name = "ComputedError";
97
+ }
98
+ /**
99
+ * Thrown during the execution or cleanup phase of a reactive effect.
100
+ * Typically represents a side-effect failure.
101
+ */
102
+ export declare class EffectError extends AtomError {
103
+ readonly name = "EffectError";
104
+ constructor(message: string, cause?: unknown, recoverable?: boolean, code?: string);
105
+ }
106
+ /**
107
+ * Thrown by the internal engine when scheduling or flush limits are violated.
108
+ */
109
+ export declare class SchedulerError extends AtomError {
110
+ readonly name = "SchedulerError";
111
+ constructor(message: string, cause?: unknown, recoverable?: boolean, code?: string);
112
+ }
113
+ /**
114
+ * Central registry of standardized error messages.
115
+ *
116
+ * When to use:
117
+ * - To ensure consistent diagnostic output.
118
+ * - To identify specific failure conditions during unit testing.
119
+ */
120
+ export declare const ERROR_MESSAGES: {
121
+ readonly COMPUTED_MUST_BE_FUNCTION: "Computed target must be a function";
122
+ readonly COMPUTED_ASYNC_PENDING_NO_DEFAULT: "Async computation pending with no default value";
123
+ readonly COMPUTED_COMPUTATION_FAILED: "Computation execution failed";
124
+ readonly COMPUTED_ASYNC_COMPUTATION_FAILED: "Async computation execution failed";
125
+ readonly COMPUTED_CIRCULAR_DEPENDENCY: "Circular dependency detected";
126
+ readonly COMPUTED_DISPOSED: "Attempted to access disposed computed";
127
+ readonly ATOM_SUBSCRIBER_MUST_BE_FUNCTION: "Subscriber must be a function or Subscriber object";
128
+ readonly ATOM_INDIVIDUAL_SUBSCRIBER_FAILED: "Subscriber execution failed";
129
+ readonly EFFECT_MUST_BE_FUNCTION: "Effect target must be a function";
130
+ readonly EFFECT_EXECUTION_FAILED: "Effect execution failed";
131
+ readonly EFFECT_CLEANUP_FAILED: "Effect cleanup failed";
132
+ readonly EFFECT_DISPOSED: "Attempted to run disposed effect";
133
+ /** Returns a formatted message for flush overflow limits. */
134
+ readonly SCHEDULER_FLUSH_OVERFLOW: (max: number, dropped: number) => string;
135
+ readonly CALLBACK_ERROR_IN_ERROR_HANDLER: "Exception encountered in onError handler";
136
+ /** Logic: Loop Protection */
137
+ readonly EFFECT_FREQUENCY_LIMIT_EXCEEDED: "Effect executed too frequently within 1 second. Suspected infinite loop.";
138
+ readonly SCHEDULER_CALLBACK_MUST_BE_FUNCTION: "Scheduler callback must be a function";
139
+ readonly SCHEDULER_END_BATCH_WITHOUT_START: "endBatch() called without matching startBatch(). Ignoring.";
140
+ readonly BATCH_CALLBACK_MUST_BE_FUNCTION: "Batch callback must be a function";
141
+ };
142
+ /**
143
+ * Normalizes an unknown error into the system's error hierarchy.
144
+ *
145
+ * When to use:
146
+ * - In `catch` blocks within the engine to ensure cross-module traceability.
147
+ * - To wrap user-provided callbacks with appropriate context (e.g., 'Effect Phase').
148
+ *
149
+ * @param error - The raw error value to wrap.
150
+ * @param ErrorClass - The targeted `AtomError` subclass.
151
+ * @param context - Label describing the origin of the failure.
152
+ *
153
+ * @example
154
+ * ```typescript
155
+ * try {
156
+ * fn();
157
+ * } catch (err) {
158
+ * throw wrapError(err, EffectError, 'Effect Execution');
159
+ * }
160
+ * ```
161
+ */
162
+ export declare function wrapError(error: unknown, ErrorClass: AtomErrorConstructor, context: string): AtomError;
163
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,+DAA+D;IAC/D,WAAW,EAAE,OAAO,CAAC;IACrB,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,sEAAsE;IACtE,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,KACjC,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,OAAO,EAC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