import Parser from "slate-irc-parser"; import { EventEmitter } from "node:events"; import { Duplex } from "node:stream"; //#region src/types.d.ts interface IrcMessage { prefix: string; command: string; params: string; trailing: string; string: string; [key: string]: unknown; } interface Hostmask { nick: string; username?: string; hostname?: string; string: string; } interface NamesUser { name: string; mode: string; } interface AwayEvent { nick?: string | undefined; message: string; } interface ErrorEvent { cmd: string; message: string; } interface InviteEvent { from: string; hostmask: Hostmask; to: string; channel: string; } interface JoinEvent { nick: string; hostmask: Hostmask; channel: string; } interface KickEvent { nick: string; hostmask: Hostmask; channel: string; client: string; message: string; } interface ModeEvent { nick: string; target?: string | undefined; mode: string; client?: string | undefined; } interface MotdEvent { motd: string[]; } interface NamesEvent { channel: string; names: NamesUser[]; } interface NickEvent { nick: string; hostmask: Hostmask; new: string; } interface NoticeEvent { from: string; hostmask: Hostmask; to: string; message: string; } interface PartEvent { nick: string; hostmask: Hostmask; channels: string[]; message: string; } interface PrivmsgEvent { from: string; hostmask: Hostmask; to: string; message: string; } interface QuitEvent { nick: string; hostmask: Hostmask; message: string; } interface TopicEvent { nick?: string | undefined; hostmask: Hostmask; channel: string; topic: string; } interface WhoisData { nickname?: string | undefined; username?: string | undefined; hostname?: string | undefined; realname?: string | undefined; channels: string[]; oper: boolean; server?: string | undefined; away?: string | undefined; idle?: string | undefined; sign?: string | undefined; } type AnyFn = (...args: unknown[]) => void; type NamesQueryCallback = (err: null, names: NamesUser[]) => void; type WhoisQueryCallback = (err: string | null | undefined, data: WhoisData | null) => void; type WriteCallback = (err?: Error | null) => void; type IrcStream = Duplex & { setTimeout?: (ms: number) => void; }; type IrcClient = EventEmitter & { stream: IrcStream; parser: Parser; me?: string; names: (channel: string, fn?: NamesQueryCallback) => void; whois: (target: string, mask?: string | WhoisQueryCallback, fn?: WhoisQueryCallback) => void; nameCallbacks: Record void) | undefined>; whoisCallbacks: Record; writeUnsafe: (str: string, fn?: WriteCallback) => void; write: (str: string, fn?: WriteCallback) => void; pass: (pass: string, fn?: WriteCallback) => void; webirc: (password: string, username: string, hostname: string, ip: string, fn?: WriteCallback) => void; nick: (nick: string, fn?: WriteCallback) => void; user: (username: string, realname: string, fn?: WriteCallback) => void; invite: (name: string, channel: string, fn?: WriteCallback) => void; send: (target: string | string[], msg: string, fn?: WriteCallback) => void; action: (target: string, msg: string, fn?: WriteCallback) => void; notice: (target: string, msg: string, fn?: WriteCallback) => void; ctcp: (target: string, msg: string, fn?: WriteCallback) => void; join: (channels: string | string[], keys?: string | string[] | WriteCallback, fn?: WriteCallback) => void; part: (channels: string | string[], msg?: string | WriteCallback, fn?: WriteCallback) => void; away: (msg?: string, fn?: WriteCallback) => void; back: (fn?: WriteCallback) => void; topic: (channel: string, topic?: string | WriteCallback, fn?: WriteCallback) => void; kick: (channels: string | string[], nicks: string | string[], msg?: string | WriteCallback, fn?: WriteCallback) => void; quit: (msg?: string, fn?: WriteCallback) => void; oper: (name: string, password: string, fn?: WriteCallback) => void; mode: (target: string, flags: string, params?: string | WriteCallback, fn?: WriteCallback) => void; use: (fn: Plugin) => IrcClient; onmessage: (msg: IrcMessage) => void; }; type Plugin = (irc: IrcClient) => void; type PluginFactory = () => Plugin; //#endregion //#region src/index.d.ts /** * Initialize a new IRC client with the * given duplex `stream`. * * @param {Stream} stream * @param {Parser} [parser] * @param {String} [encoding] */ type ClientFactory = (stream: IrcStream, parser?: Parser, encoding?: BufferEncoding) => IrcClient; declare function Client(stream: IrcStream, parser?: Parser, encoding?: BufferEncoding): IrcClient; //#endregion export { type AnyFn, type AwayEvent, ClientFactory, type ErrorEvent, type Hostmask, type InviteEvent, type IrcClient, type IrcMessage, type IrcStream, type JoinEvent, type KickEvent, type ModeEvent, type MotdEvent, type NamesEvent, type NamesQueryCallback, type NamesUser, type NickEvent, type NoticeEvent, type PartEvent, type Plugin, type PluginFactory, type PrivmsgEvent, type QuitEvent, type TopicEvent, type WhoisData, type WhoisQueryCallback, type WriteCallback, Client as default }; //# sourceMappingURL=index.d.mts.map