forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslate-irc.d.ts
98 lines (80 loc) · 2.77 KB
/
slate-irc.d.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
// Type definitions for slate-irc
// Project: https://github.com/slate/slate-irc
// Definitions by: Elisée MAURER <https://github.com/elisee/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "slate-irc" {
import * as net from "net";
function IRC(socket: net.Socket): IRC.Client;
namespace IRC {
interface DataEvent {
prefix: string;
command: string;
params: string;
trailing: string;
string: string;
}
interface MOTDEvent {
motd: string[];
}
interface MessageEvent {
from: string;
hostmask: any;
to: string;
message: string;
}
interface JoinEvent {
nick: string;
hostmask: string;
channel: string;
}
interface PartEvent {
nick: string;
hostmask: string;
channels: string[];
}
interface NickEvent {
nick: string;
hostmask: string;
new: string;
}
interface QuitEvent {
nick: string;
hostmask: string;
message: string;
}
class Client {
me: string;
write(str: string): void;
pass(pass: string): void;
nick(nick: string): void;
user(username: string, realname: string): void;
invite(name: string, channel: string): void;
send(target: string, msg: string): void;
action(target: string, msg: string): void;
notice(target: string, msg: string): void;
ctcp(target: string, msg: string): void;
join(channel: string, key?: string): void;
part(channel: string, msg?: string): void;
names(channel: string, callback: (error: Error, names: { name: string; mode: string; }[]) => void): void;
away(message: string): void;
topic(channel: string, topic: string): void;
kick(channels: string|string[], nicks: string|string[], msg: string): void;
oper(name: string, password: string): void;
mode(target: string, flags: string, params: string): void;
quit(msg: string): void;
whois(target: string, mask: string, callback: Function): void;
on(event: string, callback: Function): void;
on(event: "data", callback: (event: DataEvent) => void): void;
on(event: "welcome", callback: (name: string) => void): void;
on(event: "message", callback: (event: MessageEvent) => void): void;
on(event: "notice", callback: (event: MessageEvent) => void): void;
on(event: "motd", callback: (event: MOTDEvent) => void): void;
on(event: "join", callback: (event: JoinEvent) => void): void;
on(event: "part", callback: (event: PartEvent) => void): void;
on(event: "nick", callback: (event: NickEvent) => void): void;
on(event: "quit", callback: (event: QuitEvent) => void): void;
}
}
export = IRC;
}