@signaltree/core 5.1.6 → 6.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.
Files changed (91) hide show
  1. package/package.json +1 -6
  2. package/dist/constants.js +0 -6
  3. package/dist/deep-clone.js +0 -80
  4. package/dist/deep-equal.js +0 -41
  5. package/dist/enhancers/batching/lib/batching.js +0 -161
  6. package/dist/enhancers/computed/lib/computed.js +0 -21
  7. package/dist/enhancers/devtools/lib/devtools.js +0 -321
  8. package/dist/enhancers/entities/lib/entities.js +0 -66
  9. package/dist/enhancers/index.js +0 -72
  10. package/dist/enhancers/memoization/lib/memoization.js +0 -410
  11. package/dist/enhancers/presets/lib/presets.js +0 -87
  12. package/dist/enhancers/serialization/constants.js +0 -15
  13. package/dist/enhancers/serialization/lib/serialization.js +0 -662
  14. package/dist/enhancers/time-travel/lib/time-travel.js +0 -193
  15. package/dist/index.js +0 -19
  16. package/dist/is-built-in-object.js +0 -23
  17. package/dist/lib/async-helpers.js +0 -77
  18. package/dist/lib/constants.js +0 -56
  19. package/dist/lib/entity-signal.js +0 -283
  20. package/dist/lib/memory/memory-manager.js +0 -164
  21. package/dist/lib/path-notifier.js +0 -106
  22. package/dist/lib/performance/diff-engine.js +0 -156
  23. package/dist/lib/performance/path-index.js +0 -156
  24. package/dist/lib/performance/update-engine.js +0 -188
  25. package/dist/lib/security/security-validator.js +0 -121
  26. package/dist/lib/signal-tree.js +0 -617
  27. package/dist/lib/types.js +0 -9
  28. package/dist/lib/utils.js +0 -261
  29. package/dist/lru-cache.js +0 -64
  30. package/dist/parse-path.js +0 -13
  31. package/src/async-helpers.d.ts +0 -8
  32. package/src/batching.d.ts +0 -16
  33. package/src/computed.d.ts +0 -12
  34. package/src/constants.d.ts +0 -14
  35. package/src/devtools.d.ts +0 -77
  36. package/src/diff-engine.d.ts +0 -33
  37. package/src/enhancers/batching/index.d.ts +0 -1
  38. package/src/enhancers/batching/lib/batching.d.ts +0 -16
  39. package/src/enhancers/batching/test-setup.d.ts +0 -3
  40. package/src/enhancers/computed/index.d.ts +0 -1
  41. package/src/enhancers/computed/lib/computed.d.ts +0 -12
  42. package/src/enhancers/devtools/index.d.ts +0 -1
  43. package/src/enhancers/devtools/lib/devtools.d.ts +0 -77
  44. package/src/enhancers/devtools/test-setup.d.ts +0 -3
  45. package/src/enhancers/entities/index.d.ts +0 -1
  46. package/src/enhancers/entities/lib/entities.d.ts +0 -17
  47. package/src/enhancers/entities/test-setup.d.ts +0 -3
  48. package/src/enhancers/index.d.ts +0 -3
  49. package/src/enhancers/memoization/index.d.ts +0 -1
  50. package/src/enhancers/memoization/lib/memoization.d.ts +0 -65
  51. package/src/enhancers/memoization/test-setup.d.ts +0 -3
  52. package/src/enhancers/presets/index.d.ts +0 -1
  53. package/src/enhancers/presets/lib/presets.d.ts +0 -11
  54. package/src/enhancers/presets/test-setup.d.ts +0 -3
  55. package/src/enhancers/serialization/constants.d.ts +0 -14
  56. package/src/enhancers/serialization/index.d.ts +0 -2
  57. package/src/enhancers/serialization/lib/serialization.d.ts +0 -59
  58. package/src/enhancers/serialization/test-setup.d.ts +0 -3
  59. package/src/enhancers/time-travel/index.d.ts +0 -1
  60. package/src/enhancers/time-travel/lib/time-travel.d.ts +0 -36
  61. package/src/enhancers/time-travel/lib/utils.d.ts +0 -1
  62. package/src/enhancers/time-travel/test-setup.d.ts +0 -3
  63. package/src/enhancers/types.d.ts +0 -74
  64. package/src/entities.d.ts +0 -28
  65. package/src/entity-signal.d.ts +0 -1
  66. package/src/index.d.ts +0 -18
  67. package/src/lib/async-helpers.d.ts +0 -8
  68. package/src/lib/constants.d.ts +0 -41
  69. package/src/lib/entity-signal.d.ts +0 -1
  70. package/src/lib/memory/memory-manager.d.ts +0 -30
  71. package/src/lib/path-notifier.d.ts +0 -4
  72. package/src/lib/performance/diff-engine.d.ts +0 -33
  73. package/src/lib/performance/path-index.d.ts +0 -25
  74. package/src/lib/performance/update-engine.d.ts +0 -32
  75. package/src/lib/security/security-validator.d.ts +0 -33
  76. package/src/lib/signal-tree.d.ts +0 -8
  77. package/src/lib/types.d.ts +0 -270
  78. package/src/lib/utils.d.ts +0 -28
  79. package/src/memoization.d.ts +0 -65
  80. package/src/memory-manager.d.ts +0 -30
  81. package/src/path-index.d.ts +0 -25
  82. package/src/path-notifier.d.ts +0 -12
  83. package/src/presets.d.ts +0 -11
  84. package/src/security-validator.d.ts +0 -33
  85. package/src/serialization.d.ts +0 -59
  86. package/src/signal-tree.d.ts +0 -8
  87. package/src/test-setup.d.ts +0 -3
  88. package/src/time-travel.d.ts +0 -36
  89. package/src/types.d.ts +0 -436
  90. package/src/update-engine.d.ts +0 -32
  91. package/src/utils.d.ts +0 -1
