Class Lighthouse

A connection to the lighthouse.

Hierarchy

  • Lighthouse

Constructors

Properties

auth: any
coder: any
handle: any

Handles a server message.

isClosed: any

Whether the transport has been closed.

logger: any
outOfOrderMessages: any

Out-of-order received messages, e.g. if a response is faster than the response handler is registered.

receiveResponse: any
receiveSingle: any

Receives a response for the given request id.

receiveStreaming: any

Receives a stream of responses for the given request id.

requestId: any

The current request id. Automatically increments for every request.

responseHandlers: any

Handlers for response messages.

sendRequest: any

Sends a request.

streamsByPath: any

Active streams, keyed by the path array encoded as a JSON string.

transport: any

Methods

  • Returns Promise<void>

  • Creates a resource at the given path. Requires CREATE permission.

    Parameters

    • path: string[]

    Returns Promise<ServerMessage<unknown>>

  • Deletes a resource at the given path. Requires DELETE permission.

    Parameters

    • path: string[]

    Returns Promise<ServerMessage<unknown>>

  • Gets the resource at the given path. Requires READ permission.

    Parameters

    • path: string[]

    Returns Promise<ServerMessage<unknown>>

  • Fetches lamp server metrics.

    Returns Promise<ServerMessage<LaserMetrics>>

  • Links the given source to the given destination path. Requires WRITE permission for the destination and READ for the source.

    Parameters

    • srcPath: string[]
    • destPath: string[]

    Returns Promise<ServerMessage<unknown>>

  • Lists the directory tree at the given path. Requires READ permission.

    Parameters

    • path: string[]

    Returns Promise<ServerMessage<unknown>>

  • Creates a directory at the given path. Requires CREATE permission.

    Parameters

    • path: string[]

    Returns Promise<ServerMessage<unknown>>

  • Performs a single request to the given path with the given payload.

    Type Parameters

    • T

    Parameters

    • verb: SingleVerb
    • path: string[]
    • Optional payload: T

    Returns Promise<ServerMessage<unknown>>

  • Combines PUT and CREATE. Requires CREATE and WRITE permission.

    Type Parameters

    • T

    Parameters

    • path: string[]
    • payload: T

    Returns Promise<ServerMessage<unknown>>

  • Updates the resource at the given path with the given payload. Requires WRITE permission.

    Type Parameters

    • T

    Parameters

    • path: string[]
    • payload: T

    Returns Promise<ServerMessage<unknown>>

  • Sends a frame or an input event to the user's model.

    Parameters

    • payload: Uint8Array | InputEvent
    • Optional user: string

    Returns Promise<ServerMessage<unknown>>

  • A promise that resolves once ready.

    Returns Promise<void>

  • Sends a client message.

    Type Parameters

    • P

    Parameters

    Returns Promise<void>

  • Performs a streaming request to the given path with the given payload.

    Type Parameters

    • T

    Parameters

    • path: string[]
    • Optional payload: T

    Returns Promise<AsyncIterable<ServerMessage<unknown>>>

  • Streams the user's model (including e.g. key/controller events).

    Parameters

    • Optional user: string

    Returns Promise<AsyncIterable<ServerMessage<unknown>>>

  • Unlinks the given source from the given destination path. Requires WRITE permission for the destination.

    Parameters

    • srcPath: string[]
    • destPath: string[]

    Returns Promise<ServerMessage<unknown>>

Generated using TypeDoc