Context is the context for a Webmesh component.

Hierarchy

  • Context

Properties

client: Ref<DaemonClient>

client is a reference to the current daemon client.

error: Ref<null | Error>

error is a reference to the current error.

networks: Ref<Network[]>

networks is a reference to the current 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 Ref<null | 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<undefined | ({ 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<undefined | ({ authMethod: NetworkAuthMethod; authCredentials: Required<{ [x: string]: string; }>; addrType: ConnectionParameters_AddrType; ... 13 more ...; getType: Required<...>; })>;
      }>

    Returns Promise<Network>

Generated using TypeDoc