refactor: auth login event (#17934)

This commit is contained in:
Jason Rasmussen 2025-04-28 14:13:14 -04:00 committed by GitHub
parent 64e738f79d
commit f64e6f5dc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 24 additions and 16 deletions

View file

@ -1,3 +1,5 @@
import type { LoginResponseDto } from '@immich/sdk';
type Listener<EventMap extends Record<string, unknown[]>, K extends keyof EventMap> = (...params: EventMap[K]) => void;
class EventManager<EventMap extends Record<string, unknown[]>> {
@ -50,6 +52,7 @@ class EventManager<EventMap extends Record<string, unknown[]>> {
export const eventManager = new EventManager<{
'user.login': [];
'auth.login': [LoginResponseDto];
'auth.logout': [];
'language.change': [{ name: string; code: string; rtl?: boolean }];
}>();