Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Runtime

The runtime manages clients, resources, plugins and any other services which are used by an nrelay project.

Hierarchy

  • EventEmitter
    • Runtime

Index

Constructors

constructor

Properties

accountService

accountService: AccountService

The account service used by this runtime.

args

args: Arguments

The last arguments which were passed to this runtime.

Note that this may be undefined, and it may also contain arguments which were not passed by the user (such as the update and plugin-path args).

buildVersion

buildVersion: string

The build version to use when creating new clients.

Private clients

clients: Map<string, Client>

The clients which are managed by this runtime.

env

The environment of this runtime.

libraryManager

libraryManager: LibraryManager

The library manager used by this runtime.

Private logStream

logStream: WriteStream

A WriteStream which is used for the log file.

packetMap

packetMap: PacketMap

A bidirectional map of packet ids.

resources

resources: ResourceManager

The resource manager used by this runtime.

updater

updater: Updater

The updater used by this runtime.

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addClient

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

Private createLog

  • createLog(): void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getClients

  • Gets a copy of the clients in this runtime. Modifying this list will not affect the runtime.

    Returns Client[]

getMaxListeners

  • getMaxListeners(): number
  • Returns number

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

on

  • on(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeClient

  • removeClient(guid: string): void
  • Removes the client with the given guid from this runtime.

    Parameters

    • guid: string

      The guid of the client to remove.

    Returns void

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

run

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

updateBuildVersion

  • updateBuildVersion(buildVersion: string): void
  • Updates the build version stored in the versions.json file.

    Parameters

    • buildVersion: string

      The new build version to store.

    Returns void

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc