Context is the context for interacting with a webmesh daemon.

Hierarchy

  • Context

Properties

client: DaemonClient

client is the daemon client.

error?: Error

error is an error that occurred during polling, if any.

networks: Network[]

networks is the list of networks.

Methods

  • connect creates a new connection to a network. It is semantically equivalent to calling PutNetwork followed by Connect on the returned network. If no parameters are given, the connection with the given ID is connected.

    Parameters

    Returns Promise<Network>

  • deviceMetrics returns a reference to the current device metrics for the network with the given ID. If pollInterval is provided, the metrics will be polled at the given interval, otherwise it defaults to a 5 second interval. The polling will stop when the component is unmounted.

    Parameters

    • id: string
    • Optional pollInterval: number

    Returns InterfaceMetrics

  • disconnect disconnects the network with the given ID.

    Parameters

    • id: string

    Returns Promise<void>

  • DropNetwork disconnects and deletes all data for the connection with the given ID.

    Parameters

    • id: string

    Returns Promise<void>

  • getNetwork returns the network connection with the given ID. It is a convenience method for finding and refreshing the status of a network.

    Parameters

    • id: string

    Returns Promise<Network>

  • putNetwork creates a new network connection.

    Parameters

    • opts: Required<{
          id?: string;
          meta?: Required<({ fields: Required<{ [x: string]: Required<{ kind: Required<{ value: NullValue; case: "nullValue"; } | { value: number; case: "numberValue"; } | { value: string; case: "stringValue"; } | { value: boolean; case: "boolValue"; } | { ...; } | { ...; } | { ...; }>; }>; [x: number]: Required<...>; }>; })>;
          params?: Required<({ authMethod: NetworkAuthMethod; authCredentials: Required<{ [x: string]: string; }>; addrType: ConnectionParameters_AddrType; ... 13 more ...; getType: Required<...>; })>;
      }>

    Returns Promise<Network>

Generated using TypeDoc