Options
All
  • Public
  • Public/Protected
  • All
Menu

SlpLiveStream connects to a Wii or Slippi relay and parses all the data and emits SlpStream events.

export

Hierarchy

Implements

  • WritableStream

Index

Constructors

constructor

  • new SlpLiveStream(connectionType?: "dolphin" | "console"): SlpLiveStream

Properties

connection

connection: Connection

Connection can be used to return the connection status.

memberof

SlpLiveStream

destroyed

destroyed: boolean

gameEnd$

gameEnd$: Observable<GameEndType> = fromEvent<GameEndType>(this.parser, SlpParserEvent.END).pipe(share())

gameStart$

gameStart$: Observable<GameStartType> = fromEvent<GameStartType>(this.parser, SlpParserEvent.SETTINGS).pipe(share())

messageSize$

messageSize$: Observable<Map<Command, number>> = this.messageSizeSource.asObservable()

Protected parser

parser: SlpParser = new SlpParser({ strict: true })

playerFrame$

playerFrame$: Observable<FrameEntryType> = fromEvent<FrameEntryType>(this.parser, SlpParserEvent.FINALIZED_FRAME).pipe(share())

writable

writable: boolean

writableEnded

writableEnded: boolean

writableFinished

writableFinished: boolean

writableHighWaterMark

writableHighWaterMark: number

writableLength

writableLength: number

writableObjectMode

writableObjectMode: boolean

Static defaultMaxListeners

defaultMaxListeners: number

Methods

_destroy

  • _destroy(error: Error | null, callback: (error?: Error | null) => void): void
  • Parameters

    • error: Error | null
    • callback: (error?: Error | null) => void
        • (error?: Error | null): void
        • Parameters

          • Optional error: Error | null

          Returns void

    Returns void

_final

  • _final(callback: (error?: Error | null) => void): void
  • Parameters

    • callback: (error?: Error | null) => void
        • (error?: Error | null): void
        • Parameters

          • Optional error: Error | null

          Returns void

    Returns void

_write

  • _write(newData: Buffer, encoding: string, callback: (error?: Error | null, data?: any) => void): void
  • Parameters

    • newData: Buffer
    • encoding: string
    • callback: (error?: Error | null, data?: any) => void
        • (error?: Error | null, data?: any): void
        • Parameters

          • Optional error: Error | null
          • Optional data: any

          Returns void

    Returns void

Optional _writev

  • _writev(chunks: Array<{ chunk: any; encoding: string }>, callback: (error?: Error | null) => void): void
  • Parameters

    • chunks: Array<{ chunk: any; encoding: string }>
    • callback: (error?: Error | null) => void
        • (error?: Error | null): void
        • Parameters

          • Optional error: Error | null

          Returns void

    Returns void

addListener

  • addListener(event: "close", listener: () => void): this
  • addListener(event: "drain", listener: () => void): this
  • addListener(event: "error", listener: (err: Error) => void): this
  • addListener(event: "finish", listener: () => void): this
  • addListener(event: "pipe", listener: (src: Readable) => void): this
  • addListener(event: "unpipe", listener: (src: Readable) => void): this
  • addListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Event emitter The defined events on documents including:

    1. close
    2. drain
    3. error
    4. finish
    5. pipe
    6. unpipe

    Parameters

    • event: "close"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "drain"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "finish"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "pipe"
    • listener: (src: Readable) => void
        • (src: Readable): void
        • Parameters

          • src: Readable

          Returns void

    Returns this

  • Parameters

    • event: "unpipe"
    • listener: (src: Readable) => void
        • (src: Readable): void
        • Parameters

          • src: Readable

          Returns void

    Returns this

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

cork

  • cork(): void
  • Returns void

destroy

  • destroy(error?: Error): void
  • Parameters

    • Optional error: Error

    Returns void

emit

  • emit(event: "close"): boolean
  • emit(event: "drain"): boolean
  • emit(event: "error", err: Error): boolean
  • emit(event: "finish"): boolean
  • emit(event: "pipe", src: Readable): boolean
  • emit(event: "unpipe", src: Readable): boolean
  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: "close"

    Returns boolean

  • Parameters

    • event: "drain"

    Returns boolean

  • Parameters

    • event: "error"
    • err: Error

    Returns boolean

  • Parameters

    • event: "finish"

    Returns boolean

  • Parameters

    • event: "pipe"
    • src: Readable

    Returns boolean

  • Parameters

    • event: "unpipe"
    • src: Readable

    Returns boolean

  • Parameters

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

    Returns boolean

end

  • end(cb?: () => void): void
  • end(chunk: any, cb?: () => void): void
  • end(chunk: any, encoding: string, cb?: () => void): void
  • Parameters

    • Optional cb: () => void
        • (): void
        • Returns void

    Returns void

  • Parameters

    • chunk: any
    • Optional cb: () => void
        • (): void
        • Returns void

    Returns void

  • Parameters

    • chunk: any
    • encoding: string
    • Optional cb: () => void
        • (): void
        • Returns void

    Returns void

endCurrentFile

  • endCurrentFile(): void
  • Ends the current file being written to.

    memberof

    SlpFileWriter

    Returns void

eventNames

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

getCurrentFilename

  • getCurrentFilename(): string | null
  • Return the name of the SLP file currently being written or null if no file is being written to currently.

    memberof

    SlpFileWriter

    Returns string | null

