/** * Rooms store actions using `createActionGroup`. */ import { createActionGroup, emptyProps, props } from '@ngrx/store'; import { Room, RoomSettings, ServerInfo, RoomPermissions, Channel } from '../../core/models'; export const RoomsActions = createActionGroup({ source: 'Rooms', events: { 'Load Rooms': emptyProps(), 'Load Rooms Success': props<{ rooms: Room[] }>(), 'Load Rooms Failure': props<{ error: string }>(), 'Search Servers': props<{ query: string }>(), 'Search Servers Success': props<{ servers: ServerInfo[] }>(), 'Search Servers Failure': props<{ error: string }>(), 'Create Room': props<{ name: string; description?: string; topic?: string; isPrivate?: boolean; password?: string }>(), 'Create Room Success': props<{ room: Room }>(), 'Create Room Failure': props<{ error: string }>(), 'Join Room': props<{ roomId: string; password?: string; serverInfo?: { name: string; description?: string; hostName?: string } }>(), 'Join Room Success': props<{ room: Room }>(), 'Join Room Failure': props<{ error: string }>(), 'Leave Room': emptyProps(), 'Leave Room Success': emptyProps(), 'View Server': props<{ room: Room }>(), 'View Server Success': props<{ room: Room }>(), 'Delete Room': props<{ roomId: string }>(), 'Delete Room Success': props<{ roomId: string }>(), 'Forget Room': props<{ roomId: string }>(), 'Forget Room Success': props<{ roomId: string }>(), 'Update Room Settings': props<{ settings: Partial }>(), 'Update Room Settings Success': props<{ settings: RoomSettings }>(), 'Update Room Settings Failure': props<{ error: string }>(), 'Update Room Permissions': props<{ roomId: string; permissions: Partial }>(), 'Update Server Icon': props<{ roomId: string; icon: string }>(), 'Update Server Icon Success': props<{ roomId: string; icon: string; iconUpdatedAt: number }>(), 'Update Server Icon Failure': props<{ error: string }>(), 'Set Current Room': props<{ room: Room }>(), 'Clear Current Room': emptyProps(), 'Update Room': props<{ roomId: string; changes: Partial }>(), 'Receive Room Update': props<{ room: Partial }>(), 'Select Channel': props<{ channelId: string }>(), 'Add Channel': props<{ channel: Channel }>(), 'Remove Channel': props<{ channelId: string }>(), 'Rename Channel': props<{ channelId: string; name: string }>(), 'Clear Search Results': emptyProps(), 'Set Connecting': props<{ isConnecting: boolean }>() } });