diff --git a/modules/signals/spec/patch-state.spec.ts b/modules/signals/spec/patch-state.spec.ts index c5fca6031d..66aab99e66 100644 --- a/modules/signals/spec/patch-state.spec.ts +++ b/modules/signals/spec/patch-state.spec.ts @@ -1,5 +1,5 @@ import { patchState, signalState, signalStore, withState } from '../src'; -import { STATE_SIGNAL } from '../src/signal-state'; +import { STATE_SIGNAL } from '../src/state-signal'; describe('patchState', () => { const initialState = { diff --git a/modules/signals/spec/signal-state.spec.ts b/modules/signals/spec/signal-state.spec.ts index e83ba934e3..18e0a66ec4 100644 --- a/modules/signals/spec/signal-state.spec.ts +++ b/modules/signals/spec/signal-state.spec.ts @@ -1,8 +1,8 @@ -import { effect, isSignal } from '@angular/core'; import * as angular from '@angular/core'; +import { effect, isSignal } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { patchState, signalState } from '../src'; -import { STATE_SIGNAL } from '../src/signal-state'; +import { STATE_SIGNAL } from '../src/state-signal'; describe('signalState', () => { const initialState = { diff --git a/modules/signals/spec/signal-store-feature.spec.ts b/modules/signals/spec/signal-store-feature.spec.ts index 344045e9cb..a8d8b8d4b1 100644 --- a/modules/signals/spec/signal-store-feature.spec.ts +++ b/modules/signals/spec/signal-store-feature.spec.ts @@ -7,7 +7,7 @@ import { withMethods, withState, } from '../src'; -import { STATE_SIGNAL } from '../src/signal-state'; +import { STATE_SIGNAL } from '../src/state-signal'; describe('signalStoreFeature', () => { function withCustomFeature1() { diff --git a/modules/signals/spec/signal-store.spec.ts b/modules/signals/spec/signal-store.spec.ts index f3e7850d77..39a6e79db8 100644 --- a/modules/signals/spec/signal-store.spec.ts +++ b/modules/signals/spec/signal-store.spec.ts @@ -8,7 +8,7 @@ import { withMethods, withState, } from '../src'; -import { STATE_SIGNAL } from '../src/signal-state'; +import { STATE_SIGNAL } from '../src/state-signal'; import { createLocalService } from './helpers'; describe('signalStore', () => { diff --git a/modules/signals/spec/types/signal-store.types.spec.ts b/modules/signals/spec/types/signal-store.types.spec.ts index 7db7762f44..5456f4e78f 100644 --- a/modules/signals/spec/types/signal-store.types.spec.ts +++ b/modules/signals/spec/types/signal-store.types.spec.ts @@ -33,7 +33,7 @@ describe('signalStore', () => { expectSnippet(snippet).toInfer( 'Store', - 'Type<{ foo: Signal; bar: Signal; [STATE_SIGNAL]: WritableSignal<{ foo: string; bar: number[]; }>; }>' + 'Type<{ foo: Signal; bar: Signal; } & StateSignal<{ foo: string; bar: number[]; }>>' ); }); @@ -63,7 +63,7 @@ describe('signalStore', () => { expectSnippet(snippet).toInfer( 'store', - '{ user: DeepSignal<{ age: number; details: { first: string; flags: boolean[]; }; }>; [STATE_SIGNAL]: WritableSignal<{ user: { age: number; details: { first: string; flags: boolean[]; }; }; }>; }' + '{ user: DeepSignal<{ age: number; details: { first: string; flags: boolean[]; }; }>; } & StateSignal<{ user: { age: number; details: { first: string; flags: boolean[]; }; }; }>' ); expectSnippet(snippet).toInfer( @@ -203,10 +203,7 @@ describe('signalStore', () => { expectSnippet(snippet).toSucceed(); - expectSnippet(snippet).toInfer( - 'Store', - 'Type<{ [STATE_SIGNAL]: WritableSignal<{}>; }>' - ); + expectSnippet(snippet).toInfer('Store', 'Type<{} & StateSignal<{}>>'); }); it('succeeds when state slices are union types', () => { @@ -237,7 +234,7 @@ describe('signalStore', () => { expectSnippet(snippet).toInfer( 'store', - '{ foo: Signal; bar: DeepSignal<{ baz: { b: boolean; } | null; }>; x: DeepSignal<{ y: { z: number | undefined; }; }>; [STATE_SIGNAL]: WritableSignal<...>; }' + '{ foo: Signal; bar: DeepSignal<{ baz: { b: boolean; } | null; }>; x: DeepSignal<{ y: { z: number | undefined; }; }>; } & StateSignal<{ foo: number | { ...; }; bar: { ...; }; x: { ...; }; }>' ); expectSnippet(snippet).toInfer('foo', 'Signal'); @@ -277,7 +274,7 @@ describe('signalStore', () => { expectSnippet(snippet1).toInfer( 'Store', - 'Type<{ name: DeepSignal<{ x: { y: string; }; }>; arguments: Signal; call: Signal; [STATE_SIGNAL]: WritableSignal<{ name: { x: { y: string; }; }; arguments: number[]; call: boolean; }>; }>' + 'Type<{ name: DeepSignal<{ x: { y: string; }; }>; arguments: Signal; call: Signal; } & StateSignal<{ name: { x: { y: string; }; }; arguments: number[]; call: boolean; }>>' ); const snippet2 = ` @@ -294,7 +291,7 @@ describe('signalStore', () => { expectSnippet(snippet2).toInfer( 'Store', - ' Type<{ apply: Signal; bind: DeepSignal<{ foo: string; }>; prototype: Signal; [STATE_SIGNAL]: WritableSignal<{ apply: string; bind: { foo: string; }; prototype: string[]; }>; }>' + 'Type<{ apply: Signal; bind: DeepSignal<{ foo: string; }>; prototype: Signal; } & StateSignal<{ apply: string; bind: { foo: string; }; prototype: string[]; }>>' ); const snippet3 = ` @@ -310,7 +307,7 @@ describe('signalStore', () => { expectSnippet(snippet3).toInfer( 'Store', - 'Type<{ length: Signal; caller: Signal; [STATE_SIGNAL]: WritableSignal<{ length: number; caller: undefined; }>; }>' + 'Type<{ length: Signal; caller: Signal; } & StateSignal<{ length: number; caller: undefined; }>>' ); }); @@ -365,7 +362,7 @@ describe('signalStore', () => { expectSnippet(snippet).toInfer( 'store', - '{ bar: DeepSignal<{ baz?: number | undefined; }>; x: DeepSignal<{ y?: { z: boolean; } | undefined; }>; [STATE_SIGNAL]: WritableSignal<{ bar: { baz?: number | undefined; }; x: { y?: { ...; } | undefined; }; }>; }' + '{ bar: DeepSignal<{ baz?: number | undefined; }>; x: DeepSignal<{ y?: { z: boolean; } | undefined; }>; } & StateSignal<{ bar: { baz?: number | undefined; }; x: { y?: { z: boolean; } | undefined; }; }>' ); expectSnippet(snippet).toInfer( @@ -594,7 +591,7 @@ describe('signalStore', () => { expectSnippet(snippet).toInfer( 'store', - '{ ngrx: Signal; x: DeepSignal<{ y: string; }>; signals: Signal; mgmt: (arg: boolean) => number; [STATE_SIGNAL]: WritableSignal<{ ngrx: string; x: { y: string; }; }>; }' + '{ ngrx: Signal; x: DeepSignal<{ y: string; }>; signals: Signal; mgmt: (arg: boolean) => number; } & StateSignal<{ ngrx: string; x: { y: string; }; }>' ); }); @@ -622,7 +619,7 @@ describe('signalStore', () => { expectSnippet(snippet).toInfer( 'store', - '{ foo: Signal; bar: Signal; baz: (x: number) => void; [STATE_SIGNAL]: WritableSignal<{ foo: number; }>; }' + '{ foo: Signal; bar: Signal; baz: (x: number) => void; } & StateSignal<{ foo: number; }>' ); }); diff --git a/modules/signals/spec/with-state.spec.ts b/modules/signals/spec/with-state.spec.ts index e00cb13b43..0a07b82c6f 100644 --- a/modules/signals/spec/with-state.spec.ts +++ b/modules/signals/spec/with-state.spec.ts @@ -1,6 +1,6 @@ import { isSignal, signal } from '@angular/core'; import { withComputed, withMethods, withState } from '../src'; -import { STATE_SIGNAL } from '../src/signal-state'; +import { STATE_SIGNAL } from '../src/state-signal'; import { getInitialInnerStore } from '../src/signal-store'; describe('withState', () => { diff --git a/modules/signals/src/deep-signal.ts b/modules/signals/src/deep-signal.ts index a79400443b..733e085fc7 100644 --- a/modules/signals/src/deep-signal.ts +++ b/modules/signals/src/deep-signal.ts @@ -8,7 +8,7 @@ import { IsKnownRecord } from './ts-helpers'; // An extended Signal type that enables the correct typing // of nested signals with the `name` or `length` key. -interface Signal extends NgSignal { +export interface Signal extends NgSignal { name: unknown; length: unknown; } diff --git a/modules/signals/src/get-state.ts b/modules/signals/src/get-state.ts index 7ea73707d1..0d3c2b5d4a 100644 --- a/modules/signals/src/get-state.ts +++ b/modules/signals/src/get-state.ts @@ -1,7 +1,7 @@ -import { STATE_SIGNAL, SignalStateMeta } from './signal-state'; +import { STATE_SIGNAL, StateSignal } from './state-signal'; export function getState( - signalState: SignalStateMeta + stateSignal: StateSignal ): State { - return signalState[STATE_SIGNAL](); + return stateSignal[STATE_SIGNAL](); } diff --git a/modules/signals/src/patch-state.ts b/modules/signals/src/patch-state.ts index ac9dd268c1..ffd3867602 100644 --- a/modules/signals/src/patch-state.ts +++ b/modules/signals/src/patch-state.ts @@ -1,14 +1,14 @@ -import { STATE_SIGNAL, SignalStateMeta } from './signal-state'; +import { STATE_SIGNAL, StateSignal } from './state-signal'; export type PartialStateUpdater = ( state: State ) => Partial; export function patchState( - signalState: SignalStateMeta, + stateSignal: StateSignal, ...updaters: Array | PartialStateUpdater> ): void { - signalState[STATE_SIGNAL].update((currentState) => + stateSignal[STATE_SIGNAL].update((currentState) => updaters.reduce( (nextState: State, updater) => ({ ...nextState, diff --git a/modules/signals/src/signal-state.ts b/modules/signals/src/signal-state.ts index 6a3ae3bcd9..2083c901fb 100644 --- a/modules/signals/src/signal-state.ts +++ b/modules/signals/src/signal-state.ts @@ -1,14 +1,8 @@ -import { signal, WritableSignal } from '@angular/core'; +import { signal } from '@angular/core'; +import { STATE_SIGNAL, StateSignal } from './state-signal'; import { DeepSignal, toDeepSignal } from './deep-signal'; -export const STATE_SIGNAL = Symbol('STATE_SIGNAL'); - -export type SignalStateMeta = { - [STATE_SIGNAL]: WritableSignal; -}; - -type SignalState = DeepSignal & - SignalStateMeta; +type SignalState = DeepSignal & StateSignal; export function signalState( initialState: State diff --git a/modules/signals/src/signal-store-models.ts b/modules/signals/src/signal-store-models.ts index 88884abaf2..10ecc60767 100644 --- a/modules/signals/src/signal-store-models.ts +++ b/modules/signals/src/signal-store-models.ts @@ -1,6 +1,6 @@ import { Signal } from '@angular/core'; import { DeepSignal } from './deep-signal'; -import { SignalStateMeta } from './signal-state'; +import { StateSignal } from './state-signal'; import { IsKnownRecord, Prettify } from './ts-helpers'; export type SignalStoreConfig = { providedIn: 'root' }; @@ -15,12 +15,11 @@ export type SignalStoreSlices = IsKnownRecord< } : {}; -export type SignalStore = +export type SignalStoreProps = Prettify< SignalStoreSlices & FeatureResult['signals'] & - FeatureResult['methods'] & - SignalStateMeta> + FeatureResult['methods'] >; export type SignalsDictionary = Record>; @@ -41,7 +40,7 @@ export type InnerSignalStore< signals: Signals; methods: Methods; hooks: SignalStoreHooks; -} & SignalStateMeta; +} & StateSignal; export type SignalStoreFeatureResult = { state: object; @@ -61,7 +60,7 @@ export type SignalStoreFeature< export type MergeFeatureResults< FeatureResults extends SignalStoreFeatureResult[] > = FeatureResults extends [] - ? {} + ? EmptyFeatureResult : FeatureResults extends [infer First extends SignalStoreFeatureResult] ? First : FeatureResults extends [ diff --git a/modules/signals/src/signal-store.ts b/modules/signals/src/signal-store.ts index ad1ef55396..3125d3fc24 100644 --- a/modules/signals/src/signal-store.ts +++ b/modules/signals/src/signal-store.ts @@ -7,67 +7,75 @@ import { signal, Type, } from '@angular/core'; -import { STATE_SIGNAL } from './signal-state'; +import { STATE_SIGNAL, StateSignal } from './state-signal'; import { EmptyFeatureResult, InnerSignalStore, MergeFeatureResults, - SignalStore, + SignalStoreProps, SignalStoreConfig, SignalStoreFeature, SignalStoreFeatureResult, } from './signal-store-models'; +import { Prettify } from './ts-helpers'; export function signalStore( f1: SignalStoreFeature -): Type>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, - F2 extends SignalStoreFeatureResult + F2 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults<[F1, F2]> >( f1: SignalStoreFeature, f2: SignalStoreFeature<{} & F1, F2> -): Type>>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, F2 extends SignalStoreFeatureResult, - F3 extends SignalStoreFeatureResult + F3 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults<[F1, F2, F3]> >( f1: SignalStoreFeature, f2: SignalStoreFeature<{} & F1, F2>, f3: SignalStoreFeature, F3> -): Type>>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, F2 extends SignalStoreFeatureResult, F3 extends SignalStoreFeatureResult, - F4 extends SignalStoreFeatureResult + F4 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults<[F1, F2, F3, F4]> >( f1: SignalStoreFeature, f2: SignalStoreFeature<{} & F1, F2>, f3: SignalStoreFeature, F3>, f4: SignalStoreFeature, F4> -): Type>>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, F2 extends SignalStoreFeatureResult, F3 extends SignalStoreFeatureResult, F4 extends SignalStoreFeatureResult, - F5 extends SignalStoreFeatureResult + F5 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults<[F1, F2, F3, F4, F5]> >( f1: SignalStoreFeature, f2: SignalStoreFeature<{} & F1, F2>, f3: SignalStoreFeature, F3>, f4: SignalStoreFeature, F4>, f5: SignalStoreFeature, F5> -): Type>>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, F2 extends SignalStoreFeatureResult, F3 extends SignalStoreFeatureResult, F4 extends SignalStoreFeatureResult, F5 extends SignalStoreFeatureResult, - F6 extends SignalStoreFeatureResult + F6 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults< + [F1, F2, F3, F4, F5, F6] + > >( f1: SignalStoreFeature, f2: SignalStoreFeature<{} & F1, F2>, @@ -75,7 +83,7 @@ export function signalStore< f4: SignalStoreFeature, F4>, f5: SignalStoreFeature, F5>, f6: SignalStoreFeature, F6> -): Type>>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, F2 extends SignalStoreFeatureResult, @@ -83,7 +91,10 @@ export function signalStore< F4 extends SignalStoreFeatureResult, F5 extends SignalStoreFeatureResult, F6 extends SignalStoreFeatureResult, - F7 extends SignalStoreFeatureResult + F7 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults< + [F1, F2, F3, F4, F5, F6, F7] + > >( f1: SignalStoreFeature, f2: SignalStoreFeature<{} & F1, F2>, @@ -92,7 +103,7 @@ export function signalStore< f5: SignalStoreFeature, F5>, f6: SignalStoreFeature, F6>, f7: SignalStoreFeature, F7> -): Type>>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, F2 extends SignalStoreFeatureResult, @@ -101,7 +112,10 @@ export function signalStore< F5 extends SignalStoreFeatureResult, F6 extends SignalStoreFeatureResult, F7 extends SignalStoreFeatureResult, - F8 extends SignalStoreFeatureResult + F8 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults< + [F1, F2, F3, F4, F5, F6, F7, F8] + > >( f1: SignalStoreFeature, f2: SignalStoreFeature<{} & F1, F2>, @@ -111,7 +125,7 @@ export function signalStore< f6: SignalStoreFeature, F6>, f7: SignalStoreFeature, F7>, f8: SignalStoreFeature, F8> -): Type>>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, F2 extends SignalStoreFeatureResult, @@ -121,7 +135,10 @@ export function signalStore< F6 extends SignalStoreFeatureResult, F7 extends SignalStoreFeatureResult, F8 extends SignalStoreFeatureResult, - F9 extends SignalStoreFeatureResult + F9 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults< + [F1, F2, F3, F4, F5, F6, F7, F8, F9] + > >( f1: SignalStoreFeature, f2: SignalStoreFeature<{} & F1, F2>, @@ -135,48 +152,52 @@ export function signalStore< MergeFeatureResults<[F1, F2, F3, F4, F5, F6, F7, F8]>, F9 > -): Type>>; +): Type & StateSignal>>; export function signalStore( config: SignalStoreConfig, f1: SignalStoreFeature -): Type>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, - F2 extends SignalStoreFeatureResult + F2 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults<[F1, F2]> >( config: SignalStoreConfig, f1: SignalStoreFeature, f2: SignalStoreFeature<{} & F1, F2> -): Type>>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, F2 extends SignalStoreFeatureResult, - F3 extends SignalStoreFeatureResult + F3 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults<[F1, F2, F3]> >( config: SignalStoreConfig, f1: SignalStoreFeature, f2: SignalStoreFeature<{} & F1, F2>, f3: SignalStoreFeature, F3> -): Type>>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, F2 extends SignalStoreFeatureResult, F3 extends SignalStoreFeatureResult, - F4 extends SignalStoreFeatureResult + F4 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults<[F1, F2, F3, F4]> >( config: SignalStoreConfig, f1: SignalStoreFeature, f2: SignalStoreFeature<{} & F1, F2>, f3: SignalStoreFeature, F3>, f4: SignalStoreFeature, F4> -): Type>>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, F2 extends SignalStoreFeatureResult, F3 extends SignalStoreFeatureResult, F4 extends SignalStoreFeatureResult, - F5 extends SignalStoreFeatureResult + F5 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults<[F1, F2, F3, F4, F5]> >( config: SignalStoreConfig, f1: SignalStoreFeature, @@ -184,14 +205,17 @@ export function signalStore< f3: SignalStoreFeature, F3>, f4: SignalStoreFeature, F4>, f5: SignalStoreFeature, F5> -): Type>>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, F2 extends SignalStoreFeatureResult, F3 extends SignalStoreFeatureResult, F4 extends SignalStoreFeatureResult, F5 extends SignalStoreFeatureResult, - F6 extends SignalStoreFeatureResult + F6 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults< + [F1, F2, F3, F4, F5, F6] + > >( config: SignalStoreConfig, f1: SignalStoreFeature, @@ -200,7 +224,7 @@ export function signalStore< f4: SignalStoreFeature, F4>, f5: SignalStoreFeature, F5>, f6: SignalStoreFeature, F6> -): Type>>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, F2 extends SignalStoreFeatureResult, @@ -208,7 +232,10 @@ export function signalStore< F4 extends SignalStoreFeatureResult, F5 extends SignalStoreFeatureResult, F6 extends SignalStoreFeatureResult, - F7 extends SignalStoreFeatureResult + F7 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults< + [F1, F2, F3, F4, F5, F6, F7] + > >( config: SignalStoreConfig, f1: SignalStoreFeature, @@ -218,7 +245,7 @@ export function signalStore< f5: SignalStoreFeature, F5>, f6: SignalStoreFeature, F6>, f7: SignalStoreFeature, F7> -): Type>>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, F2 extends SignalStoreFeatureResult, @@ -227,7 +254,10 @@ export function signalStore< F5 extends SignalStoreFeatureResult, F6 extends SignalStoreFeatureResult, F7 extends SignalStoreFeatureResult, - F8 extends SignalStoreFeatureResult + F8 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults< + [F1, F2, F3, F4, F5, F6, F7, F8] + > >( config: SignalStoreConfig, f1: SignalStoreFeature, @@ -238,7 +268,7 @@ export function signalStore< f6: SignalStoreFeature, F6>, f7: SignalStoreFeature, F7>, f8: SignalStoreFeature, F8> -): Type>>; +): Type & StateSignal>>; export function signalStore< F1 extends SignalStoreFeatureResult, F2 extends SignalStoreFeatureResult, @@ -248,7 +278,10 @@ export function signalStore< F6 extends SignalStoreFeatureResult, F7 extends SignalStoreFeatureResult, F8 extends SignalStoreFeatureResult, - F9 extends SignalStoreFeatureResult + F9 extends SignalStoreFeatureResult, + R extends SignalStoreFeatureResult = MergeFeatureResults< + [F1, F2, F3, F4, F5, F6, F7, F8, F9] + > >( config: SignalStoreConfig, f1: SignalStoreFeature, @@ -263,11 +296,11 @@ export function signalStore< MergeFeatureResults<[F1, F2, F3, F4, F5, F6, F7, F8]>, F9 > -): Type>>; +): Type & StateSignal>>; export function signalStore( ...args: [SignalStoreConfig, ...SignalStoreFeature[]] | SignalStoreFeature[] -): Type> { +): Type> { const signalStoreArgs = [...args]; const config: Partial = diff --git a/modules/signals/src/state-signal.ts b/modules/signals/src/state-signal.ts new file mode 100644 index 0000000000..2aca78db0c --- /dev/null +++ b/modules/signals/src/state-signal.ts @@ -0,0 +1,7 @@ +import { WritableSignal } from '@angular/core'; + +export const STATE_SIGNAL = Symbol('STATE_SIGNAL'); + +export type StateSignal = { + [STATE_SIGNAL]: WritableSignal; +}; diff --git a/modules/signals/src/with-hooks.ts b/modules/signals/src/with-hooks.ts index 41c386f184..a927e0a2e7 100644 --- a/modules/signals/src/with-hooks.ts +++ b/modules/signals/src/with-hooks.ts @@ -1,9 +1,9 @@ -import { STATE_SIGNAL, SignalStateMeta } from './signal-state'; +import { STATE_SIGNAL, StateSignal } from './state-signal'; import { EmptyFeatureResult, SignalStoreFeature, - SignalStoreSlices, SignalStoreFeatureResult, + SignalStoreSlices, } from './signal-store-models'; import { Prettify } from './ts-helpers'; @@ -12,7 +12,7 @@ type HooksFactory = ( SignalStoreSlices & Input['signals'] & Input['methods'] & - SignalStateMeta> + StateSignal> > ) => void; diff --git a/modules/signals/src/with-methods.ts b/modules/signals/src/with-methods.ts index 45b43b87f3..3c54e8a346 100644 --- a/modules/signals/src/with-methods.ts +++ b/modules/signals/src/with-methods.ts @@ -1,5 +1,5 @@ import { excludeKeys } from './helpers'; -import { STATE_SIGNAL, SignalStateMeta } from './signal-state'; +import { STATE_SIGNAL, StateSignal } from './state-signal'; import { EmptyFeatureResult, InnerSignalStore, @@ -20,7 +20,7 @@ export function withMethods< SignalStoreSlices & Input['signals'] & Input['methods'] & - SignalStateMeta> + StateSignal> > ) => Methods ): SignalStoreFeature { diff --git a/modules/signals/src/with-state.ts b/modules/signals/src/with-state.ts index 6cfe2f06e6..c36af79989 100644 --- a/modules/signals/src/with-state.ts +++ b/modules/signals/src/with-state.ts @@ -1,7 +1,7 @@ import { computed } from '@angular/core'; import { toDeepSignal } from './deep-signal'; import { excludeKeys } from './helpers'; -import { STATE_SIGNAL } from './signal-state'; +import { STATE_SIGNAL } from './state-signal'; import { EmptyFeatureResult, InnerSignalStore,