@signaltree/core 5.1.4 → 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 -93
  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 -626
  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 -20
  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 -20
  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 -278
  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 -444
  90. package/src/update-engine.d.ts +0 -32
  91. package/src/utils.d.ts +0 -1
@@ -1,65 +0,0 @@
1
- import type { SignalTree } from '../../../lib/types';
2
- export interface MemoizedSignalTree<T> extends SignalTree<T> {
3
- memoizedUpdate: (updater: (current: T) => Partial<T>, cacheKey?: string) => void;
4
- clearMemoCache: (key?: string) => void;
5
- getCacheStats: () => {
6
- size: number;
7
- hitRate: number;
8
- totalHits: number;
9
- totalMisses: number;
10
- keys: string[];
11
- };
12
- }
13
- export declare function cleanupMemoizationCache(): void;
14
- export interface MemoizationConfig {
15
- enabled?: boolean;
16
- maxCacheSize?: number;
17
- ttl?: number;
18
- equality?: 'deep' | 'shallow' | 'reference';
19
- enableLRU?: boolean;
20
- }
21
- export declare function memoize<TArgs extends unknown[], TReturn>(fn: (...args: TArgs) => TReturn, keyFn?: (...args: TArgs) => string, config?: MemoizationConfig): (...args: TArgs) => TReturn;
22
- export declare function memoizeShallow<TArgs extends unknown[], TReturn>(fn: (...args: TArgs) => TReturn, keyFn?: (...args: TArgs) => string): (...args: TArgs) => TReturn;
23
- export declare function memoizeReference<TArgs extends unknown[], TReturn>(fn: (...args: TArgs) => TReturn, keyFn?: (...args: TArgs) => string): (...args: TArgs) => TReturn;
24
- export declare const MEMOIZATION_PRESETS: {
25
- readonly selector: {
26
- readonly equality: "reference";
27
- readonly maxCacheSize: 10;
28
- readonly enableLRU: false;
29
- readonly ttl: undefined;
30
- };
31
- readonly computed: {
32
- readonly equality: "shallow";
33
- readonly maxCacheSize: 100;
34
- readonly enableLRU: false;
35
- readonly ttl: undefined;
36
- };
37
- readonly deepState: {
38
- readonly equality: "deep";
39
- readonly maxCacheSize: 1000;
40
- readonly enableLRU: true;
41
- readonly ttl: number;
42
- };
43
- readonly highFrequency: {
44
- readonly equality: "reference";
45
- readonly maxCacheSize: 5;
46
- readonly enableLRU: false;
47
- readonly ttl: undefined;
48
- };
49
- };
50
- export declare function withSelectorMemoization<T>(): (tree: SignalTree<T>) => MemoizedSignalTree<T>;
51
- export declare function withComputedMemoization<T>(): (tree: SignalTree<T>) => MemoizedSignalTree<T>;
52
- export declare function withDeepStateMemoization<T>(): (tree: SignalTree<T>) => MemoizedSignalTree<T>;
53
- export declare function withHighFrequencyMemoization<T>(): (tree: SignalTree<T>) => MemoizedSignalTree<T>;
54
- export declare function withMemoization<T>(config?: MemoizationConfig): (tree: SignalTree<T>) => MemoizedSignalTree<T>;
55
- export declare function enableMemoization<T>(): (tree: SignalTree<T>) => MemoizedSignalTree<T>;
56
- export declare function withHighPerformanceMemoization<T>(): (tree: SignalTree<T>) => MemoizedSignalTree<T>;
57
- export declare function withLightweightMemoization<T>(): (tree: SignalTree<T>) => MemoizedSignalTree<T>;
58
- export declare function withShallowMemoization<T>(): (tree: SignalTree<T>) => MemoizedSignalTree<T>;
59
- export declare function clearAllCaches(): void;
60
- export declare function getGlobalCacheStats(): {
61
- treeCount: number;
62
- totalSize: number;
63
- totalHits: number;
64
- averageCacheSize: number;
65
- };
@@ -1,3 +0,0 @@
1
- import '@angular/compiler';
2
- import 'zone.js';
3
- import 'zone.js/testing';
@@ -1 +0,0 @@
1
- export * from './lib/presets';
@@ -1,11 +0,0 @@
1
- import type { TreeConfig } from '../../../lib/types';
2
- export type TreePreset = 'basic' | 'performance' | 'development' | 'production';
3
- export declare const TREE_PRESETS: Record<TreePreset, Partial<TreeConfig>>;
4
- export declare function createPresetConfig(preset: TreePreset, overrides?: Partial<TreeConfig>): TreeConfig;
5
- export declare function validatePreset(preset: TreePreset): boolean;
6
- export declare function getAvailablePresets(): TreePreset[];
7
- export declare function combinePresets(presets: TreePreset[], overrides?: Partial<TreeConfig>): TreeConfig;
8
- export declare function createDevTree(overrides?: Partial<TreeConfig>): {
9
- readonly config: TreeConfig;
10
- readonly enhancer: (tree: import("../../memoization/lib/memoization").MemoizedSignalTree<unknown>) => import("../../memoization/lib/memoization").MemoizedSignalTree<unknown>;
11
- };
@@ -1,3 +0,0 @@
1
- import '@angular/compiler';
2
- import 'zone.js';
3
- import 'zone.js/testing';
@@ -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
- };
@@ -1,2 +0,0 @@
1
- export * from './lib/serialization';
2
- export * from './constants';
@@ -1,59 +0,0 @@
1
- import type { SignalTree } from '../../../lib/types';
2
- import type { EnhancerWithMeta } from '../../../lib/types';
3
- export interface SerializationConfig {
4
- includeMetadata?: boolean;
5
- replacer?: (key: string, value: unknown) => unknown;
6
- reviver?: (key: string, value: unknown) => unknown;
7
- preserveTypes?: boolean;
8
- maxDepth?: number;
9
- handleCircular?: boolean;
10
- }
11
- export interface SerializedState<T = unknown> {
12
- data: T;
13
- metadata?: {
14
- timestamp: number;
15
- version: string;
16
- appVersion?: string;
17
- types?: Record<string, string>;
18
- circularRefs?: Array<{
19
- path: string;
20
- targetPath: string;
21
- }>;
22
- nodeMap?: Record<string, 'b' | 'r'>;
23
- };
24
- }
25
- export interface SerializableSignalTree<T> extends SignalTree<T> {
26
- $: any;
27
- serialize(config?: SerializationConfig): string;
28
- deserialize(json: string, config?: SerializationConfig): void;
29
- toJSON(): T;
30
- fromJSON(data: T, metadata?: SerializedState<T>['metadata']): void;
31
- snapshot(): SerializedState<T>;
32
- restore(snapshot: SerializedState<T>): void;
33
- }
34
- export interface PersistenceMethods {
35
- save(): Promise<void>;
36
- load(): Promise<void>;
37
- clear(): Promise<void>;
38
- __flushAutoSave?: () => Promise<void>;
39
- }
40
- export declare function withSerialization<T extends Record<string, unknown> = Record<string, unknown>>(defaultConfig?: SerializationConfig): EnhancerWithMeta<SignalTree<T>, SerializableSignalTree<T>>;
41
- export declare function enableSerialization<T extends Record<string, unknown> = Record<string, unknown>>(): EnhancerWithMeta<SignalTree<T>, SerializableSignalTree<T>>;
42
- export interface StorageAdapter {
43
- getItem(key: string): string | null | Promise<string | null>;
44
- setItem(key: string, value: string): void | Promise<void>;
45
- removeItem(key: string): void | Promise<void>;
46
- }
47
- export interface PersistenceConfig extends SerializationConfig {
48
- key: string;
49
- storage?: StorageAdapter;
50
- autoSave?: boolean;
51
- debounceMs?: number;
52
- autoLoad?: boolean;
53
- skipCache?: boolean;
54
- }
55
- export declare function withPersistence<T extends Record<string, unknown> = Record<string, unknown>>(config: PersistenceConfig): EnhancerWithMeta<SignalTree<T>, SerializableSignalTree<T> & PersistenceMethods>;
56
- export declare function createStorageAdapter(getItem: (key: string) => string | null | Promise<string | null>, setItem: (key: string, value: string) => void | Promise<void>, removeItem: (key: string) => void | Promise<void>): StorageAdapter;
57
- export declare function createIndexedDBAdapter(dbName?: string, storeName?: string): StorageAdapter;
58
- export declare function applySerialization<T extends Record<string, unknown>>(tree: SignalTree<T>): SerializableSignalTree<T>;
59
- export declare function applyPersistence<T extends Record<string, unknown>>(tree: SignalTree<T>, cfg: PersistenceConfig): SerializableSignalTree<T> & PersistenceMethods;
@@ -1,3 +0,0 @@
1
- import '@angular/compiler';
2
- import 'zone.js';
3
- import 'zone.js/testing';
@@ -1 +0,0 @@
1
- export * from './lib/time-travel';
@@ -1,36 +0,0 @@
1
- import type { SignalTree } from '../../../lib/types';
2
- export interface TimeTravelEntry<T> {
3
- state: T;
4
- timestamp: number;
5
- action: string;
6
- payload?: unknown;
7
- }
8
- export interface TimeTravelInterface<T> {
9
- undo(): boolean;
10
- redo(): boolean;
11
- getHistory(): TimeTravelEntry<T>[];
12
- resetHistory(): void;
13
- jumpTo(index: number): boolean;
14
- getCurrentIndex(): number;
15
- canUndo(): boolean;
16
- canRedo(): boolean;
17
- }
18
- export interface TimeTravelConfig {
19
- maxHistorySize?: number;
20
- includePayload?: boolean;
21
- actionNames?: {
22
- update?: string;
23
- set?: string;
24
- batch?: string;
25
- [key: string]: string | undefined;
26
- };
27
- }
28
- export declare function withTimeTravel<T>(config?: TimeTravelConfig): (tree: SignalTree<T>) => SignalTree<T> & {
29
- __timeTravel: TimeTravelInterface<T>;
30
- };
31
- export declare function enableTimeTravel<T>(maxHistorySize?: number): (tree: SignalTree<T>) => SignalTree<T> & {
32
- __timeTravel: TimeTravelInterface<T>;
33
- };
34
- export declare function getTimeTravel<T>(tree: SignalTree<T> & {
35
- __timeTravel?: TimeTravelInterface<T>;
36
- }): TimeTravelInterface<T> | undefined;
@@ -1 +0,0 @@
1
- export { deepClone, deepEqual } from '@signaltree/shared';
@@ -1,3 +0,0 @@
1
- import '@angular/compiler';
2
- import 'zone.js';
3
- import 'zone.js/testing';
@@ -1,74 +0,0 @@
1
- export interface BatchingConfig {
2
- maxBatchSize?: number;
3
- debounceMs?: number;
4
- flushOnMicrotask?: boolean;
5
- }
6
- export interface BatchUpdate<T = unknown> {
7
- path: string[];
8
- value: T;
9
- timestamp: number;
10
- }
11
- export interface ComputedSignal<T> {
12
- (): T;
13
- readonly value: T;
14
- }
15
- export interface ComputedConfig {
16
- lazy?: boolean;
17
- memoize?: boolean;
18
- }
19
- export interface MemoizationConfig {
20
- maxSize?: number;
21
- ttl?: number;
22
- strategy?: 'lru' | 'fifo' | 'lfu';
23
- }
24
- export interface MemoizedFunction<T extends (...args: never[]) => unknown> {
25
- (...args: Parameters<T>): ReturnType<T>;
26
- clear(): void;
27
- stats(): {
28
- hits: number;
29
- misses: number;
30
- size: number;
31
- };
32
- }
33
- export interface TimeTravelConfig {
34
- maxHistorySize?: number;
35
- enableCompression?: boolean;
36
- }
37
- export interface TimeTravelState {
38
- canUndo: boolean;
39
- canRedo: boolean;
40
- historySize: number;
41
- currentIndex: number;
42
- }
43
- export interface DevToolsConfig {
44
- name?: string;
45
- enabled?: boolean;
46
- logLevel?: 'debug' | 'info' | 'warn' | 'error';
47
- }
48
- export interface DevToolsAction {
49
- type: string;
50
- payload?: unknown;
51
- timestamp: number;
52
- source: string;
53
- }
54
- export interface PresetConfig {
55
- name: string;
56
- enhancers: unknown[];
57
- config?: Record<string, unknown>;
58
- }
59
- export interface EntityConfig {
60
- idField?: string;
61
- indexes?: string[];
62
- relations?: Record<string, string>;
63
- }
64
- export interface SerializationConfig {
65
- includeComputed?: boolean;
66
- includeMeta?: boolean;
67
- customSerializers?: Record<string, (value: unknown) => unknown>;
68
- }
69
- export interface SerializedState {
70
- version: string;
71
- timestamp: number;
72
- data: unknown;
73
- meta?: Record<string, unknown>;
74
- }
package/src/entities.d.ts DELETED
@@ -1,20 +0,0 @@
1
- import type { EntitySignal, 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
- entities<E, K extends string | number>(path: keyof T | string): EntitySignal<E, K>;
9
- };
10
- export declare function enableEntities(): <T>(tree: SignalTree<T>) => Omit<SignalTree<T>, "state" | "$"> & {
11
- state: EntityAwareTreeNode<T>;
12
- $: EntityAwareTreeNode<T>;
13
- entities<E, K extends string | number>(path: keyof T | string): EntitySignal<E, K>;
14
- };
15
- export declare function withHighPerformanceEntities(): <T>(tree: SignalTree<T>) => Omit<SignalTree<T>, "state" | "$"> & {
16
- state: EntityAwareTreeNode<T>;
17
- $: EntityAwareTreeNode<T>;
18
- entities<E, K extends string | number>(path: keyof T | string): EntitySignal<E, K>;
19
- };
20
- export {};
@@ -1 +0,0 @@
1
- export {};
package/src/index.d.ts DELETED
@@ -1,18 +0,0 @@
1
- export { signalTree } from './lib/signal-tree';
2
- export type { SignalTree, TreeNode, CallableWritableSignal, AccessibleNode, NodeAccessor, RemoveSignalMethods, Primitive, BuiltInObject, NotFn, DeepPath, DeepAccess, TreeConfig, TreePreset, Enhancer, EnhancerMeta, EnhancerWithMeta, ChainResult, WithMethod, EntitySignal, EntityMapMarker, EntityConfig, MutationOptions, AddOptions, AddManyOptions, PerformanceMetrics, EntityHelpers, TimeTravelEntry, } from './lib/types';
3
- export { entityMap } from './lib/types';
4
- export { equal, deepEqual, isNodeAccessor, isAnySignal, toWritableSignal, parsePath, composeEnhancers, isBuiltInObject, createLazySignalTree, } from './lib/utils';
5
- export { getPathNotifier } from './lib/path-notifier';
6
- export { SecurityValidator, SecurityPresets, type SecurityEvent, type SecurityEventType, type SecurityValidatorConfig, } from './lib/security/security-validator';
7
- export { createEnhancer, resolveEnhancerOrder } from './enhancers/index';
8
- export { ENHANCER_META } from './lib/types';
9
- export { withBatching, withHighPerformanceBatching, flushBatchedUpdates, hasPendingUpdates, getBatchQueueSize, } from './enhancers/batching/lib/batching';
10
- export { withMemoization, withSelectorMemoization, withComputedMemoization, withDeepStateMemoization, withHighFrequencyMemoization, withHighPerformanceMemoization, withLightweightMemoization, withShallowMemoization, memoize, memoizeShallow, memoizeReference, cleanupMemoizationCache, clearAllCaches, getGlobalCacheStats, } from './enhancers/memoization/lib/memoization';
11
- export { withTimeTravel, enableTimeTravel, getTimeTravel, type TimeTravelInterface, } from './enhancers/time-travel/lib/time-travel';
12
- export { withEntities, enableEntities, withHighPerformanceEntities, } from './enhancers/entities/lib/entities';
13
- export { withSerialization, enableSerialization, withPersistence, createStorageAdapter, createIndexedDBAdapter, applySerialization, applyPersistence, } from './enhancers/serialization/lib/serialization';
14
- export { withDevTools, enableDevTools, withFullDevTools, withProductionDevTools, } from './enhancers/devtools/lib/devtools';
15
- export { createAsyncOperation, trackAsync } from './lib/async-helpers';
16
- export { TREE_PRESETS, createPresetConfig, validatePreset, getAvailablePresets, combinePresets, createDevTree, } from './enhancers/presets/lib/presets';
17
- export { computedEnhancer, createComputed, type ComputedConfig, type ComputedSignal, type ComputedSignalTree, } from './enhancers/computed/lib/computed';
18
- export { SIGNAL_TREE_CONSTANTS, SIGNAL_TREE_MESSAGES } from './lib/constants';
@@ -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
- };
@@ -1,41 +0,0 @@
1
- export declare const SIGNAL_TREE_CONSTANTS: {
2
- readonly MAX_PATH_CACHE_SIZE: 1000;
3
- readonly LAZY_THRESHOLD: 50;
4
- readonly ESTIMATE_MAX_DEPTH: 3;
5
- readonly ESTIMATE_SAMPLE_SIZE_ARRAY: 3;
6
- readonly ESTIMATE_SAMPLE_SIZE_OBJECT: 5;
7
- readonly DEFAULT_CACHE_SIZE: 100;
8
- readonly DEFAULT_BATCH_SIZE: 10;
9
- };
10
- export declare const SIGNAL_TREE_MESSAGES: Readonly<{
11
- readonly NULL_OR_UNDEFINED: "null/undefined";
12
- readonly CIRCULAR_REF: "circular ref";
13
- readonly UPDATER_INVALID: "updater invalid";
14
- readonly LAZY_FALLBACK: "lazy fallback";
15
- readonly SIGNAL_CREATION_FAILED: "signal creation failed";
16
- readonly UPDATE_PATH_NOT_FOUND: "update path not found";
17
- readonly UPDATE_FAILED: "update failed";
18
- readonly ROLLBACK_FAILED: "rollback failed";
19
- readonly CLEANUP_ERROR: "cleanup error";
20
- readonly PRESET_UNKNOWN: "unknown preset";
21
- readonly STRATEGY_SELECTION: "strategy select";
22
- readonly TREE_DESTROYED: "destroyed";
23
- readonly UPDATE_TRANSACTION: "update tx";
24
- readonly BATCH_NOT_ENABLED: "batching disabled";
25
- readonly MEMOIZE_NOT_ENABLED: "memoize disabled";
26
- readonly MIDDLEWARE_NOT_AVAILABLE: "middleware missing";
27
- readonly ENTITY_HELPERS_NOT_AVAILABLE: "entity helpers missing";
28
- readonly TIME_TRAVEL_NOT_AVAILABLE: "time travel missing";
29
- readonly OPTIMIZE_NOT_AVAILABLE: "optimize missing";
30
- readonly UPDATE_OPTIMIZED_NOT_AVAILABLE: "update optimized missing";
31
- readonly CACHE_NOT_AVAILABLE: "cache missing";
32
- readonly PERFORMANCE_NOT_ENABLED: "performance disabled";
33
- readonly ENHANCER_ORDER_FAILED: "enhancer order failed";
34
- readonly ENHANCER_CYCLE_DETECTED: "enhancer cycle";
35
- readonly ENHANCER_REQUIREMENT_MISSING: "enhancer req missing";
36
- readonly ENHANCER_PROVIDES_MISSING: "enhancer provides missing";
37
- readonly ENHANCER_FAILED: "enhancer failed";
38
- readonly ENHANCER_NOT_FUNCTION: "enhancer not function";
39
- readonly EFFECT_NO_CONTEXT: "no angular context";
40
- readonly SUBSCRIBE_NO_CONTEXT: "no angular context";
41
- }>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,30 +0,0 @@
1
- import type { WritableSignal } from '@angular/core';
2
- export interface MemoryStats {
3
- cachedSignals: number;
4
- cleanedUpSignals: number;
5
- peakCachedSignals: number;
6
- manualDisposes: number;
7
- estimatedMemoryBytes: number;
8
- }
9
- export interface MemoryManagerConfig {
10
- enableAutoCleanup?: boolean;
11
- debugMode?: boolean;
12
- onCleanup?: (path: string, stats: MemoryStats) => void;
13
- }
14
- export declare class SignalMemoryManager {
15
- private cache;
16
- private registry;
17
- private config;
18
- private stats;
19
- constructor(config?: MemoryManagerConfig);
20
- cacheSignal<T>(path: string, signal: WritableSignal<T>): void;
21
- getSignal(path: string): WritableSignal<unknown> | undefined;
22
- hasSignal(path: string): boolean;
23
- removeSignal(path: string): boolean;
24
- private handleCleanup;
25
- getStats(): MemoryStats;
26
- dispose(): void;
27
- getCachedPaths(): string[];
28
- clearStale(): number;
29
- resetStats(): void;
30
- }
@@ -1,4 +0,0 @@
1
- export type PathNotifierInterceptor = (value: unknown, prev: unknown, path: string) => {
2
- block?: boolean;
3
- transform?: unknown;
4
- };
@@ -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,25 +0,0 @@
1
- import type { WritableSignal } from '@angular/core';
2
- export type PathSegment = string | number;
3
- export type Path = PathSegment[];
4
- export declare class PathIndex<T extends object = WritableSignal<any>> {
5
- private root;
6
- private pathCache;
7
- private stats;
8
- set(path: Path, signal: T): void;
9
- get(path: Path): T | null;
10
- has(path: Path): boolean;
11
- getByPrefix(prefix: Path): Map<string, T>;
12
- delete(path: Path): boolean;
13
- clear(): void;
14
- getStats(): {
15
- hits: number;
16
- misses: number;
17
- sets: number;
18
- cleanups: number;
19
- hitRate: number;
20
- cacheSize: number;
21
- };
22
- buildFromTree(tree: unknown, path?: Path): void;
23
- private pathToString;
24
- private collectDescendants;
25
- }
@@ -1,32 +0,0 @@
1
- import { PathIndex } from './path-index';
2
- import type { DiffOptions } from './diff-engine';
3
- export interface UpdateOptions extends DiffOptions {
4
- batch?: boolean;
5
- batchSize?: number;
6
- }
7
- export interface UpdateResult {
8
- changed: boolean;
9
- duration: number;
10
- changedPaths: string[];
11
- stats?: {
12
- totalPaths: number;
13
- optimizedPaths: number;
14
- batchedUpdates: number;
15
- };
16
- }
17
- export declare class OptimizedUpdateEngine {
18
- private pathIndex;
19
- private diffEngine;
20
- constructor(tree: unknown);
21
- update(tree: unknown, updates: unknown, options?: UpdateOptions): UpdateResult;
22
- rebuildIndex(tree: unknown): void;
23
- getIndexStats(): ReturnType<PathIndex['getStats']>;
24
- private createPatches;
25
- private createPatch;
26
- private calculatePriority;
27
- private sortPatches;
28
- private applyPatches;
29
- private batchApplyPatches;
30
- private applyPatch;
31
- private isEqual;
32
- }
@@ -1,33 +0,0 @@
1
- export type SecurityEventType = 'dangerous-key-blocked' | 'xss-attempt-blocked' | 'function-value-blocked' | 'validation-error';
2
- export interface SecurityEvent {
3
- type: SecurityEventType;
4
- key?: string;
5
- value?: unknown;
6
- reason: string;
7
- timestamp: number;
8
- }
9
- export interface SecurityValidatorConfig {
10
- preventPrototypePollution?: boolean;
11
- preventXSS?: boolean;
12
- preventFunctions?: boolean;
13
- customDangerousKeys?: string[];
14
- onSecurityEvent?: (event: SecurityEvent) => void;
15
- sanitizationMode?: 'strict' | 'permissive';
16
- }
17
- export declare class SecurityValidator {
18
- private readonly config;
19
- private readonly dangerousKeys;
20
- constructor(config?: SecurityValidatorConfig);
21
- validateKey(key: string): void;
22
- validateValue<T>(value: T): T;
23
- private sanitize;
24
- validateKeyValue<T>(key: string, value: T): T;
25
- isDangerousKey(key: string): boolean;
26
- getConfig(): Readonly<Required<SecurityValidatorConfig>>;
27
- }
28
- export declare const SecurityPresets: {
29
- strict: () => SecurityValidator;
30
- standard: () => SecurityValidator;
31
- permissive: () => SecurityValidator;
32
- disabled: () => SecurityValidator;
33
- };
@@ -1,8 +0,0 @@
1
- import type { SignalTree, TreeConfig, TreePreset, EnhancerWithMeta, NodeAccessor } from './types';
2
- export declare function isNodeAccessor(value: unknown): value is NodeAccessor<unknown>;
3
- export declare function signalTree<T>(obj: T): SignalTree<T>;
4
- export declare function signalTree<T>(obj: T, preset: TreePreset): SignalTree<T>;
5
- export declare function signalTree<T>(obj: T, config: TreeConfig): SignalTree<T>;
6
- export declare function signalTree<T extends Record<string, unknown>>(obj: Required<T>, configOrPreset?: TreeConfig | TreePreset): SignalTree<Required<T>>;
7
- export declare function signalTree<T>(obj: T, configOrPreset?: TreeConfig | TreePreset): SignalTree<T>;
8
- export declare function applyEnhancer<T, O>(tree: SignalTree<T>, enhancer: EnhancerWithMeta<SignalTree<T>, O>): O;