package/dist/lib/utils.js DELETED
@@ -1,261 +0,0 @@
1
- import { isSignal, signal, runInInjectionContext, effect } from '@angular/core';
2
- import { isBuiltInObject } from '../is-built-in-object.js';
3
-
4
- const CALLABLE_SIGNAL_SYMBOL = Symbol.for('NodeAccessor');
5
- function isEntityMapMarker(value) {
6
- return Boolean(value && typeof value === 'object' && value.__isEntityMap === true);
7
- }
8
- function isNodeAccessor(value) {
9
- return typeof value === 'function' && value && CALLABLE_SIGNAL_SYMBOL in value;
10
- }
11
- function isAnySignal(value) {
12
- return isSignal(value) || isNodeAccessor(value);
13
- }
14
- function toWritableSignal(node, injector) {
15
- const sig = signal(node());
16
- const originalSet = sig.set.bind(sig);
17
- const runner = () => {
18
- originalSet(node());
19
- };
20
- if (injector) {
21
- runInInjectionContext(injector, () => effect(runner));
22
- } else {
23
- try {
24
- effect(runner);
25
- } catch {
26
- console.warn('[SignalTree] toWritableSignal called without injection context; pass Injector for reactivity.');
27
- }
28
- }
29
- sig.set = value => {
30
- node(value);
31
- originalSet(value);
32
- };
33
- sig.update = updater => {
34
- sig.set(updater(sig()));
35
- };
36
- return sig;
37
- }
38
- function composeEnhancers(...enhancers) {
39
- return tree => enhancers.reduce((t, e) => e(t), tree);
40
- }
41
- function createLazySignalTree(obj, equalityFn, basePath = '', memoryManager) {
42
- const signalCache = new Map();
43
- const nestedProxies = new Map();
44
- const nestedCleanups = new Map();
45
- const cleanup = () => {
46
- nestedCleanups.forEach(fn => {
47
- try {
48
- fn();
49
- } catch (error) {
50
- console.warn('Error during nested cleanup:', error);
51
- }
52
- });
53
- nestedCleanups.clear();
54
- signalCache.clear();
55
- nestedProxies.clear();
56
- if (memoryManager) {
57
- memoryManager.dispose();
58
- }
59
- };
60
- const proxy = new Proxy(obj, {
61
- get(target, prop) {
62
- if (prop === '__cleanup__') return cleanup;
63
- if (typeof prop === 'symbol') {
64
- return target[prop];
65
- }
66
- if (prop === 'valueOf' || prop === 'toString') {
67
- return target[prop];
68
- }
69
- const key = prop;
70
- const path = basePath ? `${basePath}.${key}` : key;
71
- if (!(key in target)) return undefined;
72
- const value = target[key];
73
- if (isSignal(value)) return value;
74
- if (value && typeof value === 'object' && typeof value.addOne === 'function' && typeof value.all === 'function') {
75
- return value;
76
- }
77
- if (isEntityMapMarker(value)) return value;
78
- if (memoryManager) {
79
- const cached = memoryManager.getSignal(path);
80
- if (cached) return cached;
81
- }
82
- if (signalCache.has(path)) return signalCache.get(path);
83
- if (nestedProxies.has(path)) return nestedProxies.get(path);
84
- if (value && typeof value === 'object' && !Array.isArray(value) && !isSignal(value) && !isBuiltInObject(value)) {
85
- try {
86
- const nestedProxy = createLazySignalTree(value, equalityFn, path, memoryManager);
87
- nestedProxies.set(path, nestedProxy);
88
- const proxyWithCleanup = nestedProxy;
89
- if (typeof proxyWithCleanup.__cleanup__ === 'function') {
90
- nestedCleanups.set(path, proxyWithCleanup.__cleanup__);
91
- }
92
- return nestedProxy;
93
- } catch (error) {
94
- console.warn(`Failed to create lazy proxy for path "${path}":`, error);
95
- const fallbackSignal = signal(value, {
96
- equal: equalityFn
97
- });
98
- signalCache.set(path, fallbackSignal);
99
- if (memoryManager) {
100
- memoryManager.cacheSignal(path, fallbackSignal);
101
- }
102
- return fallbackSignal;
103
- }
104
- }
105
- try {
106
- const newSignal = signal(value, {
107
- equal: equalityFn
108
- });
109
- signalCache.set(path, newSignal);
110
- if (memoryManager) {
111
- memoryManager.cacheSignal(path, newSignal);
112
- }
113
- return newSignal;
114
- } catch (error) {
115
- console.warn(`Failed to create signal for path "${path}":`, error);
116
- return value;
117
- }
118
- },
119
- set(target, prop, value) {
120
- if (typeof prop === 'symbol') {
121
- target[prop] = value;
122
- return true;
123
- }
124
- const key = prop;
125
- const path = basePath ? `${basePath}.${key}` : key;
126
- try {
127
- target[key] = value;
128
- const cachedSignal = signalCache.get(path);
129
- if (cachedSignal && 'set' in cachedSignal) {
130
- cachedSignal.set(value);
131
- }
132
- if (nestedProxies.has(path)) {
133
- const nestedCleanup = nestedCleanups.get(path);
134
- if (nestedCleanup) {
135
- nestedCleanup();
136
- nestedCleanups.delete(path);
137
- }
138
- nestedProxies.delete(path);
139
- }
140
- return true;
141
- } catch (error) {
142
- console.warn(`Failed to set value for path "${path}":`, error);
143
- return false;
144
- }
145
- },
146
- has(target, prop) {
147
- return prop in target;
148
- },
149
- ownKeys(target) {
150
- return Reflect.ownKeys(target);
151
- },
152
- getOwnPropertyDescriptor(target, prop) {
153
- return Reflect.getOwnPropertyDescriptor(target, prop);
154
- }
155
- });
156
- return proxy;
157
- }
158
- function unwrap(node) {
159
- if (node === null || node === undefined) {
160
- return node;
161
- }
162
- if (isNodeAccessor(node)) {
163
- const result = {};
164
- for (const key in node) {
165
- if (!Object.prototype.hasOwnProperty.call(node, key)) continue;
166
- if (key === 'length' || key === 'prototype') continue;
167
- if (key === 'name') {
168
- const value = node[key];
169
- if (!isSignal(value) && !isNodeAccessor(value)) {
170
- continue;
171
- }
172
- }
173
- const value = node[key];
174
- if (isNodeAccessor(value)) {
175
- result[key] = unwrap(value);
176
- } else if (isSignal(value)) {
177
- const unwrappedValue = value();
178
- if (typeof unwrappedValue === 'object' && unwrappedValue !== null && !Array.isArray(unwrappedValue) && !isBuiltInObject(unwrappedValue)) {
179
- result[key] = unwrap(unwrappedValue);
180
- } else {
181
- result[key] = unwrappedValue;
182
- }
183
- } else if (typeof value === 'object' && value !== null && !Array.isArray(value) && !isBuiltInObject(value)) {
184
- result[key] = unwrap(value);
185
- } else {
186
- result[key] = value;
187
- }
188
- }
189
- return result;
190
- }
191
- if (isSignal(node)) {
192
- const value = node();
193
- if (typeof value === 'object' && value !== null && !Array.isArray(value) && !isBuiltInObject(value)) {
194
- return unwrap(value);
195
- }
196
- return value;
197
- }
198
- if (typeof node !== 'object') {
199
- return node;
200
- }
201
- if (Array.isArray(node)) {
202
- return node;
203
- }
204
- if (isBuiltInObject(node)) {
205
- return node;
206
- }
207
- const result = {};
208
- for (const key in node) {
209
- if (!Object.prototype.hasOwnProperty.call(node, key)) continue;
210
- if (key === 'set' || key === 'update') {
211
- const v = node[key];
212
- if (typeof v === 'function') continue;
213
- }
214
- const value = node[key];
215
- if (isNodeAccessor(value)) {
216
- const unwrappedValue = value();
217
- if (typeof unwrappedValue === 'object' && unwrappedValue !== null && !Array.isArray(unwrappedValue) && !isBuiltInObject(unwrappedValue)) {
218
- result[key] = unwrap(unwrappedValue);
219
- } else {
220
- result[key] = unwrappedValue;
221
- }
222
- } else if (isSignal(value)) {
223
- const unwrappedValue = value();
224
- if (typeof unwrappedValue === 'object' && unwrappedValue !== null && !Array.isArray(unwrappedValue) && !isBuiltInObject(unwrappedValue)) {
225
- result[key] = unwrap(unwrappedValue);
226
- } else {
227
- result[key] = unwrappedValue;
228
- }
229
- } else if (typeof value === 'object' && value !== null && !Array.isArray(value) && !isBuiltInObject(value)) {
230
- result[key] = unwrap(value);
231
- } else {
232
- result[key] = value;
233
- }
234
- }
235
- const symbols = Object.getOwnPropertySymbols(node);
236
- for (const sym of symbols) {
237
- const value = node[sym];
238
- if (isNodeAccessor(value)) {
239
- const unwrappedValue = value();
240
- if (typeof unwrappedValue === 'object' && unwrappedValue !== null && !Array.isArray(unwrappedValue) && !isBuiltInObject(unwrappedValue)) {
241
- result[sym] = unwrap(unwrappedValue);
242
- } else {
243
- result[sym] = unwrappedValue;
244
- }
245
- } else if (isSignal(value)) {
246
- const unwrappedValue = value();
247
- if (typeof unwrappedValue === 'object' && unwrappedValue !== null && !Array.isArray(unwrappedValue) && !isBuiltInObject(unwrappedValue)) {
248
- result[sym] = unwrap(unwrappedValue);
249
- } else {
250
- result[sym] = unwrappedValue;
251
- }
252
- } else if (typeof value === 'object' && value !== null && !Array.isArray(value) && !isBuiltInObject(value)) {
253
- result[sym] = unwrap(value);
254
- } else {
255
- result[sym] = value;
256
- }
257
- }
258
- return result;
259
- }
260
-
261
- export { composeEnhancers, createLazySignalTree, isAnySignal, isBuiltInObject, isNodeAccessor, toWritableSignal, unwrap };
package/dist/lru-cache.js DELETED
@@ -1,64 +0,0 @@
1
- class LRUCache {
2
- constructor(maxSize) {
3
- this.maxSize = maxSize;
4
- this.cache = new Map();
5
- if (!Number.isFinite(maxSize) || maxSize <= 0) {
6
- throw new Error('LRUCache maxSize must be a positive, finite number');
7
- }
8
- }
9
- set(key, value) {
10
- if (this.cache.has(key)) {
11
- this.cache.delete(key);
12
- }
13
- this.cache.set(key, value);
14
- if (this.cache.size > this.maxSize) {
15
- const oldestKey = this.cache.keys().next().value;
16
- if (oldestKey !== undefined) {
17
- this.cache.delete(oldestKey);
18
- }
19
- }
20
- }
21
- get(key) {
22
- if (!this.cache.has(key)) return undefined;
23
- const value = this.cache.get(key);
24
- if (value !== undefined) {
25
- this.cache.delete(key);
26
- this.cache.set(key, value);
27
- }
28
- return value;
29
- }
30
- delete(key) {
31
- this.cache.delete(key);
32
- }
33
- has(key) {
34
- return this.cache.has(key);
35
- }
36
- clear() {
37
- this.cache.clear();
38
- }
39
- size() {
40
- return this.cache.size;
41
- }
42
- forEach(callback) {
43
- this.cache.forEach((value, key) => callback(value, key));
44
- }
45
- entries() {
46
- return this.cache.entries();
47
- }
48
- keys() {
49
- return this.cache.keys();
50
- }
51
- resize(newSize) {
52
- if (!Number.isFinite(newSize) || newSize <= 0) {
53
- throw new Error('LRUCache newSize must be a positive, finite number');
54
- }
55
- this.maxSize = newSize;
56
- while (this.cache.size > this.maxSize) {
57
- const oldestKey = this.cache.keys().next().value;
58
- if (oldestKey === undefined) break;
59
- this.cache.delete(oldestKey);
60
- }
61
- }
62
- }
63
-
64
- export { LRUCache };
@@ -1,13 +0,0 @@
1
- import { DEFAULT_PATH_CACHE_SIZE } from './constants.js';
2
- import { LRUCache } from './lru-cache.js';
3
-
4
- const pathCache = new LRUCache(DEFAULT_PATH_CACHE_SIZE);
5
- function parsePath(path) {
6
- const cached = pathCache.get(path);
7
- if (cached) return cached;
8
- const segments = path.split('.');
9
- pathCache.set(path, segments);
10
- return segments;
11
- }
12
-
13
- export { parsePath };
@@ -1,8 +0,0 @@
1
- import type { SignalTree } from './types';
2
- export declare function createAsyncOperation<T, TResult>(name: string, operation: () => Promise<TResult>): (tree: SignalTree<T>) => Promise<TResult>;
3
- export declare function trackAsync<T>(operation: () => Promise<T>): {
4
- pending: import("@angular/core").Signal<boolean>;
5
- error: import("@angular/core").Signal<Error | null>;
6
- result: import("@angular/core").Signal<T | null>;
7
- execute: () => Promise<T>;
8
- };
package/src/batching.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import type { SignalTree } from '../../../lib/types';
2
- interface BatchingConfig {
3
- enabled?: boolean;
4
- maxBatchSize?: number;
5
- autoFlushDelay?: number;
6
- batchTimeoutMs?: number;
7
- }
8
- interface BatchingSignalTree<T> extends SignalTree<T> {
9
- batchUpdate(updater: (current: T) => Partial<T>): void;
10
- }
11
- export declare function withBatching<T>(config?: BatchingConfig): (tree: SignalTree<T>) => BatchingSignalTree<T>;
12
- export declare function withHighPerformanceBatching<T>(): (tree: SignalTree<T>) => BatchingSignalTree<T>;
13
- export declare function flushBatchedUpdates(): void;
14
- export declare function hasPendingUpdates(): boolean;
15
- export declare function getBatchQueueSize(): number;
16
- export {};
package/src/computed.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import { Signal } from '@angular/core';
2
- import type { TreeNode, SignalTree } from '../../../lib/types';
3
- export interface ComputedConfig {
4
- lazy?: boolean;
5
- memoize?: boolean;
6
- }
7
- export type ComputedSignal<T> = Signal<T>;
8
- export interface ComputedSignalTree<T extends Record<string, unknown>> extends SignalTree<T> {
9
- computed<U>(computeFn: (tree: TreeNode<T>) => U): ComputedSignal<U>;
10
- }
11
- export declare function computedEnhancer(_config?: ComputedConfig): import("../../../lib/types").EnhancerWithMeta<SignalTree<Record<string, unknown>>, ComputedSignalTree<Record<string, unknown>>>;
12
- export declare function createComputed<T>(dependencies: readonly Signal<unknown>[], computeFn: () => T): ComputedSignal<T>;
@@ -1,14 +0,0 @@
1
- export declare const TYPE_MARKERS: {
2
- readonly DATE: "§d";
3
- readonly REGEXP: "§r";
4
- readonly MAP: "§m";
5
- readonly SET: "§s";
6
- readonly UNDEFINED: "§u";
7
- readonly NAN: "§n";
8
- readonly INFINITY: "§i";
9
- readonly NEG_INFINITY: "§-i";
10
- readonly BIGINT: "§b";
11
- readonly SYMBOL: "§y";
12
- readonly FUNCTION: "§f";
13
- readonly CIRCULAR: "§c";
14
- };
package/src/devtools.d.ts DELETED
@@ -1,77 +0,0 @@
1
- import { Signal } from '@angular/core';
2
- import type { SignalTree } from '../../../lib/types';
3
- export interface ModuleMetadata {
4
- name: string;
5
- methods: string[];
6
- addedAt: Date;
7
- lastActivity: Date;
8
- operationCount: number;
9
- averageExecutionTime: number;
10
- errorCount: number;
11
- }
12
- export interface ModularPerformanceMetrics {
13
- totalUpdates: number;
14
- moduleUpdates: Record<string, number>;
15
- modulePerformance: Record<string, number>;
16
- compositionChain: string[];
17
- signalGrowth: Record<string, number>;
18
- memoryDelta: Record<string, number>;
19
- moduleCacheStats: Record<string, {
20
- hits: number;
21
- misses: number;
22
- }>;
23
- }
24
- export interface ModuleActivityTracker {
25
- trackMethodCall: (module: string, method: string, duration: number) => void;
26
- trackError: (module: string, error: Error, context?: string) => void;
27
- getModuleActivity: (module: string) => ModuleMetadata | undefined;
28
- getAllModules: () => ModuleMetadata[];
29
- }
30
- export interface CompositionLogger {
31
- logComposition: (modules: string[], action: 'with' | 'enhance') => void;
32
- logMethodExecution: (module: string, method: string, args: unknown[], result: unknown) => void;
33
- logStateChange: (module: string, path: string, oldValue: unknown, newValue: unknown) => void;
34
- logPerformanceWarning: (module: string, operation: string, duration: number, threshold: number) => void;
35
- exportLogs: () => Array<{
36
- timestamp: Date;
37
- module: string;
38
- type: 'composition' | 'method' | 'state' | 'performance';
39
- data: unknown;
40
- }>;
41
- }
42
- export interface ModularDevToolsInterface<_T = unknown> {
43
- activityTracker: ModuleActivityTracker;
44
- logger: CompositionLogger;
45
- metrics: Signal<ModularPerformanceMetrics>;
46
- trackComposition: (modules: string[]) => void;
47
- startModuleProfiling: (module: string) => string;
48
- endModuleProfiling: (profileId: string) => void;
49
- connectDevTools: (treeName: string) => void;
50
- exportDebugSession: () => {
51
- metrics: ModularPerformanceMetrics;
52
- modules: ModuleMetadata[];
53
- logs: Array<unknown>;
54
- compositionHistory: Array<{
55
- timestamp: Date;
56
- chain: string[];
57
- }>;
58
- };
59
- }
60
- export declare function withDevTools<T>(config?: {
61
- enabled?: boolean;
62
- treeName?: string;
63
- enableBrowserDevTools?: boolean;
64
- enableLogging?: boolean;
65
- performanceThreshold?: number;
66
- }): (tree: SignalTree<T>) => SignalTree<T> & {
67
- __devTools: ModularDevToolsInterface<T>;
68
- };
69
- export declare function enableDevTools<T>(treeName?: string): (tree: SignalTree<T>) => SignalTree<T> & {
70
- __devTools: ModularDevToolsInterface<T>;
71
- };
72
- export declare function withFullDevTools<T>(treeName?: string): (tree: SignalTree<T>) => SignalTree<T> & {
73
- __devTools: ModularDevToolsInterface<T>;
74
- };
75
- export declare function withProductionDevTools<T>(): (tree: SignalTree<T>) => SignalTree<T> & {
76
- __devTools: ModularDevToolsInterface<T>;
77
- };
@@ -1,33 +0,0 @@
1
- import type { Path } from './path-index';
2
- export declare enum ChangeType {
3
- ADD = "add",
4
- UPDATE = "update",
5
- DELETE = "delete",
6
- REPLACE = "replace"
7
- }
8
- export interface Change {
9
- type: ChangeType;
10
- path: Path;
11
- value?: unknown;
12
- oldValue?: unknown;
13
- }
14
- export interface Diff {
15
- changes: Change[];
16
- hasChanges: boolean;
17
- }
18
- export interface DiffOptions {
19
- maxDepth?: number;
20
- detectDeletions?: boolean;
21
- ignoreArrayOrder?: boolean;
22
- equalityFn?: (a: unknown, b: unknown) => boolean;
23
- keyValidator?: (key: string) => boolean;
24
- }
25
- export declare class DiffEngine {
26
- private defaultOptions;
27
- diff(current: unknown, updates: unknown, options?: DiffOptions): Diff;
28
- private traverse;
29
- private diffArrays;
30
- private diffArraysOrdered;
31
- private diffArraysUnordered;
32
- private stringify;
33
- }
@@ -1 +0,0 @@
1
- export * from './lib/batching';
@@ -1,16 +0,0 @@
1
- import type { SignalTree } from '../../../lib/types';
2
- interface BatchingConfig {
3
- enabled?: boolean;
4
- maxBatchSize?: number;
5
- autoFlushDelay?: number;
6
- batchTimeoutMs?: number;
7
- }
8
- interface BatchingSignalTree<T> extends SignalTree<T> {
9
- batchUpdate(updater: (current: T) => Partial<T>): void;
10
- }
11
- export declare function withBatching<T>(config?: BatchingConfig): (tree: SignalTree<T>) => BatchingSignalTree<T>;
12
- export declare function withHighPerformanceBatching<T>(): (tree: SignalTree<T>) => BatchingSignalTree<T>;
13
- export declare function flushBatchedUpdates(): void;
14
- export declare function hasPendingUpdates(): boolean;
15
- export declare function getBatchQueueSize(): number;
16
- export {};
@@ -1,3 +0,0 @@
1
- import '@angular/compiler';
2
- import 'zone.js';
3
- import 'zone.js/testing';
@@ -1 +0,0 @@
1
- export * from './lib/computed';
@@ -1,12 +0,0 @@
1
- import { Signal } from '@angular/core';
2
- import type { TreeNode, SignalTree } from '../../../lib/types';
3
- export interface ComputedConfig {
4
- lazy?: boolean;
5
- memoize?: boolean;
6
- }
7
- export type ComputedSignal<T> = Signal<T>;
8
- export interface ComputedSignalTree<T extends Record<string, unknown>> extends SignalTree<T> {
9
- computed<U>(computeFn: (tree: TreeNode<T>) => U): ComputedSignal<U>;
10
- }
11
- export declare function computedEnhancer(_config?: ComputedConfig): import("../../../lib/types").EnhancerWithMeta<SignalTree<Record<string, unknown>>, ComputedSignalTree<Record<string, unknown>>>;
12
- export declare function createComputed<T>(dependencies: readonly Signal<unknown>[], computeFn: () => T): ComputedSignal<T>;
@@ -1 +0,0 @@
1
- export * from './lib/devtools';
@@ -1,77 +0,0 @@
1
- import { Signal } from '@angular/core';
2
- import type { SignalTree } from '../../../lib/types';
3
- export interface ModuleMetadata {
4
- name: string;
5
- methods: string[];
6
- addedAt: Date;
7
- lastActivity: Date;
8
- operationCount: number;
9
- averageExecutionTime: number;
10
- errorCount: number;
11
- }
12
- export interface ModularPerformanceMetrics {
13
- totalUpdates: number;
14
- moduleUpdates: Record<string, number>;
15
- modulePerformance: Record<string, number>;
16
- compositionChain: string[];
17
- signalGrowth: Record<string, number>;
18
- memoryDelta: Record<string, number>;
19
- moduleCacheStats: Record<string, {
20
- hits: number;
21
- misses: number;
22
- }>;
23
- }
24
- export interface ModuleActivityTracker {
25
- trackMethodCall: (module: string, method: string, duration: number) => void;
26
- trackError: (module: string, error: Error, context?: string) => void;
27
- getModuleActivity: (module: string) => ModuleMetadata | undefined;
28
- getAllModules: () => ModuleMetadata[];
29
- }
30
- export interface CompositionLogger {
31
- logComposition: (modules: string[], action: 'with' | 'enhance') => void;
32
- logMethodExecution: (module: string, method: string, args: unknown[], result: unknown) => void;
33
- logStateChange: (module: string, path: string, oldValue: unknown, newValue: unknown) => void;
34
- logPerformanceWarning: (module: string, operation: string, duration: number, threshold: number) => void;
35
- exportLogs: () => Array<{
36
- timestamp: Date;
37
- module: string;
38
- type: 'composition' | 'method' | 'state' | 'performance';
39
- data: unknown;
40
- }>;
41
- }
42
- export interface ModularDevToolsInterface<_T = unknown> {
43
- activityTracker: ModuleActivityTracker;
44
- logger: CompositionLogger;
45
- metrics: Signal<ModularPerformanceMetrics>;
46
- trackComposition: (modules: string[]) => void;
47
- startModuleProfiling: (module: string) => string;
48
- endModuleProfiling: (profileId: string) => void;
49
- connectDevTools: (treeName: string) => void;
50
- exportDebugSession: () => {
51
- metrics: ModularPerformanceMetrics;
52
- modules: ModuleMetadata[];
53
- logs: Array<unknown>;
54
- compositionHistory: Array<{
55
- timestamp: Date;
56
- chain: string[];
57
- }>;
58
- };
59
- }
60
- export declare function withDevTools<T>(config?: {
61
- enabled?: boolean;
62
- treeName?: string;
63
- enableBrowserDevTools?: boolean;
64
- enableLogging?: boolean;
65
- performanceThreshold?: number;
66
- }): (tree: SignalTree<T>) => SignalTree<T> & {
67
- __devTools: ModularDevToolsInterface<T>;
68
- };
69
- export declare function enableDevTools<T>(treeName?: string): (tree: SignalTree<T>) => SignalTree<T> & {
70
- __devTools: ModularDevToolsInterface<T>;
71
- };
72
- export declare function withFullDevTools<T>(treeName?: string): (tree: SignalTree<T>) => SignalTree<T> & {
73
- __devTools: ModularDevToolsInterface<T>;
74
- };
75
- export declare function withProductionDevTools<T>(): (tree: SignalTree<T>) => SignalTree<T> & {
76
- __devTools: ModularDevToolsInterface<T>;
77
- };
@@ -1,3 +0,0 @@
1
- import '@angular/compiler';
2
- import 'zone.js';
3
- import 'zone.js/testing';
@@ -1 +0,0 @@
1
- export * from './lib/entities';
@@ -1,17 +0,0 @@
1
- import type { SignalTree, EntityAwareTreeNode } from '../../../lib/types';
2
- interface EntitiesEnhancerConfig {
3
- enabled?: boolean;
4
- }
5
- export declare function withEntities(config?: EntitiesEnhancerConfig): <T>(tree: SignalTree<T>) => Omit<SignalTree<T>, "state" | "$"> & {
6
- state: EntityAwareTreeNode<T>;
7
- $: EntityAwareTreeNode<T>;
8
- };
9
- export declare function enableEntities(): <T>(tree: SignalTree<T>) => Omit<SignalTree<T>, "state" | "$"> & {
10
- state: EntityAwareTreeNode<T>;
11
- $: EntityAwareTreeNode<T>;
12
- };
13
- export declare function withHighPerformanceEntities(): <T>(tree: SignalTree<T>) => Omit<SignalTree<T>, "state" | "$"> & {
14
- state: EntityAwareTreeNode<T>;
15
- $: EntityAwareTreeNode<T>;
16
- };
17
- export {};
@@ -1,3 +0,0 @@
1
- import '@angular/compiler';
2
- import 'zone.js';
3
- import 'zone.js/testing';
@@ -1,3 +0,0 @@
1
- import type { EnhancerMeta, EnhancerWithMeta } from '../lib/types';
2
- export declare function createEnhancer<I = unknown, O = unknown>(meta: EnhancerMeta, enhancerFn: (input: I) => O): EnhancerWithMeta<I, O>;
3
- export declare function resolveEnhancerOrder(enhancers: EnhancerWithMeta<unknown, unknown>[], availableCapabilities?: Set<string>, debugMode?: boolean): EnhancerWithMeta<unknown, unknown>[];
@@ -1 +0,0 @@
1
- export * from './lib/memoization';