@viamrobotics/sdk 0.0.39 → 0.0.40-alpha.1

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.
@@ -2,7 +2,11 @@ import type { RobotClient } from '../../robot';
2
2
  import pb from '../../gen/component/arm/v1/arm_pb';
3
3
  import type { Options, Pose } from '../../types';
4
4
  import type { Arm } from './Arm';
5
- /** A gRPC-web client for the Arm component. */
5
+ /**
6
+ * A gRPC-web client for the Arm component.
7
+ *
8
+ * @group Clients
9
+ */
6
10
  export declare class ArmClient implements Arm {
7
11
  private client;
8
12
  private readonly name;
@@ -1,7 +1,11 @@
1
1
  import type { RobotClient } from '../../robot';
2
2
  import type { Base } from './Base';
3
3
  import type { Options, Vector3D } from '../../types';
4
- /** A gRPC-web client for the Base component. */
4
+ /**
5
+ * A gRPC-web client for the Base component.
6
+ *
7
+ * @group Clients
8
+ */
5
9
  export declare class BaseClient implements Base {
6
10
  private client;
7
11
  private readonly name;
@@ -2,7 +2,11 @@ import type { Board } from './Board';
2
2
  import type { RobotClient } from '../../robot';
3
3
  import type { Options } from '../../types';
4
4
  import pb from '../../gen/component/board/v1/board_pb';
5
- /** A gRPC-web client for the Board component. */
5
+ /**
6
+ * A gRPC-web client for the Board component.
7
+ *
8
+ * @group Clients
9
+ */
6
10
  export declare class BoardClient implements Board {
7
11
  private client;
8
12
  private readonly name;
@@ -2,7 +2,11 @@ import type { Camera, MimeType } from './Camera';
2
2
  import type { RobotClient } from '../../robot';
3
3
  import type { Options } from '../../types';
4
4
  import pb from '../../gen/component/camera/v1/camera_pb';
5
- /** A gRPC-web client for the Camera component. */
5
+ /**
6
+ * A gRPC-web client for the Camera component.
7
+ *
8
+ * @group Clients
9
+ */
6
10
  export declare class CameraClient implements Camera {
7
11
  private client;
8
12
  private readonly name;
@@ -0,0 +1,19 @@
1
+ import type { RobotClient } from '../../robot';
2
+ import type { Options } from '../../types';
3
+ import type { Gripper } from './Gripper';
4
+ /**
5
+ * A gRPC-web client for the Gripper component.
6
+ *
7
+ * @group Clients
8
+ */
9
+ export declare class GripperClient implements Gripper {
10
+ private client;
11
+ private readonly name;
12
+ private readonly options;
13
+ constructor(client: RobotClient, name: string, options?: Options);
14
+ private get GripperService();
15
+ open(extra?: {}): Promise<void>;
16
+ grab(extra?: {}): Promise<void>;
17
+ stop(extra?: {}): Promise<void>;
18
+ isMoving(): Promise<boolean>;
19
+ }
@@ -0,0 +1,12 @@
1
+ import type { Extra } from '../../types';
2
+ /** Represents a physical robotic gripper. */
3
+ export interface Gripper {
4
+ /** Open a gripper of the underlying robot. */
5
+ open: (extra?: Extra) => Promise<void>;
6
+ /** Request a gripper of the underlying robot to grab. */
7
+ grab: (extra?: Extra) => Promise<void>;
8
+ /** Stop a robot's gripper. */
9
+ stop: (extra?: Extra) => Promise<void>;
10
+ /** Report if a component is in motion. */
11
+ isMoving: () => Promise<boolean>;
12
+ }
@@ -0,0 +1,2 @@
1
+ export type { Gripper } from './gripper/Gripper';
2
+ export { GripperClient } from './gripper/Client';
@@ -1,7 +1,11 @@
1
1
  import type { RobotClient } from '../../robot';
2
2
  import type { Motor } from './Motor';
3
3
  import type { Options } from '../../types';
4
- /** A gRPC-web client for the Motor component. */
4
+ /**
5
+ * A gRPC-web client for the Motor component.
6
+ *
7
+ * @group Clients
8
+ */
5
9
  export declare class MotorClient implements Motor {
6
10
  private client;
7
11
  private readonly name;
@@ -1,7 +1,11 @@
1
1
  import type { RobotClient } from '../../robot';
2
2
  import type { MovementSensor } from './MovementSensor';
3
3
  import type { Options } from '../../types';
4
- /** A gRPC-web client for the MovementSensor component. */
4
+ /**
5
+ * A gRPC-web client for the MovementSensor component.
6
+ *
7
+ * @group Clients
8
+ */
5
9
  export declare class MovementSensorClient implements MovementSensor {
6
10
  private client;
7
11
  private sensorclient;
@@ -1,7 +1,11 @@
1
1
  import type { RobotClient } from '../../robot';
2
2
  import type { Options } from '../../types';
3
3
  import type { Sensor } from './Sensor';
4
- /** A gRPC-web client for the Sensor component. */
4
+ /**
5
+ * A gRPC-web client for the Sensor component.
6
+ *
7
+ * @group Clients
8
+ */
5
9
  export declare class SensorClient implements Sensor {
6
10
  private client;
7
11
  private readonly name;
@@ -2,6 +2,11 @@ import { EventDispatcher } from '../../events';
2
2
  import type { RobotClient } from '../../robot';
3
3
  import type { Options } from '../../types';
4
4
  import type { Stream } from './Stream';
5
+ /**
6
+ * A gRPC-web client for a Stream.
7
+ *
8
+ * @group Clients
9
+ */
5
10
  export declare class StreamClient extends EventDispatcher implements Stream {
6
11
  private client;
7
12
  private readonly options;
package/dist/main.d.ts CHANGED
@@ -1,33 +1,390 @@
1
- import { RobotClient as Client } from './robot';
2
- import { version } from '../package.json';
3
- import armApi from './gen/component/arm/v1/arm_pb';
4
- import baseApi from './gen/component/base/v1/base_pb';
5
- import boardApi from './gen/component/board/v1/board_pb';
6
- import cameraApi from './gen/component/camera/v1/camera_pb';
7
- import commonApi from './gen/common/v1/common_pb';
8
- import gantryApi from './gen/component/gantry/v1/gantry_pb';
9
- import genericApi from './gen/component/generic/v1/generic_pb';
10
- import gripperApi from './gen/component/gripper/v1/gripper_pb';
11
- import inputControllerApi from './gen/component/inputcontroller/v1/input_controller_pb';
12
- import motionApi from './gen/service/motion/v1/motion_pb';
13
- import motorApi from './gen/component/motor/v1/motor_pb';
14
- import movementSensorApi from './gen/component/movementsensor/v1/movementsensor_pb';
15
- import navigationApi from './gen/service/navigation/v1/navigation_pb';
16
- import robotApi from './gen/robot/v1/robot_pb';
17
- import sensorApi from './gen/component/sensor/v1/sensor_pb';
18
- import sensorsApi from './gen/service/sensors/v1/sensors_pb';
19
- import servoApi from './gen/component/servo/v1/servo_pb';
20
- import slamApi from './gen/service/slam/v1/slam_pb';
21
- import streamApi from './gen/proto/stream/v1/stream_pb';
22
- import visionApi from './gen/service/vision/v1/vision_pb';
1
+ export { version } from '../package.json';
2
+ /**
3
+ * Raw Protobuf interfaces for a Robot component.
4
+ *
5
+ * Generated with https://github.com/improbable-eng/grpc-web
6
+ *
7
+ * @deprecated Use {@link RobotClient} instead.
8
+ * @alpha
9
+ * @group Raw Protobufs
10
+ */
11
+ export { default as robotApi } from './gen/robot/v1/robot_pb';
23
12
  export { type Robot, type DialDirectConf, type DialWebRTCConf, RobotClient, createRobotClient, } from './robot';
13
+ /**
14
+ * @deprecated Use {@link RobotClient} instead.
15
+ * @group Clients
16
+ */
17
+ export { RobotClient as Client } from './robot';
18
+ /**
19
+ * Raw Protobuf interfaces for an Arm component.
20
+ *
21
+ * Generated with https://github.com/improbable-eng/grpc-web
22
+ *
23
+ * @deprecated Use {@link ArmClient} instead.
24
+ * @alpha
25
+ * @group Raw Protobufs
26
+ */
27
+ export { default as armApi } from './gen/component/arm/v1/arm_pb';
24
28
  export { type Arm, ArmClient } from './components/arm';
29
+ /**
30
+ * Raw Protobuf interfaces for a Base component.
31
+ *
32
+ * Generated with https://github.com/improbable-eng/grpc-web
33
+ *
34
+ * @deprecated Use {@link BaseClient} instead.
35
+ * @alpha
36
+ * @group Raw Protobufs
37
+ */
38
+ export { default as baseApi } from './gen/component/base/v1/base_pb';
25
39
  export { type Base, BaseClient } from './components/base';
40
+ /**
41
+ * Raw Protobuf interfaces for a Board component.
42
+ *
43
+ * Generated with https://github.com/improbable-eng/grpc-web
44
+ *
45
+ * @deprecated Use {@link BoardClient} instead.
46
+ * @alpha
47
+ * @group Raw Protobufs
48
+ */
49
+ export { default as boardApi } from './gen/component/board/v1/board_pb';
26
50
  export { type Board, BoardClient } from './components/board';
51
+ /**
52
+ * Raw Protobuf interfaces for a Camera component.
53
+ *
54
+ * Generated with https://github.com/improbable-eng/grpc-web
55
+ *
56
+ * @deprecated Use {@link CameraClient} instead.
57
+ * @alpha
58
+ * @group Raw Protobufs
59
+ */
60
+ export { default as cameraApi } from './gen/component/camera/v1/camera_pb';
27
61
  export { type Camera, CameraClient } from './components/camera';
62
+ /**
63
+ * Raw Protobuf interfaces for a Motor component.
64
+ *
65
+ * Generated with https://github.com/improbable-eng/grpc-web
66
+ *
67
+ * @deprecated Use {@link MotorClient} instead.
68
+ * @alpha
69
+ * @group Raw Protobufs
70
+ */
71
+ export { default as motorApi } from './gen/component/motor/v1/motor_pb';
28
72
  export { type Motor, MotorClient } from './components/motor';
73
+ /**
74
+ * Raw Protobuf interfaces for a MovementSensor component.
75
+ *
76
+ * Generated with https://github.com/improbable-eng/grpc-web
77
+ *
78
+ * @deprecated Use {@link MovementSensorClient} instead.
79
+ * @alpha
80
+ * @group Raw Protobufs
81
+ */
82
+ export { default as movementSensorApi } from './gen/component/movementsensor/v1/movementsensor_pb';
29
83
  export { type MovementSensor, MovementSensorClient, } from './components/movementsensor';
84
+ /**
85
+ * Raw Protobuf interfaces generated with
86
+ * https://github.com/improbable-eng/grpc-web for a Sensor component.
87
+ *
88
+ * @deprecated Use {@link SensorClient} instead.
89
+ * @alpha
90
+ * @group Raw Protobufs
91
+ */
92
+ export { default as sensorApi } from './gen/component/sensor/v1/sensor_pb';
30
93
  export { type Sensor, SensorClient } from './components/sensor';
94
+ /**
95
+ * Raw Protobuf interfaces for a Sensors service.
96
+ *
97
+ * Generated with https://github.com/improbable-eng/grpc-web
98
+ *
99
+ * @example
100
+ *
101
+ * ```ts
102
+ * import { grpc } from '@improbable-eng/grpc-web';
103
+ *
104
+ * const client = {}; // replace with a connected robot client
105
+ *
106
+ * const request = new sensorsApi.GetSensorsRequest();
107
+ * request.setName('mysensors');
108
+ *
109
+ * client.sensorsService.getSensors(
110
+ * request,
111
+ * new grpc.Metadata(),
112
+ * (error, response) => {
113
+ * // do something with error or response
114
+ * }
115
+ * );
116
+ * ```
117
+ *
118
+ * @alpha
119
+ * @group Raw Protobufs
120
+ */
121
+ export { default as sensorsApi } from './gen/service/sensors/v1/sensors_pb';
122
+ /**
123
+ * Raw Protobuf interfaces for a Stream.
124
+ *
125
+ * Generated with https://github.com/improbable-eng/grpc-web
126
+ *
127
+ * @deprecated Use {@link StreamClient} instead.
128
+ * @group Raw Protobufs
129
+ */
130
+ export { default as streamApi } from './gen/proto/stream/v1/stream_pb';
31
131
  export { type Stream, StreamClient } from './extra/stream';
32
- export { commonApi, armApi, baseApi, boardApi, cameraApi, gantryApi, genericApi, gripperApi, inputControllerApi, motorApi, motionApi, movementSensorApi, servoApi, navigationApi, robotApi, sensorApi, sensorsApi, slamApi, visionApi, streamApi, Client, version, };
132
+ /**
133
+ * Raw Protobuf interfaces for a Gantry component.
134
+ *
135
+ * Generated with https://github.com/improbable-eng/grpc-web
136
+ *
137
+ * @example
138
+ *
139
+ * ```ts
140
+ * import { grpc } from '@improbable-eng/grpc-web';
141
+ *
142
+ * const client = {}; // replace with a connected robot client
143
+ *
144
+ * const request = new gantryApi.GetLengthsRequest();
145
+ * request.setName('mygantry');
146
+ *
147
+ * client.gantryService.getLengths(
148
+ * request,
149
+ * new grpc.Metadata(),
150
+ * (error, response) => {
151
+ * // do something with error or response
152
+ * }
153
+ * );
154
+ * ```
155
+ *
156
+ * @alpha
157
+ * @group Raw Protobufs
158
+ */
159
+ export { default as gantryApi } from './gen/component/gantry/v1/gantry_pb';
160
+ /**
161
+ * Raw Protobuf interfaces for a Generic component.
162
+ *
163
+ * Generated with https://github.com/improbable-eng/grpc-web
164
+ *
165
+ * @example
166
+ *
167
+ * ```ts
168
+ * import { grpc } from '@improbable-eng/grpc-web';
169
+ * import { Struct } from 'google-protobuf/google/protobuf/struct_pb';
170
+ *
171
+ * const client = {}; // replace with a connected robot client
172
+ *
173
+ * const request = new genericApi.DoCommandRequest();
174
+ * request.setName('mygeneric');
175
+ * request.setCommand(Struct.fromJavaScript({ foo: 'bar' }));
176
+ *
177
+ * client.genericService.doCommand(
178
+ * request,
179
+ * new grpc.Metadata(),
180
+ * (error, response) => {
181
+ * // do something with error or response
182
+ * }
183
+ * );
184
+ * ```
185
+ *
186
+ * @alpha
187
+ * @group Raw Protobufs
188
+ */
189
+ export { default as genericApi } from './gen/component/generic/v1/generic_pb';
190
+ /**
191
+ * Raw Protobuf interfaces for a Gripper component.
192
+ *
193
+ * Generated with https://github.com/improbable-eng/grpc-web
194
+ *
195
+ *
196
+ * @deprecated Use {@link GripperClient} instead.
197
+ * @alpha
198
+ * @group Raw Protobufs
199
+ */
200
+ export { default as gripperApi } from './gen/component/gripper/v1/gripper_pb';
201
+ export { type Gripper, GripperClient } from './components/gripper';
202
+ /**
203
+ * Raw Protobuf interfaces for an InputController component.
204
+ *
205
+ * Generated with https://github.com/improbable-eng/grpc-web
206
+ *
207
+ * @example
208
+ *
209
+ * ```ts
210
+ * import { grpc } from '@improbable-eng/grpc-web';
211
+ *
212
+ * const client = {}; // replace with a connected robot client
213
+ *
214
+ * const request = new inputControllerApi.GetControlsRequest();
215
+ * request.setName('myinput controller');
216
+ *
217
+ * client.inputControllerService.getControls(
218
+ * request,
219
+ * new grpc.Metadata(),
220
+ * (error, response) => {
221
+ * // do something with error or response
222
+ * }
223
+ * );
224
+ * ```
225
+ *
226
+ * @alpha
227
+ * @group Raw Protobufs
228
+ */
229
+ export { default as inputControllerApi } from './gen/component/inputcontroller/v1/input_controller_pb';
230
+ /**
231
+ * Raw Protobuf interfaces for a Motion service.
232
+ *
233
+ * Generated with https://github.com/improbable-eng/grpc-web
234
+ *
235
+ * @example
236
+ *
237
+ * ```ts
238
+ * import { grpc } from '@improbable-eng/grpc-web';
239
+ *
240
+ * const client = {}; // replace with a connected robot client
241
+ *
242
+ * const request = new motionApi.GetPoseRequest();
243
+ * request.setName('mymotion');
244
+ *
245
+ * client.motionService.getPose(
246
+ * request,
247
+ * new grpc.Metadata(),
248
+ * (error, response) => {
249
+ * // do something with error or response
250
+ * }
251
+ * );
252
+ * ```
253
+ *
254
+ * @alpha
255
+ * @group Raw Protobufs
256
+ */
257
+ export { default as motionApi } from './gen/service/motion/v1/motion_pb';
258
+ /**
259
+ * Raw Protobuf interfaces for a Navigation service.
260
+ *
261
+ * Generated with https://github.com/improbable-eng/grpc-web
262
+ *
263
+ * @example
264
+ *
265
+ * ```ts
266
+ * import { grpc } from '@improbable-eng/grpc-web';
267
+ *
268
+ * const client = {}; // replace with a connected robot client
269
+ *
270
+ * const request = new navigationApi.GetWaypointsRequest();
271
+ * request.setName('mynavigation');
272
+ *
273
+ * client.navigationService.getWaypoints(
274
+ * request,
275
+ * new grpc.Metadata(),
276
+ * (error, response) => {
277
+ * // do something with error or response
278
+ * }
279
+ * );
280
+ * ```
281
+ *
282
+ * @alpha
283
+ * @group Raw Protobufs
284
+ */
285
+ export { default as navigationApi } from './gen/service/navigation/v1/navigation_pb';
286
+ /**
287
+ * Raw Protobuf interfaces for a Servo component.
288
+ *
289
+ * Generated with https://github.com/improbable-eng/grpc-web
290
+ *
291
+ * @example
292
+ *
293
+ * ```ts
294
+ * import { grpc } from '@improbable-eng/grpc-web';
295
+ *
296
+ * const client = {}; // replace with a connected robot client
297
+ *
298
+ * const request = new servoApi.GetPositionRequest();
299
+ * request.setName('myservo');
300
+ *
301
+ * client.servoService.getPosition(
302
+ * request,
303
+ * new grpc.Metadata(),
304
+ * (error, response) => {
305
+ * // do something with error or response
306
+ * }
307
+ * );
308
+ * ```
309
+ *
310
+ * @alpha
311
+ * @group Raw Protobufs
312
+ */
313
+ export { default as servoApi } from './gen/component/servo/v1/servo_pb';
314
+ /**
315
+ * Raw Protobuf interfaces for a Slam service.
316
+ *
317
+ * Generated with https://github.com/improbable-eng/grpc-web
318
+ *
319
+ * @example
320
+ *
321
+ * ```ts
322
+ * import { grpc } from '@improbable-eng/grpc-web';
323
+ *
324
+ * const client = {}; // replace with a connected robot client
325
+ *
326
+ * const request = new slamApi.GetPositionRequest();
327
+ * request.setName('myslam');
328
+ *
329
+ * client.slamService.getPosition(
330
+ * request,
331
+ * new grpc.Metadata(),
332
+ * (error, response) => {
333
+ * // do something with error or response
334
+ * }
335
+ * );
336
+ * ```
337
+ *
338
+ * @alpha
339
+ * @group Raw Protobufs
340
+ */
341
+ export { default as slamApi } from './gen/service/slam/v1/slam_pb';
342
+ /**
343
+ * Raw Protobuf interfaces for a Vision service.
344
+ *
345
+ * Generated with https://github.com/improbable-eng/grpc-web
346
+ *
347
+ * @example
348
+ *
349
+ * ```ts
350
+ * import { grpc } from '@improbable-eng/grpc-web';
351
+ *
352
+ * const client = {}; // replace with a connected robot client
353
+ *
354
+ * const request = new visionApi.GetDetectorNamesRequest();
355
+ * request.setName('myvision');
356
+ *
357
+ * client.visionService.getDetectorNames(
358
+ * request,
359
+ * new grpc.Metadata(),
360
+ * (error, response) => {
361
+ * // do something with error or response
362
+ * }
363
+ * );
364
+ * ```
365
+ *
366
+ * @alpha
367
+ * @group Raw Protobufs
368
+ */
369
+ export { default as visionApi } from './gen/service/vision/v1/vision_pb';
370
+ /**
371
+ * Raw Protobuf interfaces that are shared across multiple components and
372
+ * services.
373
+ *
374
+ * Generated with https://github.com/improbable-eng/grpc-web
375
+ *
376
+ * @alpha
377
+ * @group Raw Protobufs
378
+ */
379
+ export { default as commonApi } from './gen/common/v1/common_pb';
380
+ /**
381
+ * Raw Protobuf response and error types.
382
+ *
383
+ * Generated with https://github.com/improbable-eng/grpc-web
384
+ *
385
+ * @privateRemarks
386
+ * It doesn't matter which ServiceError we export.
387
+ * @alpha
388
+ * @group Raw Protobufs
389
+ */
33
390
  export type { ResponseStream, ServiceError, } from './gen/robot/v1/robot_pb_service';