Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

chore(deps): bump js-yaml from 3.12.2 to 3.13.1 #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 78 additions & 2 deletions src/defs/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export interface IMessageTagComponent {
id: number;
}

export type MessagePart = IMessageTextComponent
export type MessagePart =
| IMessageTextComponent
| IMessageEmoticonComponent
| IMessageLinkComponent
| IMessageTagComponent;
Expand Down Expand Up @@ -140,7 +141,6 @@ export interface IUserUpdate {
}

export interface IPollEvent {

/**
* The question being asked.
*/
Expand Down Expand Up @@ -215,13 +215,68 @@ export interface IDeleteMessage {
* The message Id.
*/
id: string;
/**
* The moderator that performed the action.
*/
moderator: {
/**
* The moderator's Id.
*/
user_id: number;
/**
* The moderator's name.
*/
user_name: string;
/**
* The roles the moderator has.
*/
user_roles: string[];
/**
* The level of the moderator
*/
user_level: number;
};
}

export interface IPurgeMessage {
/**
* The user's Id.
*/
user_id: number;
/**
* The moderator that performed the action.
*/
moderator: {
/**
* The moderator's Id.
*/
user_id: number;
/**
* The moderator's name.
*/
user_name: string;
/**
* The roles the moderator has.
*/
user_roles: string[];
/**
* The level of the moderator
*/
user_level: number;
};
/**
* The cause of the purge
*/
cause: {
/**
* The type of action that was performed to cause the purge.
*/
type: 'ban' | 'timeout' | 'globaltimeout';
/**
* Optional raw length that was passed from the moderator for timeouts.
*/
durationString?: string;
};
}

export interface IUserTimeout {
Expand All @@ -244,3 +299,24 @@ export interface IUserTimeout {
*/
duration: number;
}

export interface IClearMessage {
clearer: {
/**
* The moderator's Id.
*/
user_id: number;
/**
* The moderator's name.
*/
user_name: string;
/**
* The roles the moderator has.
*/
user_roles: string[];
/**
* The level of the moderator
*/
user_level: number;
};
}
13 changes: 8 additions & 5 deletions src/socket/Socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as NodeWebSocket from 'ws';

import {
IChatMessage,
IClearMessage,
IDeleteMessage,
IPollEvent,
IPurgeMessage,
Expand Down Expand Up @@ -45,9 +46,11 @@ function isNodeWebSocket(socket: any): socket is NodeWebSocket {
}

function isReactNative() {
return (typeof document === 'undefined'
&& typeof navigator !== 'undefined'
&& navigator.product === 'ReactNative');
return (
typeof document === 'undefined' &&
typeof navigator !== 'undefined' &&
navigator.product === 'ReactNative'
);
}

/**
Expand Down Expand Up @@ -170,7 +173,7 @@ export class Socket extends EventEmitter {
public on(event: 'authresult', cb: (res: IUserAuthenticated) => any): this;
public on(event: 'packet', cb: (packet: any) => any): this;
public on(event: 'ChatMessage', cb: (message: IChatMessage) => any): this;
public on(event: 'ClearMessages', cb: () => void): this;
public on(event: 'ClearMessages', cb: (clear: IClearMessage) => any): this;
public on(event: 'DeleteMessage', cb: (message: IDeleteMessage) => any): this;
public on(event: 'PollStart', cb: (poll: IPollEvent) => any): this;
public on(event: 'PollEnd', cb: (poll: IPollEvent) => any): this;
Expand Down Expand Up @@ -618,7 +621,7 @@ export class Socket extends EventEmitter {
public call(method: 'whisper', args: [string, string], options?: ICallOptions): Promise<any>;
public call(method: 'history', args: [number], options?: ICallOptions): Promise<IChatMessage[]>;
public call(method: 'timeout', args: [string, string], options?: ICallOptions): Promise<string>;
public call(method: 'optOutEvents', args: (string)[], options?: ICallOptions): Promise<void>;
public call(method: 'optOutEvents', args: string[], options?: ICallOptions): Promise<void>;
public call(method: 'ping', args: [any]): Promise<any>;
public call(method: 'vote:start', args: [string, string[], number]): Promise<void>;
public call(method: string, args: (string | number)[], options?: ICallOptions): Promise<any>;
Expand Down