irclib/src/types/impl.interface.ts

21 lines
495 B
TypeScript

export interface IRCCommunicator {
emit(event: string, ...args: any[]): void;
on(event: string, handler: (...args: any[]) => void): void;
write(format: string, ...args: any[]): void;
}
export interface IRCConnector extends IRCCommunicator {
connected: boolean;
connect(): Promise<void>;
destroy(): Promise<void>;
}
export interface IRCConnectorConstructor {
new (
secure: boolean,
host: string,
port?: number,
opts?: Record<string, unknown>,
): IRCConnector;
}