Skip to content

@mastondzn/dank-twitch-irc / SingleConnection

Class: SingleConnection

Defined in: src/client/connection.ts:23

Extends

Constructors

new SingleConnection()

new SingleConnection(configuration?): SingleConnection

Defined in: src/client/connection.ts:36

Parameters

configuration?

ClientConfiguration

Returns

SingleConnection

Overrides

BaseClient.constructor

Properties

configuration

readonly configuration: ExpandedClientConfiguration

Defined in: src/client/base-client.ts:32

Inherited from

BaseClient.configuration


connectionID

readonly connectionID: number

Defined in: src/client/connection.ts:24


joinedChannels

readonly joinedChannels: Set<string>

Defined in: src/client/connection.ts:27

Overrides

BaseClient.joinedChannels


log

protected readonly log: Record<"error" | "debug" | "info" | "warn", (...args) => void>

Defined in: src/client/connection.ts:32


pendingResponses

readonly pendingResponses: ResponseAwaiter[] = []

Defined in: src/client/connection.ts:29


state

state: ClientState = ClientState.UNCONNECTED

Defined in: src/client/base-client.ts:36

Inherited from

BaseClient.state


transport

readonly transport: Transport

Defined in: src/client/connection.ts:30


wantedChannels

readonly wantedChannels: Set<string>

Defined in: src/client/connection.ts:26

Overrides

BaseClient.wantedChannels


prefixed

static prefixed: string | boolean

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

Inherited from

BaseClient.prefixed

Accessors

closed

Get Signature

get closed(): boolean

Defined in: src/client/base-client.ts:28

Returns

boolean

Inherited from

BaseClient.closed


connected

Get Signature

get connected(): boolean

Defined in: src/client/base-client.ts:20

Returns

boolean

Inherited from

BaseClient.connected


connecting

Get Signature

get connecting(): boolean

Defined in: src/client/base-client.ts:16

Returns

boolean

Inherited from

BaseClient.connecting


ready

Get Signature

get ready(): boolean

Defined in: src/client/base-client.ts:24

Returns

boolean

Inherited from

BaseClient.ready


unconnected

Get Signature

get unconnected(): boolean

Defined in: src/client/base-client.ts:12

Returns

boolean

Inherited from

BaseClient.unconnected

Methods

addListener()

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

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

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

(...args) => void

context?

any

Returns

this

Inherited from

BaseClient.addListener


advanceState()

advanceState(newState): boolean

Defined in: src/client/base-client.ts:80

Parameters

newState

ClientState

Returns

boolean

Inherited from

BaseClient.advanceState


close()

close(): void

Defined in: src/client/connection.ts:111

Returns

void


connect()

connect(): void

Defined in: src/client/connection.ts:79

Returns

void


destroy()

destroy(error?): void

Defined in: src/client/connection.ts:116

Parameters

error?

Error

Returns

void


emit()

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

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

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


emitClosed()

emitClosed(error?): void

Defined in: src/client/base-client.ts:74

Parameters

error?

Error

Returns

void

Inherited from

BaseClient.emitClosed


emitConnected()

emitConnected(): void

Defined in: src/client/base-client.ts:62

Returns

void

Inherited from

BaseClient.emitConnected


emitConnecting()

emitConnecting(): void

Defined in: src/client/base-client.ts:56

Returns

void

Inherited from

BaseClient.emitConnecting


emitError()

emitError(error, emitEvenIfClosed): void

Defined in: src/client/base-client.ts:43

Parameters

error

Error

emitEvenIfClosed

boolean = false

Returns

void

Inherited from

BaseClient.emitError


emitMessage()

emitMessage(message): void

Defined in: src/client/base-client.ts:51

Parameters

message

IRCMessage

Returns

void

Inherited from

BaseClient.emitMessage


emitReady()

emitReady(): void

Defined in: src/client/base-client.ts:68

Returns

void

Inherited from

BaseClient.emitReady


eventNames()

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

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

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


listenerCount()

listenerCount(event): number

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

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


listeners()

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

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

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


off()

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

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

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?

(...args) => void

context?

any

once?

boolean

Returns

this

Inherited from

BaseClient.off


on()

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

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

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

(...args) => void

context?

any

Returns

this

Inherited from

BaseClient.on


once()

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

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

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

(...args) => void

context?

any

Returns

this

Inherited from

BaseClient.once


onConnect()

onConnect(): void

Defined in: src/client/connection.ts:127

Returns

void


removeAllListeners()

removeAllListeners(event?): this

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

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


removeListener()

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

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

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?

(...args) => void

context?

any

once?

boolean

Returns

this

Inherited from

BaseClient.removeListener


sendRaw()

sendRaw(command): void

Defined in: src/client/connection.ts:120

Parameters

command

string

Returns

void


use()

use(mixin): void

Defined in: src/client/connection.ts:131

Parameters

mixin

ConnectionMixin

Returns

void