@viamrobotics/sdk 0.1.1-0 → 0.2.0-rc.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.
@@ -0,0 +1,8 @@
1
+ import { EventDispatcher } from './events';
2
+ import type { ResponseStream } from './gen/robot/v1/robot_pb_service';
3
+ export declare class ViamResponseStream<T> extends EventDispatcher {
4
+ private stream;
5
+ constructor(stream: ResponseStream<any>);
6
+ on(type: string, handler: (message: any) => void): ResponseStream<T>;
7
+ cancel(): void;
8
+ }
@@ -20,7 +20,7 @@ import { SLAMServiceClient } from '../gen/service/slam/v1/slam_pb_service';
20
20
  import { SensorsServiceClient } from '../gen/service/sensors/v1/sensors_pb_service';
21
21
  import { ServoServiceClient } from '../gen/component/servo/v1/servo_pb_service';
22
22
  import { VisionServiceClient } from '../gen/service/vision/v1/vision_pb_service';
23
- import type { Robot } from './robot';
23
+ import type { Robot, RobotStatusStream } from './robot';
24
24
  interface WebRTCOptions {
25
25
  enabled: boolean;
26
26
  host: string;
@@ -104,6 +104,6 @@ export declare class RobotClient implements Robot {
104
104
  resourceNames(): Promise<ResourceName.AsObject[]>;
105
105
  resourceRPCSubtypes(): Promise<proto.ResourceRPCSubtype[]>;
106
106
  getStatus(resourceNames: ResourceName[]): Promise<proto.Status[]>;
107
- streamStatus(resourceNames: ResourceName[], duration: Duration): Promise<proto.Status[]>;
107
+ streamStatus(resourceNames: ResourceName[], duration: Duration): RobotStatusStream;
108
108
  }
109
109
  export {};
@@ -2,6 +2,8 @@ import type { Duration } from 'google-protobuf/google/protobuf/duration_pb';
2
2
  import type { PoseInFrame, ResourceName, Transform } from '../gen/common/v1/common_pb';
3
3
  import type { StructType } from '../types';
4
4
  import type proto from '../gen/robot/v1/robot_pb';
5
+ import type { ResponseStream } from '../gen/robot/v1/robot_pb_service';
6
+ export type RobotStatusStream = ResponseStream<proto.Status[]>;
5
7
  export interface Robot {
6
8
  /**
7
9
  * Get the list of operations currently running on the robot.
@@ -113,5 +115,5 @@ export interface Robot {
113
115
  * @group Status
114
116
  * @alpha
115
117
  */
116
- streamStatus(resourceNames: ResourceName[], duration: Duration): Promise<proto.Status[]>;
118
+ streamStatus(resourceNames: ResourceName[], duration: Duration): RobotStatusStream;
117
119
  }
package/dist/robot.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export type { Robot } from './robot/robot';
1
+ export type { Robot, RobotStatusStream } from './robot/robot';
2
2
  export { RobotClient } from './robot/client';
3
3
  export { type DialConf, type DialDirectConf, type DialWebRTCConf, createRobotClient, } from './robot/dial';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viamrobotics/sdk",
3
- "version": "0.1.1-0",
3
+ "version": "0.2.0-rc.0",
4
4
  "description": "",
5
5
  "main": "./dist/main.umd.js",
6
6
  "module": "./dist/main.es.js",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "homepage": "https://github.com/viamrobotics/viam-typescript-sdk#readme",
46
46
  "dependencies": {
47
- "@viamrobotics/rpc": "^0.1.36",
47
+ "@viamrobotics/rpc": "^0.1.37",
48
48
  "exponential-backoff": "^3.1.1"
49
49
  },
50
50
  "devDependencies": {