-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnbchat_core.ts
98 lines (86 loc) · 2.37 KB
/
nbchat_core.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* Copyright (C) 2006-2016 Net-Bits.Net
*
* Contact: [email protected]
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA.
*/
function IsUndefinedOrNull(object: any): boolean {
"use strict";
if (object === undefined || object === null) { return true; }
return false;
}
namespace NBChatCore {
"use strict";
export const enum ParserReturnItemTypes {
Undefined = 0,
PingReply,
IRCwxError,
RPL_001_WELCOME,
RPL_251_LUSERCLIENT,
RPL_265_LOCALUSERS,
Join,
Quit,
Part
}
export type fnWriteToPresenterDef = (s: string) => void;
export class Rpl001Welcome {
serverName: string;
userName: string;
}
export const enum UserLevels {
Staff = 128,
Superowner = 64,
Owner = 32,
Host = 16,
Helpop = 8
}
export const enum UserProfileIcons {
NoProfile = 0,
NoGender,
NoGenderWPic,
Female,
FemaleWPic,
Male,
MaleWPic
}
export class IRCmUser {
nick: string;
fullident: string;
ident: string;
host: string = null;
ilevel: number = 0;
iprofile: number = 0;
away: boolean = false;
awaymsg: string = "";
voice: boolean = false;
ignore: boolean = false;
}
export class JoinCls {
user: IRCmUser;
ircmChannelName: string;
}
export class PartCls {
nick: string;
ircmChannelName: string;
}
export class CommonParserReturnItem {
type: ParserReturnItemTypes;
// Returned value
rval: string | Rpl001Welcome | JoinCls | PartCls;
}
}