@viamrobotics/sdk 0.26.1 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,7 +10,6 @@ Build and connect to robots with TypeScript
10
10
 
11
11
  > **Warning**
12
12
  > This is a beta release of the Viam TypeScript SDK. Stability is not guaranteed. Breaking changes are likely to occur, and occur often.
13
- > TS SDK only works in a browser environment.
14
13
 
15
14
  ## Usage
16
15
 
@@ -28,12 +27,16 @@ npm install @viamrobotics/sdk
28
27
 
29
28
  [https://ts.viam.dev](https://ts.viam.dev/)
30
29
 
30
+ ## Node
31
+
32
+ To use this SDK with node, read the [documentation](/Node.md) or view the [example](/examples/node/)
33
+
31
34
  ## React Native
32
35
 
33
36
  To use this SDK with React Native, read the [documentation](/ReactNative.md) or view the [example](/examples/react-native/)
34
37
 
35
38
  ## License
36
39
 
37
- Copyright 2022-2023 Viam Inc.
40
+ Copyright 2022-2024 Viam Inc.
38
41
 
39
42
  Apache 2.0 - See [LICENSE](https://github.com/viamrobotics/viam-typescript-sdk/blob/main/LICENSE) file
@@ -432,6 +432,17 @@ export declare class AppClient {
432
432
  * @param id The ID of the fragment to delete
433
433
  */
434
434
  deleteFragment(id: string): Promise<void>;
435
+ /**
436
+ * @param machineId The machine ID used to filter fragments defined in a
437
+ * machine's parts. Also returns any fragments nested within the fragments
438
+ * defined in parts.
439
+ * @param additionalFragmentIds Additional fragment IDs to append to the
440
+ * response. Useful when needing to view fragments that will be
441
+ * provisionally added to the machine alongside existing fragments.
442
+ * @returns The list of top level and nested fragments for a machine, as well
443
+ * as additionally specified fragment IDs.
444
+ */
445
+ listMachineFragments(machineId: string, additionalFragmentIds?: string[]): Promise<Fragment[]>;
435
446
  /**
436
447
  * Add a role under an organization.
437
448
  *
@@ -1,4 +1,5 @@
1
1
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import { JointPositions } from '../../gen/component/arm/v1/arm_pb';
3
4
  import type { RobotClient } from '../../robot';
4
5
  import type { Options, Pose } from '../../types';
@@ -12,12 +13,13 @@ export declare class ArmClient implements Arm {
12
13
  private client;
13
14
  private readonly name;
14
15
  private readonly options;
16
+ callOptions: CallOptions;
15
17
  constructor(client: RobotClient, name: string, options?: Options);
16
- getEndPosition(extra?: {}): Promise<import("../../gen/common/v1/common_pb").Pose>;
17
- moveToPosition(pose: Pose, extra?: {}): Promise<void>;
18
- moveToJointPositions(jointPositionsList: number[], extra?: {}): Promise<void>;
19
- getJointPositions(extra?: {}): Promise<JointPositions>;
20
- stop(extra?: {}): Promise<void>;
21
- isMoving(): Promise<boolean>;
22
- doCommand(command: Struct): Promise<JsonValue>;
18
+ getEndPosition(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/common/v1/common_pb").Pose>;
19
+ moveToPosition(pose: Pose, extra?: {}, callOptions?: CallOptions): Promise<void>;
20
+ moveToJointPositions(jointPositionsList: number[], extra?: {}, callOptions?: CallOptions): Promise<void>;
21
+ getJointPositions(extra?: {}, callOptions?: CallOptions): Promise<JointPositions>;
22
+ stop(extra?: {}, callOptions?: CallOptions): Promise<void>;
23
+ isMoving(callOptions?: CallOptions): Promise<boolean>;
24
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
23
25
  }
@@ -38,7 +38,7 @@ export interface Base extends Resource {
38
38
  /** Stop a base */
39
39
  stop(extra?: Struct): Promise<void>;
40
40
  /** Return true if the base is in motion. */
41
- isMoving(extra?: Struct): Promise<boolean>;
41
+ isMoving(): Promise<boolean>;
42
42
  /** Return the base's properties. */
43
43
  getProperties(extra?: Struct): Promise<BaseProperties>;
44
44
  }
@@ -1,4 +1,5 @@
1
1
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import type { RobotClient } from '../../robot';
3
4
  import type { Options, Vector3 } from '../../types';
4
5
  import type { Base } from './base';
@@ -11,13 +12,14 @@ export declare class BaseClient implements Base {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- moveStraight(distanceMm: number, mmPerSec: number, extra?: {}): Promise<void>;
16
- spin(angleDeg: number, degsPerSec: number, extra?: {}): Promise<void>;
17
- setPower(linear: Vector3, angular: Vector3, extra?: {}): Promise<void>;
18
- setVelocity(linear: Vector3, angular: Vector3, extra?: {}): Promise<void>;
19
- stop(extra?: {}): Promise<void>;
20
- isMoving(): Promise<boolean>;
21
- doCommand(command: Struct): Promise<JsonValue>;
22
- getProperties(extra?: {}): Promise<import("../../gen/component/base/v1/base_pb").GetPropertiesResponse>;
17
+ moveStraight(distanceMm: number, mmPerSec: number, extra?: {}, callOptions?: CallOptions): Promise<void>;
18
+ spin(angleDeg: number, degsPerSec: number, extra?: {}, callOptions?: CallOptions): Promise<void>;
19
+ setPower(linear: Vector3, angular: Vector3, extra?: {}, callOptions?: CallOptions): Promise<void>;
20
+ setVelocity(linear: Vector3, angular: Vector3, extra?: {}, callOptions?: CallOptions): Promise<void>;
21
+ stop(extra?: {}, callOptions?: CallOptions): Promise<void>;
22
+ isMoving(callOptions?: CallOptions): Promise<boolean>;
23
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
24
+ getProperties(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/component/base/v1/base_pb").GetPropertiesResponse>;
23
25
  }
@@ -1,6 +1,7 @@
1
1
  import type { RobotClient } from '../../robot';
2
2
  import type { Options } from '../../types';
3
3
  import { Duration, Struct, type JsonValue } from '@bufbuild/protobuf';
4
+ import type { CallOptions } from '@connectrpc/connect';
4
5
  import { type Board, type PowerMode, type Tick } from './board';
5
6
  /**
6
7
  * A gRPC-web client for the Board component.
@@ -11,17 +12,18 @@ export declare class BoardClient implements Board {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- setGPIO(pin: string, high: boolean, extra?: {}): Promise<void>;
16
- getGPIO(pin: string, extra?: {}): Promise<boolean>;
17
- getPWM(pin: string, extra?: {}): Promise<number>;
18
- setPWM(pin: string, dutyCyle: number, extra?: {}): Promise<void>;
19
- getPWMFrequency(pin: string, extra?: {}): Promise<number>;
20
- setPWMFrequency(pin: string, frequencyHz: number, extra?: {}): Promise<void>;
21
- readAnalogReader(analogReader: string, extra?: {}): Promise<import("../../gen/component/board/v1/board_pb").ReadAnalogReaderResponse>;
22
- writeAnalog(pin: string, value: number, extra?: {}): Promise<void>;
23
- getDigitalInterruptValue(digitalInterruptName: string, extra?: {}): Promise<number>;
24
- streamTicks(interrupts: string[], queue: Tick[], extra?: {}): Promise<void>;
25
- setPowerMode(powerMode: PowerMode, duration?: Duration, extra?: {}): Promise<void>;
26
- doCommand(command: Struct): Promise<JsonValue>;
17
+ setGPIO(pin: string, high: boolean, extra?: {}, callOptions?: CallOptions): Promise<void>;
18
+ getGPIO(pin: string, extra?: {}, callOptions?: CallOptions): Promise<boolean>;
19
+ getPWM(pin: string, extra?: {}, callOptions?: CallOptions): Promise<number>;
20
+ setPWM(pin: string, dutyCyle: number, extra?: {}, callOptions?: CallOptions): Promise<void>;
21
+ getPWMFrequency(pin: string, extra?: {}, callOptions?: CallOptions): Promise<number>;
22
+ setPWMFrequency(pin: string, frequencyHz: number, extra?: {}, callOptions?: CallOptions): Promise<void>;
23
+ readAnalogReader(analogReader: string, extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/component/board/v1/board_pb").ReadAnalogReaderResponse>;
24
+ writeAnalog(pin: string, value: number, extra?: {}, callOptions?: CallOptions): Promise<void>;
25
+ getDigitalInterruptValue(digitalInterruptName: string, extra?: {}, callOptions?: CallOptions): Promise<number>;
26
+ streamTicks(interrupts: string[], queue: Tick[], extra?: {}, callOptions?: CallOptions): Promise<void>;
27
+ setPowerMode(powerMode: PowerMode, duration?: Duration, extra?: {}, callOptions?: CallOptions): Promise<void>;
28
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
27
29
  }
@@ -1,4 +1,5 @@
1
1
  import type { JsonValue, Struct } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import type { RobotClient } from '../../robot';
3
4
  import type { Options } from '../../types';
4
5
  import type { Camera, MimeType } from './camera';
@@ -11,10 +12,11 @@ export declare class CameraClient implements Camera {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- getImage(mimeType?: MimeType): Promise<Uint8Array>;
16
- renderFrame(mimeType?: MimeType): Promise<Blob>;
17
- getPointCloud(): Promise<Uint8Array>;
18
- getProperties(): Promise<import("../../gen/component/camera/v1/camera_pb").GetPropertiesResponse>;
19
- doCommand(command: Struct): Promise<JsonValue>;
17
+ getImage(mimeType?: MimeType, callOptions?: CallOptions): Promise<Uint8Array>;
18
+ renderFrame(mimeType?: MimeType, callOptions?: CallOptions): Promise<Blob>;
19
+ getPointCloud(callOptions?: CallOptions): Promise<Uint8Array>;
20
+ getProperties(callOptions?: CallOptions): Promise<import("../../gen/component/camera/v1/camera_pb").GetPropertiesResponse>;
21
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
20
22
  }
@@ -1,4 +1,5 @@
1
1
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import type { RobotClient } from '../../robot';
3
4
  import type { Options } from '../../types';
4
5
  import { EncoderPositionType, type Encoder } from './encoder';
@@ -11,9 +12,10 @@ export declare class EncoderClient implements Encoder {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- resetPosition(extra?: {}): Promise<void>;
16
- getProperties(extra?: {}): Promise<import("../../gen/component/encoder/v1/encoder_pb").GetPropertiesResponse>;
17
- getPosition(positionType?: EncoderPositionType, extra?: {}): Promise<readonly [number, import("../../gen/component/encoder/v1/encoder_pb").PositionType]>;
18
- doCommand(command: Struct): Promise<JsonValue>;
17
+ resetPosition(extra?: {}, callOptions?: CallOptions): Promise<void>;
18
+ getProperties(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/component/encoder/v1/encoder_pb").GetPropertiesResponse>;
19
+ getPosition(positionType?: EncoderPositionType, extra?: {}, callOptions?: CallOptions): Promise<readonly [number, import("../../gen/component/encoder/v1/encoder_pb").PositionType]>;
20
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
19
21
  }
@@ -1,4 +1,5 @@
1
1
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import type { RobotClient } from '../../robot';
3
4
  import type { Options } from '../../types';
4
5
  import type { Gantry } from './gantry';
@@ -11,12 +12,13 @@ export declare class GantryClient implements Gantry {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- getPosition(extra?: {}): Promise<number[]>;
16
- moveToPosition(positionsMm: number[], speedsMmPerSec: number[], extra?: {}): Promise<void>;
17
- home(extra?: {}): Promise<boolean>;
18
- getLengths(extra?: {}): Promise<number[]>;
19
- stop(extra?: {}): Promise<void>;
20
- isMoving(): Promise<boolean>;
21
- doCommand(command: Struct): Promise<JsonValue>;
17
+ getPosition(extra?: {}, callOptions?: CallOptions): Promise<number[]>;
18
+ moveToPosition(positionsMm: number[], speedsMmPerSec: number[], extra?: {}, callOptions?: CallOptions): Promise<void>;
19
+ home(extra?: {}, callOptions?: CallOptions): Promise<boolean>;
20
+ getLengths(extra?: {}, callOptions?: CallOptions): Promise<number[]>;
21
+ stop(extra?: {}, callOptions?: CallOptions): Promise<void>;
22
+ isMoving(callOptions?: CallOptions): Promise<boolean>;
23
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
22
24
  }
@@ -1,4 +1,5 @@
1
1
  import type { JsonValue, Struct } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import type { RobotClient } from '../../robot';
3
4
  import type { Options } from '../../types';
4
5
  import type { Generic } from './generic';
@@ -11,6 +12,7 @@ export declare class GenericClient implements Generic {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- doCommand(command: Struct): Promise<JsonValue>;
17
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
16
18
  }
@@ -1,4 +1,5 @@
1
1
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import type { RobotClient } from '../../robot';
3
4
  import type { Options } from '../../types';
4
5
  import type { Gripper } from './gripper';
@@ -11,10 +12,11 @@ export declare class GripperClient implements Gripper {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- open(extra?: {}): Promise<void>;
16
- grab(extra?: {}): Promise<void>;
17
- stop(extra?: {}): Promise<void>;
18
- isMoving(): Promise<boolean>;
19
- doCommand(command: Struct): Promise<JsonValue>;
17
+ open(extra?: {}, callOptions?: CallOptions): Promise<void>;
18
+ grab(extra?: {}, callOptions?: CallOptions): Promise<void>;
19
+ stop(extra?: {}, callOptions?: CallOptions): Promise<void>;
20
+ isMoving(callOptions?: CallOptions): Promise<boolean>;
21
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
20
22
  }
@@ -1,6 +1,7 @@
1
1
  import type { RobotClient } from '../../robot';
2
2
  import type { Options } from '../../types';
3
3
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
4
+ import type { CallOptions } from '@connectrpc/connect';
4
5
  import type { InputController, InputControllerEvent } from './input-controller';
5
6
  /**
6
7
  * A gRPC-web client for the Input Controller component.
@@ -11,8 +12,9 @@ export declare class InputControllerClient implements InputController {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- getEvents(extra?: {}): Promise<import("../../gen/component/inputcontroller/v1/input_controller_pb").Event[]>;
16
- triggerEvent(event: InputControllerEvent, extra?: {}): Promise<void>;
17
- doCommand(command: Struct): Promise<JsonValue>;
17
+ getEvents(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/component/inputcontroller/v1/input_controller_pb").Event[]>;
18
+ triggerEvent(event: InputControllerEvent, extra?: {}, callOptions?: CallOptions): Promise<void>;
19
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
18
20
  }
@@ -1,4 +1,5 @@
1
1
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import type { RobotClient } from '../../robot';
3
4
  import type { Options } from '../../types';
4
5
  import type { Motor } from './motor';
@@ -11,18 +12,19 @@ export declare class MotorClient implements Motor {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- setPower(power: number, extra?: {}): Promise<void>;
16
- goFor(rpm: number, revolutions: number, extra?: {}): Promise<void>;
17
- goTo(rpm: number, positionRevolutions: number, extra?: {}): Promise<void>;
18
- setRPM(rpm: number, extra?: {}): Promise<void>;
19
- resetZeroPosition(offset: number, extra?: {}): Promise<void>;
20
- stop(extra?: {}): Promise<void>;
21
- getProperties(extra?: {}): Promise<{
17
+ setPower(power: number, extra?: {}, callOptions?: CallOptions): Promise<void>;
18
+ goFor(rpm: number, revolutions: number, extra?: {}, callOptions?: CallOptions): Promise<void>;
19
+ goTo(rpm: number, positionRevolutions: number, extra?: {}, callOptions?: CallOptions): Promise<void>;
20
+ setRPM(rpm: number, extra?: {}, callOptions?: CallOptions): Promise<void>;
21
+ resetZeroPosition(offset: number, extra?: {}, callOptions?: CallOptions): Promise<void>;
22
+ stop(extra?: {}, callOptions?: CallOptions): Promise<void>;
23
+ getProperties(extra?: {}, callOptions?: CallOptions): Promise<{
22
24
  positionReporting: boolean;
23
25
  }>;
24
- getPosition(extra?: {}): Promise<number>;
25
- isPowered(extra?: {}): Promise<readonly [boolean, number]>;
26
- isMoving(): Promise<boolean>;
27
- doCommand(command: Struct): Promise<JsonValue>;
26
+ getPosition(extra?: {}, callOptions?: CallOptions): Promise<number>;
27
+ isPowered(extra?: {}, callOptions?: CallOptions): Promise<readonly [boolean, number]>;
28
+ isMoving(callOptions?: CallOptions): Promise<boolean>;
29
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
28
30
  }
@@ -1,4 +1,5 @@
1
1
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import type { RobotClient } from '../../robot';
3
4
  import type { Options } from '../../types';
4
5
  import type { MovementSensor } from './movement-sensor';
@@ -11,15 +12,16 @@ export declare class MovementSensorClient implements MovementSensor {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- getLinearVelocity(extra?: {}): Promise<import("../../gen/common/v1/common_pb").Vector3>;
16
- getAngularVelocity(extra?: {}): Promise<import("../../gen/common/v1/common_pb").Vector3>;
17
- getCompassHeading(extra?: {}): Promise<number>;
18
- getOrientation(extra?: {}): Promise<import("../../gen/common/v1/common_pb").Orientation>;
19
- getPosition(extra?: {}): Promise<import("../../gen/component/movementsensor/v1/movementsensor_pb").GetPositionResponse>;
20
- getProperties(extra?: {}): Promise<import("../../gen/component/movementsensor/v1/movementsensor_pb").GetPropertiesResponse>;
21
- getAccuracy(extra?: {}): Promise<import("../../gen/component/movementsensor/v1/movementsensor_pb").GetAccuracyResponse>;
22
- getLinearAcceleration(extra?: {}): Promise<import("../../gen/common/v1/common_pb").Vector3>;
23
- getReadings(extra?: {}): Promise<Record<string, JsonValue>>;
24
- doCommand(command: Struct): Promise<JsonValue>;
17
+ getLinearVelocity(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/common/v1/common_pb").Vector3>;
18
+ getAngularVelocity(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/common/v1/common_pb").Vector3>;
19
+ getCompassHeading(extra?: {}, callOptions?: CallOptions): Promise<number>;
20
+ getOrientation(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/common/v1/common_pb").Orientation>;
21
+ getPosition(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/component/movementsensor/v1/movementsensor_pb").GetPositionResponse>;
22
+ getProperties(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/component/movementsensor/v1/movementsensor_pb").GetPropertiesResponse>;
23
+ getAccuracy(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/component/movementsensor/v1/movementsensor_pb").GetAccuracyResponse>;
24
+ getLinearAcceleration(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/common/v1/common_pb").Vector3>;
25
+ getReadings(extra?: {}, callOptions?: CallOptions): Promise<Record<string, JsonValue>>;
26
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
25
27
  }
@@ -1,4 +1,5 @@
1
1
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import type { RobotClient } from '../../robot';
3
4
  import type { Options } from '../../types';
4
5
  import type { PowerSensor } from './power-sensor';
@@ -11,10 +12,11 @@ export declare class PowerSensorClient implements PowerSensor {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- getVoltage(extra?: {}): Promise<readonly [number, boolean]>;
16
- getCurrent(extra?: {}): Promise<readonly [number, boolean]>;
17
- getPower(extra?: {}): Promise<number>;
18
- getReadings(extra?: {}): Promise<Record<string, JsonValue>>;
19
- doCommand(command: Struct): Promise<JsonValue>;
17
+ getVoltage(extra?: {}, callOptions?: CallOptions): Promise<readonly [number, boolean]>;
18
+ getCurrent(extra?: {}, callOptions?: CallOptions): Promise<readonly [number, boolean]>;
19
+ getPower(extra?: {}, callOptions?: CallOptions): Promise<number>;
20
+ getReadings(extra?: {}, callOptions?: CallOptions): Promise<Record<string, JsonValue>>;
21
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
20
22
  }
@@ -1,6 +1,7 @@
1
1
  import type { RobotClient } from '../../robot';
2
2
  import type { Options } from '../../types';
3
3
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
4
+ import type { CallOptions } from '@connectrpc/connect';
4
5
  import type { Sensor } from './sensor';
5
6
  /**
6
7
  * A gRPC-web client for the Sensor component.
@@ -11,7 +12,8 @@ export declare class SensorClient implements Sensor {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- getReadings(extra?: {}): Promise<Record<string, JsonValue>>;
16
- doCommand(command: Struct): Promise<JsonValue>;
17
+ getReadings(extra?: {}, callOptions?: CallOptions): Promise<Record<string, JsonValue>>;
18
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
17
19
  }
@@ -1,4 +1,5 @@
1
1
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import type { RobotClient } from '../../robot';
3
4
  import type { Options } from '../../types';
4
5
  import type { Servo } from './servo';
@@ -11,10 +12,11 @@ export declare class ServoClient implements Servo {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- move(angleDeg: number, extra?: {}): Promise<void>;
16
- getPosition(extra?: {}): Promise<number>;
17
- stop(extra?: {}): Promise<void>;
18
- isMoving(): Promise<boolean>;
19
- doCommand(command: Struct): Promise<JsonValue>;
17
+ move(angleDeg: number, extra?: {}, callOptions?: CallOptions): Promise<void>;
18
+ getPosition(extra?: {}, callOptions?: CallOptions): Promise<number>;
19
+ stop(extra?: {}, callOptions?: CallOptions): Promise<void>;
20
+ isMoving(callOptions?: CallOptions): Promise<boolean>;
21
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
20
22
  }
package/dist/main.d.ts CHANGED
@@ -330,5 +330,5 @@ export { GenericClient as GenericServiceClient, type Generic as GenericService,
330
330
  */
331
331
  export * as commonApi from './gen/common/v1/common_pb';
332
332
  export * from './types';
333
- export { doCommandFromClient } from './utils';
333
+ export { addMetadata, deleteMetadata, disableDebugLogging, doCommandFromClient, enableDebugLogging, } from './utils';
334
334
  export { MachineConnectionEvent } from './events';