UNPKG

@pazznetwork/ngx-chat

Version:

[![Build status](https://api.travis-ci.com/pazznetwork/ngx-chat.svg?branch=master)](https://travis-ci.com/pazznetwork/ngx-chat) [![Coverage](https://coveralls.io/repos/github/pazznetwork/ngx-chat/badge.svg?branch=master)](https://coveralls.io/github/pazzn

26 lines (25 loc) 1.01 kB
import { RoomOccupant } from './room-occupant'; export declare type OccupantChangeType = 'joined' | 'left' | 'leftOnConnectionError' | 'kicked' | 'banned' | 'changedNick' | 'lostMembership' | 'modified'; export declare type OccupantChange = OccupantKickedOrBannedChange | OccupantNickChange | OccupantModifiedChange | OccupantChangeOther; interface OccupantChangeBase { change: string; occupant: RoomOccupant; isCurrentUser: boolean; } export interface OccupantChangeOther extends OccupantChangeBase { change: Exclude<OccupantChangeType, 'kicked' | 'banned' | 'changedNick' | 'modified'>; } export interface OccupantKickedOrBannedChange extends OccupantChangeBase { change: 'kicked' | 'banned'; actor?: string; reason?: string; } export interface OccupantNickChange extends OccupantChangeBase { change: 'changedNick'; newNick: string; } export interface OccupantModifiedChange extends OccupantChangeBase { change: 'modified'; oldOccupant: RoomOccupant; } export {};