getMaxListeners

  • getMaxListeners(): 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[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: "close", listener: () => void): this
  • on(event: "drain", listener: () => void): this
  • on(event: "error", listener: (err: Error) => void): this
  • on(event: "finish", listener: () => void): this
  • on(event: "pipe", listener: (src: Readable) => void): this
  • on(event: "unpipe", listener: (src: Readable) => void): this
  • on(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: "close"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "drain"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "finish"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "pipe"
    • listener: (src: Readable) => void
        • (src: Readable): void
        • Parameters

          • src: Readable

          Returns void

    Returns this

  • Parameters

    • event: "unpipe"
    • listener: (src: Readable) => void
        • (src: Readable): void
        • Parameters

          • src: Readable

          Returns void

    Returns this

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: "close", listener: () => void): this
  • once(event: "drain", listener: () => void): this
  • once(event: "error", listener: (err: Error) => void): this
  • once(event: "finish", listener: () => void): this
  • once(event: "pipe", listener: (src: Readable) => void): this
  • once(event: "unpipe", listener: (src: Readable) => void): this
  • once(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: "close"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "drain"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "finish"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "pipe"
    • listener: (src: Readable) => void
        • (src: Readable): void
        • Parameters

          • src: Readable

          Returns void

    Returns this

  • Parameters

    • event: "unpipe"
    • listener: (src: Readable) => void
        • (src: Readable): void
        • Parameters

          • src: Readable

          Returns void

    Returns this

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

pipe

  • pipe<T>(destination: T, options?: { end?: boolean }): T
  • Type parameters

    • T: WritableStream

    Parameters

    • destination: T
    • Optional options: { end?: boolean }
      • Optional end?: boolean

    Returns T

prependListener

  • prependListener(event: "close", listener: () => void): this
  • prependListener(event: "drain", listener: () => void): this
  • prependListener(event: "error", listener: (err: Error) => void): this
  • prependListener(event: "finish", listener: () => void): this
  • prependListener(event: "pipe", listener: (src: Readable) => void): this
  • prependListener(event: "unpipe", listener: (src: Readable) => void): this
  • prependListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: "close"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "drain"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "finish"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "pipe"
    • listener: (src: Readable) => void
        • (src: Readable): void
        • Parameters

          • src: Readable

          Returns void

    Returns this

  • Parameters

    • event: "unpipe"
    • listener: (src: Readable) => void
        • (src: Readable): void
        • Parameters

          • src: Readable

          Returns void

    Returns this

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: "close", listener: () => void): this
  • prependOnceListener(event: "drain", listener: () => void): this
  • prependOnceListener(event: "error", listener: (err: Error) => void): this
  • prependOnceListener(event: "finish", listener: () => void): this
  • prependOnceListener(event: "pipe", listener: (src: Readable) => void): this
  • prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this
  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: "close"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "drain"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "finish"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "pipe"
    • listener: (src: Readable) => void
        • (src: Readable): void
        • Parameters

          • src: Readable

          Returns void

    Returns this

  • Parameters

    • event: "unpipe"
    • listener: (src: Readable) => void
        • (src: Readable): void
        • Parameters

          • src: Readable

          Returns void

    Returns this

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

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

    • event: string | symbol

    Returns Function[]

removeAllListeners

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

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: "close", listener: () => void): this
  • removeListener(event: "drain", listener: () => void): this
  • removeListener(event: "error", listener: (err: Error) => void): this
  • removeListener(event: "finish", listener: () => void): this
  • removeListener(event: "pipe", listener: (src: Readable) => void): this
  • removeListener(event: "unpipe", listener: (src: Readable) => void): this
  • removeListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: "close"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "drain"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "finish"
    • listener: () => void
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "pipe"
    • listener: (src: Readable) => void
        • (src: Readable): void
        • Parameters

          • src: Readable

          Returns void

    Returns this

  • Parameters

    • event: "unpipe"
    • listener: (src: Readable) => void
        • (src: Readable): void
        • Parameters

          • src: Readable

          Returns void

    Returns this

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

restart

  • restart(): void

setDefaultEncoding

  • setDefaultEncoding(encoding: string): this

setMaxListeners

  • setMaxListeners(n: number): this

start

  • start(address: string, port: number): Promise<void>
  • Connect to a Wii or Slippi relay on the specified address and port.

    memberof

    SlpLiveStream

    Parameters

    • address: string

      The address of the Wii or Slippi relay

    • port: number

      The port of the Wii or Slippi relay

    Returns Promise<void>

uncork

  • uncork(): void
  • Returns void

updateSettings

  • updateSettings(settings: Partial<SlpFileWriterOptions>): void
  • Updates the settings to be the desired ones passed in.

    memberof

    SlpFileWriter

    Parameters

    • settings: Partial<SlpFileWriterOptions>

    Returns void

write

  • write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean
  • write(chunk: any, encoding: string, cb?: (error: Error | null | undefined) => void): boolean
  • Parameters

    • chunk: any
    • Optional cb: (error: Error | null | undefined) => void
        • (error: Error | null | undefined): void
        • Parameters

          • error: Error | null | undefined

          Returns void

    Returns boolean

  • Parameters

    • chunk: any
    • encoding: string
    • Optional cb: (error: Error | null | undefined) => void
        • (error: Error | null | undefined): void
        • Parameters

          • error: Error | null | undefined

          Returns void

    Returns boolean

Static listenerCount

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

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc