@@ -5,9 +5,7 @@ import { IsKnownRecord, Prettify } from './ts-helpers';
55
66export type SignalStoreConfig = { providedIn : 'root' } ;
77
8- export type SignalStoreSlices < State > = IsKnownRecord <
9- Prettify < State >
10- > extends true
8+ export type StateSignals < State > = IsKnownRecord < Prettify < State > > extends true
119 ? {
1210 [ Key in keyof State ] : IsKnownRecord < State [ Key ] > extends true
1311 ? DeepSignal < State [ Key ] >
@@ -17,8 +15,8 @@ export type SignalStoreSlices<State> = IsKnownRecord<
1715
1816export type SignalStoreProps < FeatureResult extends SignalStoreFeatureResult > =
1917 Prettify <
20- SignalStoreSlices < FeatureResult [ 'state' ] > &
21- FeatureResult [ 'signals ' ] &
18+ StateSignals < FeatureResult [ 'state' ] > &
19+ FeatureResult [ 'computed ' ] &
2220 FeatureResult [ 'methods' ]
2321 > ;
2422
@@ -33,29 +31,29 @@ export type SignalStoreHooks = {
3331
3432export type InnerSignalStore <
3533 State extends object = object ,
36- Signals extends SignalsDictionary = SignalsDictionary ,
34+ ComputedSignals extends SignalsDictionary = SignalsDictionary ,
3735 Methods extends MethodsDictionary = MethodsDictionary
3836> = {
39- slices : SignalStoreSlices < State > ;
40- signals : Signals ;
37+ stateSignals : StateSignals < State > ;
38+ computedSignals : ComputedSignals ;
4139 methods : Methods ;
4240 hooks : SignalStoreHooks ;
4341} & StateSignal < State > ;
4442
4543export type SignalStoreFeatureResult = {
4644 state : object ;
47- signals : SignalsDictionary ;
45+ computed : SignalsDictionary ;
4846 methods : MethodsDictionary ;
4947} ;
5048
51- export type EmptyFeatureResult = { state : { } ; signals : { } ; methods : { } } ;
49+ export type EmptyFeatureResult = { state : { } ; computed : { } ; methods : { } } ;
5250
5351export type SignalStoreFeature <
5452 Input extends SignalStoreFeatureResult = SignalStoreFeatureResult ,
5553 Output extends SignalStoreFeatureResult = SignalStoreFeatureResult
5654> = (
57- store : InnerSignalStore < Input [ 'state' ] , Input [ 'signals ' ] , Input [ 'methods' ] >
58- ) => InnerSignalStore < Output [ 'state' ] , Output [ 'signals ' ] , Output [ 'methods' ] > ;
55+ store : InnerSignalStore < Input [ 'state' ] , Input [ 'computed ' ] , Input [ 'methods' ] >
56+ ) => InnerSignalStore < Output [ 'state' ] , Output [ 'computed ' ] , Output [ 'methods' ] > ;
5957
6058export type MergeFeatureResults <
6159 FeatureResults extends SignalStoreFeatureResult [ ]
@@ -78,14 +76,14 @@ export type MergeFeatureResults<
7876
7977type FeatureResultKeys < FeatureResult extends SignalStoreFeatureResult > =
8078 | keyof FeatureResult [ 'state' ]
81- | keyof FeatureResult [ 'signals ' ]
79+ | keyof FeatureResult [ 'computed ' ]
8280 | keyof FeatureResult [ 'methods' ] ;
8381
8482type MergeTwoFeatureResults <
8583 First extends SignalStoreFeatureResult ,
8684 Second extends SignalStoreFeatureResult
8785> = {
8886 state : Omit < First [ 'state' ] , FeatureResultKeys < Second > > ;
89- signals : Omit < First [ 'signals ' ] , FeatureResultKeys < Second > > ;
87+ computed : Omit < First [ 'computed ' ] , FeatureResultKeys < Second > > ;
9088 methods : Omit < First [ 'methods' ] , FeatureResultKeys < Second > > ;
9189} & Second ;
0 commit comments