@signaltree/core 6.0.3 → 6.0.6
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/enhancers/batching/batching.d.ts +5 -5
- package/src/enhancers/devtools/devtools.d.ts +4 -4
- package/src/enhancers/effects/effects.d.ts +3 -3
- package/src/enhancers/entities/entities.d.ts +3 -3
- package/src/enhancers/memoization/memoization.d.ts +10 -10
- package/src/enhancers/serialization/serialization.d.ts +5 -5
- package/src/enhancers/time-travel/time-travel.d.ts +6 -6
- package/src/lib/presets.d.ts +1 -1
- package/src/lib/types.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signaltree/core",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.6",
|
|
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,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ISignalTree,
|
|
1
|
+
import type { ISignalTree, BatchingConfig } from '../../lib/types';
|
|
2
2
|
export type BatchingMethods<T> = import('../../lib/types').BatchingMethods<T>;
|
|
3
|
-
export declare function batchingWithConfig
|
|
4
|
-
export declare function batching(config?: BatchingConfig): <
|
|
5
|
-
export declare function highPerformanceBatching<T>(
|
|
3
|
+
export declare function batchingWithConfig(config?: BatchingConfig): <T>(tree: ISignalTree<T>) => ISignalTree<T> & BatchingMethods<T>;
|
|
4
|
+
export declare function batching(config?: BatchingConfig): <T>(tree: ISignalTree<T>) => ISignalTree<T> & BatchingMethods<T>;
|
|
5
|
+
export declare function highPerformanceBatching(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & BatchingMethods<T>;
|
|
6
6
|
export declare function flushBatchedUpdates(): void;
|
|
7
7
|
export declare function hasPendingUpdates(): boolean;
|
|
8
8
|
export declare function getBatchQueueSize(): number;
|
|
9
|
-
export declare const withBatching: ((config?: BatchingConfig) =>
|
|
9
|
+
export declare const withBatching: ((config?: BatchingConfig) => <T>(tree: ISignalTree<T>) => ISignalTree<T> & BatchingMethods<T>) & {
|
|
10
10
|
highPerformance: typeof highPerformanceBatching;
|
|
11
11
|
};
|
|
@@ -57,10 +57,10 @@ export interface ModularDevToolsInterface {
|
|
|
57
57
|
}>;
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
export declare function devTools(config?: DevToolsConfig): <
|
|
61
|
-
export declare function enableDevTools(treeName?: string): <
|
|
62
|
-
export declare function fullDevTools(treeName?: string): <
|
|
63
|
-
export declare function productionDevTools(): <
|
|
60
|
+
export declare function devTools(config?: DevToolsConfig): <T>(tree: ISignalTree<T>) => ISignalTree<T> & DevToolsMethods;
|
|
61
|
+
export declare function enableDevTools(treeName?: string): <T>(tree: ISignalTree<T>) => ISignalTree<T> & DevToolsMethods;
|
|
62
|
+
export declare function fullDevTools(treeName?: string): <T>(tree: ISignalTree<T>) => ISignalTree<T> & DevToolsMethods;
|
|
63
|
+
export declare function productionDevTools(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & DevToolsMethods;
|
|
64
64
|
export declare const withDevTools: typeof devTools & {
|
|
65
65
|
production: typeof productionDevTools;
|
|
66
66
|
full: typeof fullDevTools;
|
|
@@ -2,8 +2,8 @@ import type { ISignalTree, EffectsMethods } from '../../lib/types';
|
|
|
2
2
|
export interface EffectsConfig {
|
|
3
3
|
enabled?: boolean;
|
|
4
4
|
}
|
|
5
|
-
export declare function effects(config?: EffectsConfig): <
|
|
6
|
-
export declare function enableEffects(): <
|
|
7
|
-
export declare const withEffects: ((config?: EffectsConfig) => <
|
|
5
|
+
export declare function effects(config?: EffectsConfig): <T>(tree: ISignalTree<T>) => ISignalTree<T> & EffectsMethods<T>;
|
|
6
|
+
export declare function enableEffects(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & EffectsMethods<T>;
|
|
7
|
+
export declare const withEffects: ((config?: EffectsConfig) => <T>(tree: ISignalTree<T>) => ISignalTree<T> & EffectsMethods<T>) & {
|
|
8
8
|
enable: typeof enableEffects;
|
|
9
9
|
};
|
|
@@ -2,9 +2,9 @@ import type { ISignalTree, EntitiesEnabled } from '../../lib/types';
|
|
|
2
2
|
export interface EntitiesEnhancerConfig {
|
|
3
3
|
enabled?: boolean;
|
|
4
4
|
}
|
|
5
|
-
export declare function entities(config?: EntitiesEnhancerConfig): <
|
|
6
|
-
export declare function enableEntities(): <
|
|
7
|
-
export declare function highPerformanceEntities(): <
|
|
5
|
+
export declare function entities(config?: EntitiesEnhancerConfig): <T>(tree: ISignalTree<T>) => ISignalTree<T> & EntitiesEnabled;
|
|
6
|
+
export declare function enableEntities(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & EntitiesEnabled;
|
|
7
|
+
export declare function highPerformanceEntities(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & EntitiesEnabled;
|
|
8
8
|
export declare const withEntities: typeof entities & {
|
|
9
9
|
highPerformance: typeof highPerformanceEntities;
|
|
10
10
|
enable: typeof enableEntities;
|
|
@@ -30,21 +30,21 @@ export declare const MEMOIZATION_PRESETS: {
|
|
|
30
30
|
readonly ttl: undefined;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
-
export declare function selectorMemoization(): <
|
|
34
|
-
export declare function computedMemoization(): <
|
|
35
|
-
export declare function deepStateMemoization(): <
|
|
36
|
-
export declare function highFrequencyMemoization(): <
|
|
37
|
-
export declare const withMemoization: ((config?: MemoizationConfig) => <
|
|
33
|
+
export declare function selectorMemoization(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & MemoizationMethods<T>;
|
|
34
|
+
export declare function computedMemoization(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & MemoizationMethods<T>;
|
|
35
|
+
export declare function deepStateMemoization(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & MemoizationMethods<T>;
|
|
36
|
+
export declare function highFrequencyMemoization(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & MemoizationMethods<T>;
|
|
37
|
+
export declare const withMemoization: ((config?: MemoizationConfig) => <T>(tree: ISignalTree<T>) => ISignalTree<T> & MemoizationMethods<T>) & {
|
|
38
38
|
selector: typeof selectorMemoization;
|
|
39
39
|
computed: typeof computedMemoization;
|
|
40
40
|
deep: typeof deepStateMemoization;
|
|
41
41
|
fast: typeof highFrequencyMemoization;
|
|
42
42
|
};
|
|
43
|
-
export declare function memoization(config?: MemoizationConfig): <
|
|
44
|
-
export declare function enableMemoization(): <
|
|
45
|
-
export declare function highPerformanceMemoization(): <
|
|
46
|
-
export declare function lightweightMemoization(): <
|
|
47
|
-
export declare function shallowMemoization(): <
|
|
43
|
+
export declare function memoization(config?: MemoizationConfig): <T>(tree: ISignalTree<T>) => ISignalTree<T> & MemoizationMethods<T>;
|
|
44
|
+
export declare function enableMemoization(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & MemoizationMethods<T>;
|
|
45
|
+
export declare function highPerformanceMemoization(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & MemoizationMethods<T>;
|
|
46
|
+
export declare function lightweightMemoization(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & MemoizationMethods<T>;
|
|
47
|
+
export declare function shallowMemoization(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & MemoizationMethods<T>;
|
|
48
48
|
export declare function clearAllCaches(): void;
|
|
49
49
|
export declare function getGlobalCacheStats(): {
|
|
50
50
|
treeCount: number;
|
|
@@ -44,9 +44,9 @@ export interface PersistenceMethods {
|
|
|
44
44
|
clear(): Promise<void>;
|
|
45
45
|
__flushAutoSave?: () => Promise<void>;
|
|
46
46
|
}
|
|
47
|
-
export declare function serialization(defaultConfig?: SerializationConfig): <
|
|
48
|
-
export declare const withSerialization: (defaultConfig?: SerializationConfig) => <
|
|
49
|
-
export declare function enableSerialization(): <
|
|
47
|
+
export declare function serialization(defaultConfig?: SerializationConfig): <T>(tree: ISignalTree<T>) => ISignalTree<T> & SerializationMethods;
|
|
48
|
+
export declare const withSerialization: (defaultConfig?: SerializationConfig) => <T>(tree: ISignalTree<T>) => ISignalTree<T> & SerializationMethods;
|
|
49
|
+
export declare function enableSerialization(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & SerializationMethods;
|
|
50
50
|
export interface StorageAdapter {
|
|
51
51
|
getItem(key: string): string | null | Promise<string | null>;
|
|
52
52
|
setItem(key: string, value: string): void | Promise<void>;
|
|
@@ -60,8 +60,8 @@ export interface PersistenceConfig extends SerializationConfig {
|
|
|
60
60
|
autoLoad?: boolean;
|
|
61
61
|
skipCache?: boolean;
|
|
62
62
|
}
|
|
63
|
-
export declare function persistence(config: PersistenceConfig): <
|
|
64
|
-
export declare const withPersistence: (cfg: PersistenceConfig) => <
|
|
63
|
+
export declare function persistence(config: PersistenceConfig): <T>(tree: ISignalTree<T>) => ISignalTree<T> & SerializationMethods & PersistenceMethods;
|
|
64
|
+
export declare const withPersistence: (cfg: PersistenceConfig) => <T>(tree: ISignalTree<T>) => ISignalTree<T> & SerializationMethods & PersistenceMethods;
|
|
65
65
|
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;
|
|
66
66
|
export declare function createIndexedDBAdapter(dbName?: string, storeName?: string): StorageAdapter;
|
|
67
67
|
export declare function applySerialization<T extends Record<string, unknown>>(tree: ISignalTree<T>): ISignalTree<T> & SerializationMethods;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ISignalTree, TimeTravelMethods, TimeTravelConfig, TimeTravelEntry } from '../../lib/types';
|
|
2
2
|
export type { TimeTravelConfig, TimeTravelEntry };
|
|
3
|
-
export declare function timeTravel(config?: TimeTravelConfig): <
|
|
4
|
-
export declare function enableTimeTravel(): <
|
|
5
|
-
export declare function timeTravelHistory(maxHistorySize: number): <
|
|
6
|
-
export declare const withTimeTravel: ((config?: TimeTravelConfig) => <
|
|
7
|
-
minimal: () => <
|
|
8
|
-
debug: () => <
|
|
3
|
+
export declare function timeTravel(config?: TimeTravelConfig): <T>(tree: ISignalTree<T>) => ISignalTree<T> & TimeTravelMethods<T>;
|
|
4
|
+
export declare function enableTimeTravel(): <T>(tree: ISignalTree<T>) => ISignalTree<T> & TimeTravelMethods<T>;
|
|
5
|
+
export declare function timeTravelHistory(maxHistorySize: number): <T>(tree: ISignalTree<T>) => ISignalTree<T> & TimeTravelMethods<T>;
|
|
6
|
+
export declare const withTimeTravel: ((config?: TimeTravelConfig) => <T>(tree: ISignalTree<T>) => ISignalTree<T> & TimeTravelMethods<T>) & {
|
|
7
|
+
minimal: () => <T>(tree: ISignalTree<T>) => ISignalTree<T> & TimeTravelMethods<T>;
|
|
8
|
+
debug: () => <T>(tree: ISignalTree<T>) => ISignalTree<T> & TimeTravelMethods<T>;
|
|
9
9
|
history: typeof timeTravelHistory;
|
|
10
10
|
};
|
package/src/lib/presets.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export type ProdSignalTree<T> = ISignalTree<T> & EffectsMethods<T> & BatchingMet
|
|
|
21
21
|
export type MinimalSignalTree<T> = ISignalTree<T> & EffectsMethods<T>;
|
|
22
22
|
export declare function createDevTree<T extends object>(initialState: T, config?: DevTreeConfig): FullSignalTree<T>;
|
|
23
23
|
export declare function createDevTree(): {
|
|
24
|
-
enhancer: <
|
|
24
|
+
enhancer: <T>(tree: ISignalTree<T>) => ISignalTree<T> & EffectsMethods<T> & BatchingMethods<T> & MemoizationMethods<T> & EntitiesEnabled & TimeTravelMethods<T> & DevToolsMethods;
|
|
25
25
|
};
|
|
26
26
|
export declare function createProdTree<T extends object>(initialState: T, config?: ProdTreeConfig): ProdSignalTree<T>;
|
|
27
27
|
export declare function createMinimalTree<T extends object>(initialState: T, config?: MinimalTreeConfig): MinimalSignalTree<T>;
|
package/src/lib/types.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export type TreeNode<T> = {
|
|
|
37
37
|
export interface ISignalTree<T> extends NodeAccessor<T> {
|
|
38
38
|
readonly state: TreeNode<T>;
|
|
39
39
|
readonly $: TreeNode<T>;
|
|
40
|
-
with<
|
|
40
|
+
with<E extends (tree: this) => any>(enhancer: E): this & Omit<ReturnType<E>, keyof ISignalTree<T>>;
|
|
41
41
|
bind(thisArg?: unknown): NodeAccessor<T>;
|
|
42
42
|
destroy(): void;
|
|
43
43
|
}
|
|
@@ -282,7 +282,7 @@ export type CallableWritableSignal<T> = WritableSignal<T> & {
|
|
|
282
282
|
};
|
|
283
283
|
export type AccessibleNode<T> = NodeAccessor<T> & TreeNode<T>;
|
|
284
284
|
export declare const ENHANCER_META: unique symbol;
|
|
285
|
-
export type Enhancer<TAdded> = <
|
|
285
|
+
export type Enhancer<TAdded> = <T>(tree: ISignalTree<T>) => ISignalTree<T> & TAdded;
|
|
286
286
|
export type EnhancerWithMeta<TAdded> = Enhancer<TAdded> & {
|
|
287
287
|
metadata?: EnhancerMeta;
|
|
288
288
|
};
|