Move toju-app into own its folder

This commit is contained in:
2026-03-29 23:30:37 +02:00
parent 0467a7b612
commit 8162e0444a
287 changed files with 42 additions and 34 deletions

View File

@@ -0,0 +1,82 @@
/**
* Rooms store actions using `createActionGroup`.
*/
import {
createActionGroup,
emptyProps,
props
} from '@ngrx/store';
import {
Room,
RoomSettings,
RoomPermissions,
Channel
} from '../../shared-kernel';
import { type ServerInfo } from '../../domains/server-directory';
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;
sourceId?: string;
sourceUrl?: string;
}>(),
'Create Room Success': props<{ room: Room }>(),
'Create Room Failure': props<{ error: string }>(),
'Join Room': props<{ roomId: string; password?: string; serverInfo?: Partial<ServerInfo> & { name: 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; skipBanCheck?: boolean }>(),
'View Server Success': props<{ room: Room }>(),
'Delete Room': props<{ roomId: string }>(),
'Delete Room Success': props<{ roomId: string }>(),
'Forget Room': props<{ roomId: string; nextOwnerKey?: string }>(),
'Forget Room Success': props<{ roomId: string }>(),
'Update Room Settings': props<{ roomId: string; settings: Partial<RoomSettings> }>(),
'Update Room Settings Success': props<{ roomId: string; settings: RoomSettings }>(),
'Update Room Settings Failure': props<{ error: string }>(),
'Update Room Permissions': props<{ roomId: string; permissions: Partial<RoomPermissions> }>(),
'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<Room> }>(),
'Receive Room Update': props<{ room: Partial<Room> }>(),
'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 }>(),
'Set Signal Server Reconnecting': props<{ isReconnecting: boolean }>(),
'Set Signal Server Compatibility Error': props<{ message: string | null }>()
}
});