@thaunknown/web-irc
Version:
A TypeScript port of irc-framework's WebIRC client, without the bloat of unnceessary packages.
92 lines (91 loc) • 3.2 kB
TypeScript
import { EventEmitter } from 'events';
import IrcMessage from './ircmessage';
import Channel from './channel';
export default class IrcClient extends EventEmitter {
requestExtraCaps: any[];
options: any;
rawMiddleware: any;
parsedMiddleware: any;
connection: any;
network: any;
user: any;
commandHandler: any;
whoQueue: any;
whoxToken: any;
constructor(options: any);
static setDefaultTransport(transport: any): void;
get Message(): typeof IrcMessage;
_applyDefaultOptions(userOptions: any): any;
createStructure(): void;
requestCap(cap: any): void;
use(fn: any): this;
connect(options: any): void;
proxyIrcEvents(): void;
addCommandHandlerListeners(): void;
registerToNetwork(): void;
startPeriodicPing(): void;
startPingTimeoutTimer(): void;
resetPingTimeoutTimer(): void;
debugOut(out: any): void;
/**
* Client API
*/
raw(...args: any[]): void;
rawString(input: any): string;
quit(message: any): void;
ping(message: any): void;
changeNick(nick: any): void;
sendMessage(commandName: any, target: any, message: any, tags: any): void;
say(target: any, message: any, tags: any): void;
notice(target: any, message: any, tags: any): void;
tagmsg(target: any, tags?: {}): void;
join(channel: any, key: any): void;
part(channel: any, message: any): void;
mode(channel: any, mode: any, extraArgs: any): void;
inviteList(channel: any, cb: any): void;
invite(channel: any, nick: any): void;
addInvite(channel: any, mask: any): void;
removeInvite(channel: any, mask: any): void;
banlist(channel: any, cb: any): void;
ban(channel: any, mask: any): void;
unban(channel: any, mask: any): void;
setTopic(channel: any, newTopic: any): void;
ctcpRequest(target: any, type: any): void;
ctcpResponse(target: any, type: any): void;
action(target: any, message: any): string[];
whois(target: any, _cb: any): void;
whowas(target: any, _cb: any): void;
/**
* WHO requests are queued up to run serially.
* This is mostly because networks will only reply serially and it makes
* it easier to include the correct replies to callbacks
*/
who(target: any, cb: any): void;
monitorlist(cb: any): void;
addMonitor(target: any): void;
removeMonitor(target: any): void;
queryMonitor(): void;
clearMonitor(): void;
processNextWhoQueue(): void;
/**
* Explicitely start a channel list, avoiding potential issues with broken IRC servers not sending RPL_LISTSTART
*/
list(...args: any[]): void;
channel(channelName: any): Channel;
match(matchRegex: any, cb: any, messageType: any): {
stop: () => void;
};
matchNotice(matchRegex: any, cb: any): {
stop: () => void;
};
matchMessage(matchRegex: any, cb: any): {
stop: () => void;
};
matchAction(matchRegex: any, cb: any): {
stop: () => void;
};
caseCompare(string1: any, string2: any): boolean;
caseLower(string: any): string;
caseUpper(string: any): string;
_getCaseMappingUpperAsciiBound(): 90 | 93 | 94;
}