@signaltree/core 7.0.0 → 7.0.1
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/package.json +1 -1
- package/src/lib/markers/derived.d.ts +1 -0
- package/src/lib/path-notifier.d.ts +30 -0
- package/src/lib/utils.d.ts +16 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signaltree/core",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"description": "Lightweight, type-safe signal-based state management for Angular. Core package providing hierarchical signal trees, basic entity management, and async actions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -2,3 +2,33 @@ export type PathNotifierInterceptor = (value: unknown, prev: unknown, path: stri
|
|
|
2
2
|
block?: boolean;
|
|
3
3
|
transform?: unknown;
|
|
4
4
|
};
|
|
5
|
+
export declare class PathNotifier {
|
|
6
|
+
private subscribers;
|
|
7
|
+
private interceptors;
|
|
8
|
+
private batchingEnabled;
|
|
9
|
+
private pendingFlush;
|
|
10
|
+
private pending;
|
|
11
|
+
private firstValues;
|
|
12
|
+
private flushCallbacks;
|
|
13
|
+
constructor(options?: {
|
|
14
|
+
batching?: boolean;
|
|
15
|
+
});
|
|
16
|
+
setBatchingEnabled(enabled: boolean): void;
|
|
17
|
+
isBatchingEnabled(): boolean;
|
|
18
|
+
subscribe(pattern: string, handler: PathNotifierHandler): () => void;
|
|
19
|
+
intercept(pattern: string, interceptor: PathNotifierInterceptor): () => void;
|
|
20
|
+
notify(path: string, value: unknown, prev: unknown): {
|
|
21
|
+
blocked: boolean;
|
|
22
|
+
value: unknown;
|
|
23
|
+
};
|
|
24
|
+
private _runNotify;
|
|
25
|
+
private flush;
|
|
26
|
+
flushSync(): void;
|
|
27
|
+
onFlush(callback: () => void): () => void;
|
|
28
|
+
hasPending(): boolean;
|
|
29
|
+
private matches;
|
|
30
|
+
clear(): void;
|
|
31
|
+
getSubscriberCount(): number;
|
|
32
|
+
getInterceptorCount(): number;
|
|
33
|
+
}
|
|
34
|
+
export declare function getPathNotifier(): PathNotifier;
|
package/src/lib/utils.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { WritableSignal } from '@angular/core';
|
|
2
|
-
import { deepEqual, isBuiltInObject, parsePath } from '@signaltree/shared';
|
|
3
2
|
export { deepEqual };
|
|
4
3
|
export { deepEqual as equal };
|
|
5
4
|
export { isBuiltInObject };
|
|
@@ -11,6 +10,22 @@ export interface MemoryManager {
|
|
|
11
10
|
dispose(): void;
|
|
12
11
|
}
|
|
13
12
|
import type { NodeAccessor, TreeNode } from './types';
|
|
13
|
+
|
|
14
|
+
// Inlined from @signaltree/shared (internal package)
|
|
15
|
+
declare function deepEqual<T>(a: T, b: T): boolean;
|
|
16
|
+
declare function deepClone<T>(obj: T): T;
|
|
17
|
+
declare function isBuiltInObject(value: unknown): boolean;
|
|
18
|
+
declare function parsePath(path: string): string[];
|
|
19
|
+
declare class LRUCache<K, V> {
|
|
20
|
+
constructor(maxSize: number);
|
|
21
|
+
get(key: K): V | undefined;
|
|
22
|
+
set(key: K, value: V): void;
|
|
23
|
+
has(key: K): boolean;
|
|
24
|
+
delete(key: K): boolean;
|
|
25
|
+
clear(): void;
|
|
26
|
+
get size(): number;
|
|
27
|
+
}
|
|
28
|
+
declare const DEFAULT_PATH_CACHE_SIZE: number;
|
|
14
29
|
export declare function isNodeAccessor(value: unknown): value is NodeAccessor<unknown>;
|
|
15
30
|
export declare function isAnySignal(value: unknown): boolean;
|
|
16
31
|
export declare function toWritableSignal<T>(node: NodeAccessor<T>, injector?: unknown): WritableSignal<T>;
|