@ngrx/signals v19 - signalStore is type any
Closed this issue · 1 comments
robvaneck commented
Which @ngrx/* package(s) are the source of the bug?
signals, store
Minimal reproduction of the bug/regression with instructions
{
"dependencies": {
"@ngrx/signals": "^19.0.0"
}
}
type DrawerMethods = {
mouseDown(): void;
mouseUp(): void;
mouseMove(x: number, y: number): void;
};
export const DrawerStore = signalStore(
withState(initialState),
withMethods((store): DrawerMethods => ({
mouseDown(): void {
patchState(store, () => ({ mousedown: true }));
},
mouseUp(): void {
patchState(store, () => ({ mousedown: false }));
},
mouseMove(x, y): void {
patchState(store, () => ({ currentCoords: { x, y } }));
},
}))
);
export class DrawerComponent {
readonly store = inject(DrawerStore);
}
Bug
(property) DrawerComponent.store: any
The signalStore isn't typed in version 19 for some reason?
Im using v18 on another project, there it is typed.
Expected behavior
I was expecting of type DrawerStore / DeepSignal etc.
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)
19
Other information
No response
I would be willing to submit a PR to fix this issue
- Yes
- No
rainerhahnekamp commented
Your code doesn't compile. mousedown
and currentCoords
are not part of the state. Maybe that's why your IDE is showing it as any
?