import { ActionTypes } from './action.types'; import { Action } from '@ngrx/store'; import { User, ChatMessage } from '../entities'; export class Init implements Action { readonly type: string = ActionTypes.InitApp; constructor(public paylad: User) { } } export class LoginChat implements Action { readonly type: string = ActionTypes.LoginChat; constructor(public paylad: { accessToken: string, userId: string, me?: any }) { } } export class Register implements Action { readonly type: string = ActionTypes.Register; constructor(public paylad: { username: string, email: string, password: string }) { } } export class ChannelChanged implements Action { readonly type: string = ActionTypes.ChannelChanged; constructor(public paylad: { name: string, id: string }) { } } export class MessageChanged implements Action { readonly type: string = ActionTypes.MessageChanged; constructor(public paylad: ChatMessage[]) { } } // ... export type ChatActionsUnion = Init | LoginChat | Register | ChannelChanged;