Skip to content

Class Transport

🏭 Constructors

constructor

ts
new Transport(options: TransportOptions): Transport

Parameters

  • options: TransportOptions

Return Type

  • Transport

Defined in: packages/discord-rpc/structures/Transport.ts:271

🏷️ Properties

client readonly

ts
client: Client

Defined in: packages/discord-rpc/structures/Transport.ts:265

🔑 Accessors

isConnected

Defined in: packages/discord-rpc/structures/Transport.ts:267

🔧 Methods

addListener

ts
addListener(event: E, listener: TransportEvents[E]): Transport

Parameters

  • event: E
  • listener: TransportEvents[E]

Return Type

  • Transport

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).addListener

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:8

close abstract

ts
close(): Promise<void>

Return Type

  • Promise<void>

Defined in: packages/discord-rpc/structures/Transport.ts:280

connect abstract

ts
connect(): Promise<void>

Return Type

  • Promise<void>

Defined in: packages/discord-rpc/structures/Transport.ts:277

emit

ts
emit(event: E, args: Parameters<TransportEvents[E]>): boolean

Parameters

  • event: E
  • args: Parameters<TransportEvents[E]>

Return Type

  • boolean

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).emit

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:18

eventNames

ts
eventNames(): (string | symbol)[]

Return Type

  • (string | symbol)[]

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).eventNames

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:19

getMaxListeners

ts
getMaxListeners(): number

Return Type

  • number

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).getMaxListeners

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:24

listenerCount

ts
listenerCount(event: E): number

Parameters

  • event: E

Return Type

  • number

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).listenerCount

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:22

listeners

ts
listeners(event: E): TransportEvents[E][]

Parameters

  • event: E

Return Type

  • TransportEvents[E][]

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).listeners

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:21

off

ts
off(event: E, listener: TransportEvents[E]): Transport

Parameters

  • event: E
  • listener: TransportEvents[E]

Return Type

  • Transport

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).off

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:14

on

ts
on(event: E, listener: TransportEvents[E]): Transport

Parameters

  • event: E
  • listener: TransportEvents[E]

Return Type

  • Transport

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).on

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:9

once

ts
once(event: E, listener: TransportEvents[E]): Transport

Parameters

  • event: E
  • listener: TransportEvents[E]

Return Type

  • Transport

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).once

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:10

ping abstract

ts
ping(): void

Return Type

  • void

Defined in: packages/discord-rpc/structures/Transport.ts:279

prependListener

ts
prependListener(event: E, listener: TransportEvents[E]): Transport

Parameters

  • event: E
  • listener: TransportEvents[E]

Return Type

  • Transport

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).prependListener

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:11

prependOnceListener

ts
prependOnceListener(event: E, listener: TransportEvents[E]): Transport

Parameters

  • event: E
  • listener: TransportEvents[E]

Return Type

  • Transport

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).prependOnceListener

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:12

rawListeners

ts
rawListeners(event: E): TransportEvents[E][]

Parameters

  • event: E

Return Type

  • TransportEvents[E][]

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).rawListeners

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:20

removeAllListeners

ts
removeAllListeners(event: E): Transport

Parameters

  • event: E

Return Type

  • Transport

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).removeAllListeners

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:15

removeListener

ts
removeListener(event: E, listener: TransportEvents[E]): Transport

Parameters

  • event: E
  • listener: TransportEvents[E]

Return Type

  • Transport

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).removeListener

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:16

send abstract

ts
send(data: any): void

Parameters

  • data: any

Return Type

  • void

Defined in: packages/discord-rpc/structures/Transport.ts:278

setMaxListeners

ts
setMaxListeners(maxListeners: number): Transport

Parameters

  • maxListeners: number

Return Type

  • Transport

Inherited from: (EventEmitter as new () => TypedEmitter<TransportEvents>).setMaxListeners

Defined in: packages/discord-rpc/utils/TypedEmitter.ts:25