Skip to content

@mastondzn/dank-twitch-irc / SingleConnection

Class: SingleConnection

Extends

Constructors

new SingleConnection(configuration)

new SingleConnection(configuration?): SingleConnection

Parameters

configuration?: ClientConfiguration

Returns

SingleConnection

Overrides

BaseClient.constructor

Source

src/client/connection.ts:36

Properties

configuration

readonly configuration: ExpandedClientConfiguration

Inherited from

BaseClient.configuration

Source

src/client/base-client.ts:32


connectionID

readonly connectionID: number

Source

src/client/connection.ts:24


joinedChannels

readonly joinedChannels: Set<string>

Overrides

BaseClient.joinedChannels

Source

src/client/connection.ts:27


log

protected readonly log: Logger

Source

src/client/connection.ts:32


pendingResponses

readonly pendingResponses: ResponseAwaiter[] = []

Source

src/client/connection.ts:29


state

state: ClientState = ClientState.UNCONNECTED

Inherited from

BaseClient.state

Source

src/client/base-client.ts:36


transport

readonly transport: Transport

Source

src/client/connection.ts:30


wantedChannels

readonly wantedChannels: Set<string>

Overrides

BaseClient.wantedChannels

Source

src/client/connection.ts:26


prefixed

static prefixed: string | boolean

Inherited from

BaseClient.prefixed

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:9

Accessors

closed

get closed(): boolean

Returns

boolean

Source

src/client/base-client.ts:28


connected

get connected(): boolean

Returns

boolean

Source

src/client/base-client.ts:20


connecting

get connecting(): boolean

Returns

boolean

Source

src/client/base-client.ts:16


ready

get ready(): boolean

Returns

boolean

Source

src/client/base-client.ts:24


unconnected

get unconnected(): boolean

Returns

boolean

Source

src/client/base-client.ts:12

Methods

addListener()

addListener<T>(event, fn, context?): this

Type parameters

T extends string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

event: T

fn

context?: any

Returns

this

Inherited from

BaseClient.addListener

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:45


advanceState()

advanceState(newState): boolean

Parameters

newState: ClientState

Returns

boolean

Inherited from

BaseClient.advanceState

Source

src/client/base-client.ts:80


close()

close(): void

Returns

void

Source

src/client/connection.ts:111


connect()

connect(): void

Returns

void

Source

src/client/connection.ts:79


destroy()

destroy(error?): void

Parameters

error?: Error

Returns

void

Source

src/client/connection.ts:116


emit()

emit<T>(event, ...args): boolean

Calls each of the listeners registered for a given event.

Type parameters

T extends string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

event: T

• ...args: ArgumentMap<ClientEvents>[Extract<T, string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents>]

Returns

boolean

Inherited from

BaseClient.emit

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:32


emitClosed()

emitClosed(error?): void

Parameters

error?: Error

Returns

void

Inherited from

BaseClient.emitClosed

Source

src/client/base-client.ts:74


emitConnected()

emitConnected(): void

Returns

void

Inherited from

BaseClient.emitConnected

Source

src/client/base-client.ts:62


emitConnecting()

emitConnecting(): void

Returns

void

Inherited from

BaseClient.emitConnecting

Source

src/client/base-client.ts:56


emitError()

emitError(error, emitEvenIfClosed): void

Parameters

error: Error

emitEvenIfClosed: boolean= false

Returns

void

Inherited from

BaseClient.emitError

Source

src/client/base-client.ts:43


emitMessage()

emitMessage(message): void

Parameters

message: IRCMessage

Returns

void

Inherited from

BaseClient.emitMessage

Source

src/client/base-client.ts:51


emitReady()

emitReady(): void

Returns

void

Inherited from

BaseClient.emitReady

Source

src/client/base-client.ts:68


eventNames()

eventNames(): (string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents)[]

Return an array listing the events for which the emitter has registered listeners.

Returns

(string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents)[]

Inherited from

BaseClient.eventNames

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:15


handleLine()

private handleLine(line): void

Parameters

line: string

Returns

void

Source

src/client/connection.ts:135


listenerCount()

listenerCount(event): number

Return the number of listeners listening to a given event.

Parameters

event: string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Returns

number

Inherited from

BaseClient.listenerCount

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:27


listeners()

listeners<T>(event): (...args) => void[]

Return the listeners registered for a given event.

Type parameters

T extends string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

event: T

Returns

(...args) => void[]

Inherited from

BaseClient.listeners

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:20


off()

off<T>(event, fn?, context?, once?): this

Type parameters

T extends string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

event: T

fn?

context?: any

once?: boolean

Returns

this

Inherited from

BaseClient.off

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:69


on()

on<T>(event, fn, context?): this

Add a listener for a given event.

Type parameters

T extends string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

event: T

fn

context?: any

Returns

this

Inherited from

BaseClient.on

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:40


onConnect()

onConnect(): void

Returns

void

Source

src/client/connection.ts:127


once()

once<T>(event, fn, context?): this

Add a one-time listener for a given event.

Type parameters

T extends string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

event: T

fn

context?: any

Returns

this

Inherited from

BaseClient.once

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:54


removeAllListeners()

removeAllListeners(event?): this

Remove all listeners, or those of the specified event.

Parameters

event?: string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Returns

this

Inherited from

BaseClient.removeAllListeners

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:79


removeListener()

removeListener<T>(event, fn?, context?, once?): this

Remove the listeners of a given event.

Type parameters

T extends string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

event: T

fn?

context?: any

once?: boolean

Returns

this

Inherited from

BaseClient.removeListener

Source

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:63


sendRaw()

sendRaw(command): void

Parameters

command: string

Returns

void

Source

src/client/connection.ts:120


use()

use(mixin): void

Parameters

mixin: ConnectionMixin

Returns

void

Source

src/client/connection.ts:131