@viamrobotics/sdk 0.73.0-b.0 → 0.73.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/dist/app/app-client.d.ts +254 -130
- package/dist/app/billing-client.d.ts +15 -6
- package/dist/app/data-client.d.ts +252 -175
- package/dist/app/ml-training-client.d.ts +5 -5
- package/dist/app/provisioning-client.d.ts +4 -2
- package/dist/app/viam-client.d.ts +1 -1
- package/dist/app/viam-transport.d.ts +4 -1
- package/dist/assert.d.ts +3 -2
- package/dist/components/arm/arm.d.ts +2 -2
- package/dist/components/arm/client.d.ts +1 -1
- package/dist/components/audio-out/audio-out.d.ts +7 -6
- package/dist/components/audioin.d.ts +1 -1
- package/dist/components/audioout.d.ts +1 -1
- package/dist/components/base/base.d.ts +11 -10
- package/dist/components/board/board.d.ts +15 -8
- package/dist/components/board/client.d.ts +1 -1
- package/dist/components/camera/camera.d.ts +4 -2
- package/dist/components/camera/client.d.ts +2 -2
- package/dist/components/encoder/encoder.d.ts +5 -4
- package/dist/components/encoder.d.ts +1 -1
- package/dist/components/gantry/gantry.d.ts +10 -7
- package/dist/components/generic/generic.d.ts +4 -1
- package/dist/components/gripper/gripper.d.ts +2 -1
- package/dist/components/input-controller/input-controller.d.ts +15 -5
- package/dist/components/inputcontroller.d.ts +1 -1
- package/dist/components/motor/motor.d.ts +19 -17
- package/dist/components/movement-sensor/movement-sensor.d.ts +42 -14
- package/dist/components/pose-tracker/pose-tracker.d.ts +4 -1
- package/dist/components/power-sensor/power-sensor.d.ts +20 -6
- package/dist/components/switch/switch.d.ts +3 -2
- package/dist/debug.d.ts +15 -7
- package/dist/events.d.ts +10 -12
- package/dist/extra/stream/client.d.ts +11 -12
- package/dist/extra/stream/stream.d.ts +1 -1
- package/dist/gen/app/agent/v1/agent_connect.d.ts +1 -1
- package/dist/gen/app/build/v1/build_connect.d.ts +1 -1
- package/dist/gen/app/cloudslam/v1/cloud_slam_connect.d.ts +1 -1
- package/dist/gen/app/data/v1/data_connect.d.ts +1 -1
- package/dist/gen/app/datapipelines/v1/data_pipelines_connect.d.ts +1 -1
- package/dist/gen/app/dataset/v1/dataset_connect.d.ts +1 -1
- package/dist/gen/app/datasync/v1/data_sync_connect.d.ts +1 -1
- package/dist/gen/app/mlinference/v1/ml_inference_connect.d.ts +1 -1
- package/dist/gen/app/mltraining/v1/ml_training_connect.d.ts +1 -1
- package/dist/gen/app/packages/v1/packages_connect.d.ts +1 -1
- package/dist/gen/app/v1/app_connect.d.ts +1 -1
- package/dist/gen/app/v1/billing_connect.d.ts +1 -1
- package/dist/gen/app/v1/end_user_connect.d.ts +1 -1
- package/dist/gen/app/v1/robot_connect.d.ts +1 -1
- package/dist/gen/component/arm/v1/arm_connect.d.ts +1 -1
- package/dist/gen/component/audioin/v1/audioin_connect.d.ts +1 -1
- package/dist/gen/component/audioout/v1/audioout_connect.d.ts +1 -1
- package/dist/gen/component/base/v1/base_connect.d.ts +1 -1
- package/dist/gen/component/board/v1/board_connect.d.ts +1 -1
- package/dist/gen/component/button/v1/button_connect.d.ts +1 -1
- package/dist/gen/component/camera/v1/camera_connect.d.ts +1 -1
- package/dist/gen/component/encoder/v1/encoder_connect.d.ts +1 -1
- package/dist/gen/component/gantry/v1/gantry_connect.d.ts +1 -1
- package/dist/gen/component/generic/v1/generic_connect.d.ts +1 -1
- package/dist/gen/component/gripper/v1/gripper_connect.d.ts +1 -1
- package/dist/gen/component/inputcontroller/v1/input_controller_connect.d.ts +1 -1
- package/dist/gen/component/motor/v1/motor_connect.d.ts +1 -1
- package/dist/gen/component/movementsensor/v1/movementsensor_connect.d.ts +1 -1
- package/dist/gen/component/posetracker/v1/pose_tracker_connect.d.ts +1 -1
- package/dist/gen/component/powersensor/v1/powersensor_connect.d.ts +1 -1
- package/dist/gen/component/sensor/v1/sensor_connect.d.ts +1 -1
- package/dist/gen/component/servo/v1/servo_connect.d.ts +1 -1
- package/dist/gen/component/switch/v1/switch_connect.d.ts +1 -1
- package/dist/gen/component/testecho/v1/testecho_connect.d.ts +1 -1
- package/dist/gen/google/bytestream/bytestream_connect.d.ts +1 -1
- package/dist/gen/google/iam/v1/iam_policy_connect.d.ts +1 -1
- package/dist/gen/google/longrunning/operations_connect.d.ts +1 -1
- package/dist/gen/grpc/reflection/v1/reflection_connect.d.ts +1 -1
- package/dist/gen/opentelemetry/proto/collector/logs/v1/logs_service_connect.d.ts +1 -1
- package/dist/gen/opentelemetry/proto/collector/metrics/v1/metrics_service_connect.d.ts +1 -1
- package/dist/gen/opentelemetry/proto/collector/profiles/v1development/profiles_service_connect.d.ts +1 -1
- package/dist/gen/opentelemetry/proto/collector/trace/v1/trace_service_connect.d.ts +1 -1
- package/dist/gen/proto/rpc/examples/echo/v1/echo_connect.d.ts +1 -1
- package/dist/gen/proto/rpc/examples/echoresource/v1/echoresource_connect.d.ts +1 -1
- package/dist/gen/proto/rpc/v1/auth_connect.d.ts +1 -1
- package/dist/gen/proto/rpc/webrtc/v1/signaling_connect.d.ts +1 -1
- package/dist/gen/provisioning/v1/provisioning_connect.d.ts +1 -1
- package/dist/gen/robot/v1/robot_connect.d.ts +1 -1
- package/dist/gen/service/datamanager/v1/data_manager_connect.d.ts +1 -1
- package/dist/gen/service/discovery/v1/discovery_connect.d.ts +1 -1
- package/dist/gen/service/generic/v1/generic_connect.d.ts +1 -1
- package/dist/gen/service/mlmodel/v1/mlmodel_connect.d.ts +1 -1
- package/dist/gen/service/motion/v1/motion_connect.d.ts +1 -1
- package/dist/gen/service/navigation/v1/navigation_connect.d.ts +1 -1
- package/dist/gen/service/sensors/v1/sensors_connect.d.ts +1 -1
- package/dist/gen/service/shell/v1/shell_connect.d.ts +1 -1
- package/dist/gen/service/slam/v1/slam_connect.d.ts +1 -1
- package/dist/gen/service/video/v1/video_connect.d.ts +1 -1
- package/dist/gen/service/vision/v1/vision_connect.d.ts +1 -1
- package/dist/gen/service/worldstatestore/v1/world_state_store_connect.d.ts +1 -1
- package/dist/gen/stream/v1/stream_connect.d.ts +1 -1
- package/dist/main.d.ts +11 -10
- package/dist/main.es.js +33210 -28872
- package/dist/main.umd.js +7 -6
- package/dist/robot/client.d.ts +86 -59
- package/dist/robot/dial.d.ts +10 -7
- package/dist/robot/robot.d.ts +29 -27
- package/dist/rpc/client-channel.d.ts +1 -1
- package/dist/rpc/client-stream.d.ts +5 -4
- package/dist/rpc/connection-closed-error.d.ts +1 -1
- package/dist/rpc/dial.d.ts +41 -34
- package/dist/rpc/signaling-exchange.d.ts +1 -1
- package/dist/rpc/stream-client-stream.d.ts +1 -1
- package/dist/rpc/unary-client-stream.d.ts +1 -1
- package/dist/services/data-manager/client.d.ts +14 -5
- package/dist/services/data-manager/data-manager.d.ts +1 -1
- package/dist/services/generic/client.d.ts +1 -1
- package/dist/services/generic/generic.d.ts +2 -1
- package/dist/services/motion/motion.d.ts +78 -53
- package/dist/services/navigation/client.d.ts +1 -1
- package/dist/services/navigation/navigation.d.ts +4 -2
- package/dist/services/slam/client.d.ts +1 -1
- package/dist/services/slam/slam.d.ts +6 -4
- package/dist/services/video/video.d.ts +6 -2
- package/dist/services/vision/vision.d.ts +19 -13
- package/dist/services/world-state-store/world-state-store.d.ts +19 -6
- package/dist/types.d.ts +7 -5
- package/dist/utils.d.ts +5 -5
- package/package.json +29 -29
|
@@ -6,8 +6,8 @@ export type MovementSensorPosition = sensorApi.GetPositionResponse;
|
|
|
6
6
|
export type MovementSensorProperties = sensorApi.GetPropertiesResponse;
|
|
7
7
|
export declare const MovementSensorAccuracy: typeof sensorApi.GetAccuracyResponse, MovementSensorPosition: typeof sensorApi.GetPositionResponse, MovementSensorProperties: typeof sensorApi.GetPropertiesResponse;
|
|
8
8
|
/**
|
|
9
|
-
* Represents any sensor that reports information about the robot's direction,
|
|
10
|
-
* speed.
|
|
9
|
+
* Represents any sensor that reports information about the robot's direction,
|
|
10
|
+
* position, and/or speed.
|
|
11
11
|
*/
|
|
12
12
|
export interface MovementSensor extends Resource {
|
|
13
13
|
/**
|
|
@@ -16,7 +16,10 @@ export interface MovementSensor extends Resource {
|
|
|
16
16
|
* @example
|
|
17
17
|
*
|
|
18
18
|
* ```ts
|
|
19
|
-
* const movementSensor = new VIAM.MovementSensorClient(
|
|
19
|
+
* const movementSensor = new VIAM.MovementSensorClient(
|
|
20
|
+
* machine,
|
|
21
|
+
* 'my_movement_sensor'
|
|
22
|
+
* );
|
|
20
23
|
* const linearVelocity = await movementSensor.getLinearVelocity();
|
|
21
24
|
* ```
|
|
22
25
|
*
|
|
@@ -30,7 +33,10 @@ export interface MovementSensor extends Resource {
|
|
|
30
33
|
* @example
|
|
31
34
|
*
|
|
32
35
|
* ```ts
|
|
33
|
-
* const movementSensor = new VIAM.MovementSensorClient(
|
|
36
|
+
* const movementSensor = new VIAM.MovementSensorClient(
|
|
37
|
+
* machine,
|
|
38
|
+
* 'my_movement_sensor'
|
|
39
|
+
* );
|
|
34
40
|
* const angularVelocity = await movementSensor.getAngularVelocity();
|
|
35
41
|
* ```
|
|
36
42
|
*
|
|
@@ -39,13 +45,16 @@ export interface MovementSensor extends Resource {
|
|
|
39
45
|
*/
|
|
40
46
|
getAngularVelocity(extra?: Struct): Promise<Vector3>;
|
|
41
47
|
/**
|
|
42
|
-
* Get the compass heading, which is a number from 0-359 where 0 is North, 90
|
|
43
|
-
* South, and 270 is West.
|
|
48
|
+
* Get the compass heading, which is a number from 0-359 where 0 is North, 90
|
|
49
|
+
* is East, 180 is South, and 270 is West.
|
|
44
50
|
*
|
|
45
51
|
* @example
|
|
46
52
|
*
|
|
47
53
|
* ```ts
|
|
48
|
-
* const movementSensor = new VIAM.MovementSensorClient(
|
|
54
|
+
* const movementSensor = new VIAM.MovementSensorClient(
|
|
55
|
+
* machine,
|
|
56
|
+
* 'my_movement_sensor'
|
|
57
|
+
* );
|
|
49
58
|
* const compassHeading = await movementSensor.getCompassHeading();
|
|
50
59
|
* ```
|
|
51
60
|
*
|
|
@@ -59,7 +68,10 @@ export interface MovementSensor extends Resource {
|
|
|
59
68
|
* @example
|
|
60
69
|
*
|
|
61
70
|
* ```ts
|
|
62
|
-
* const movementSensor = new VIAM.MovementSensorClient(
|
|
71
|
+
* const movementSensor = new VIAM.MovementSensorClient(
|
|
72
|
+
* machine,
|
|
73
|
+
* 'my_movement_sensor'
|
|
74
|
+
* );
|
|
63
75
|
* const orientation = await movementSensor.getOrientation();
|
|
64
76
|
* ```
|
|
65
77
|
*
|
|
@@ -73,7 +85,10 @@ export interface MovementSensor extends Resource {
|
|
|
73
85
|
* @example
|
|
74
86
|
*
|
|
75
87
|
* ```ts
|
|
76
|
-
* const movementSensor = new VIAM.MovementSensorClient(
|
|
88
|
+
* const movementSensor = new VIAM.MovementSensorClient(
|
|
89
|
+
* machine,
|
|
90
|
+
* 'my_movement_sensor'
|
|
91
|
+
* );
|
|
77
92
|
* const position = await movementSensor.getPosition();
|
|
78
93
|
* ```
|
|
79
94
|
*
|
|
@@ -87,7 +102,10 @@ export interface MovementSensor extends Resource {
|
|
|
87
102
|
* @example
|
|
88
103
|
*
|
|
89
104
|
* ```ts
|
|
90
|
-
* const movementSensor = new VIAM.MovementSensorClient(
|
|
105
|
+
* const movementSensor = new VIAM.MovementSensorClient(
|
|
106
|
+
* machine,
|
|
107
|
+
* 'my_movement_sensor'
|
|
108
|
+
* );
|
|
91
109
|
* const properties = await movementSensor.getProperties();
|
|
92
110
|
* ```
|
|
93
111
|
*
|
|
@@ -101,7 +119,10 @@ export interface MovementSensor extends Resource {
|
|
|
101
119
|
* @example
|
|
102
120
|
*
|
|
103
121
|
* ```ts
|
|
104
|
-
* const movementSensor = new VIAM.MovementSensorClient(
|
|
122
|
+
* const movementSensor = new VIAM.MovementSensorClient(
|
|
123
|
+
* machine,
|
|
124
|
+
* 'my_movement_sensor'
|
|
125
|
+
* );
|
|
105
126
|
* const accuracy = await movementSensor.getAccuracy();
|
|
106
127
|
* ```
|
|
107
128
|
*
|
|
@@ -115,8 +136,12 @@ export interface MovementSensor extends Resource {
|
|
|
115
136
|
* @example
|
|
116
137
|
*
|
|
117
138
|
* ```ts
|
|
118
|
-
* const movementSensor = new VIAM.MovementSensorClient(
|
|
119
|
-
*
|
|
139
|
+
* const movementSensor = new VIAM.MovementSensorClient(
|
|
140
|
+
* machine,
|
|
141
|
+
* 'my_movement_sensor'
|
|
142
|
+
* );
|
|
143
|
+
* const linearAcceleration =
|
|
144
|
+
* await movementSensor.getLinearAcceleration();
|
|
120
145
|
* ```
|
|
121
146
|
*
|
|
122
147
|
* For more information, see [Movement Sensor
|
|
@@ -129,7 +154,10 @@ export interface MovementSensor extends Resource {
|
|
|
129
154
|
* @example
|
|
130
155
|
*
|
|
131
156
|
* ```ts
|
|
132
|
-
* const movementSensor = new VIAM.MovementSensorClient(
|
|
157
|
+
* const movementSensor = new VIAM.MovementSensorClient(
|
|
158
|
+
* machine,
|
|
159
|
+
* 'my_movement_sensor'
|
|
160
|
+
* );
|
|
133
161
|
* const readings = await movementSensor.getReadings();
|
|
134
162
|
* ```
|
|
135
163
|
*
|
|
@@ -8,7 +8,10 @@ export interface PoseTracker extends Resource {
|
|
|
8
8
|
* @example
|
|
9
9
|
*
|
|
10
10
|
* ```ts
|
|
11
|
-
* const generic = new VIAM.GenericComponentClient(
|
|
11
|
+
* const generic = new VIAM.GenericComponentClient(
|
|
12
|
+
* machine,
|
|
13
|
+
* 'my_generic_component'
|
|
14
|
+
* );
|
|
12
15
|
*
|
|
13
16
|
* // Get the geometries of this component
|
|
14
17
|
* const geometries = await generic.getGeometries();
|
|
@@ -3,12 +3,16 @@ import type { Sensor } from '../sensor';
|
|
|
3
3
|
/** Represents any sensor that reports voltage, current, and/or power */
|
|
4
4
|
export interface PowerSensor extends Sensor {
|
|
5
5
|
/**
|
|
6
|
-
* Get voltage in volts and a boolean indicating whether the voltage is AC
|
|
6
|
+
* Get voltage in volts and a boolean indicating whether the voltage is AC
|
|
7
|
+
* (true) or DC (false).
|
|
7
8
|
*
|
|
8
9
|
* @example
|
|
9
10
|
*
|
|
10
11
|
* ```ts
|
|
11
|
-
* const powerSensor = new VIAM.PowerSensorClient(
|
|
12
|
+
* const powerSensor = new VIAM.PowerSensorClient(
|
|
13
|
+
* machine,
|
|
14
|
+
* 'my_power_sensor'
|
|
15
|
+
* );
|
|
12
16
|
* const [voltage, isAc] = await powerSensor.getVoltage();
|
|
13
17
|
* ```
|
|
14
18
|
*
|
|
@@ -17,12 +21,16 @@ export interface PowerSensor extends Sensor {
|
|
|
17
21
|
*/
|
|
18
22
|
getVoltage(extra?: Struct): Promise<readonly [number, boolean]>;
|
|
19
23
|
/**
|
|
20
|
-
* Get Current in amps and a boolean indicating whether the voltage is AC
|
|
24
|
+
* Get Current in amps and a boolean indicating whether the voltage is AC
|
|
25
|
+
* (true) or DC (false).
|
|
21
26
|
*
|
|
22
27
|
* @example
|
|
23
28
|
*
|
|
24
29
|
* ```ts
|
|
25
|
-
* const powerSensor = new VIAM.PowerSensorClient(
|
|
30
|
+
* const powerSensor = new VIAM.PowerSensorClient(
|
|
31
|
+
* machine,
|
|
32
|
+
* 'my_power_sensor'
|
|
33
|
+
* );
|
|
26
34
|
* const [current, isAc] = await powerSensor.getCurrent();
|
|
27
35
|
* ```
|
|
28
36
|
*
|
|
@@ -36,7 +44,10 @@ export interface PowerSensor extends Sensor {
|
|
|
36
44
|
* @example
|
|
37
45
|
*
|
|
38
46
|
* ```ts
|
|
39
|
-
* const powerSensor = new VIAM.PowerSensorClient(
|
|
47
|
+
* const powerSensor = new VIAM.PowerSensorClient(
|
|
48
|
+
* machine,
|
|
49
|
+
* 'my_power_sensor'
|
|
50
|
+
* );
|
|
40
51
|
* const power = await powerSensor.getPower();
|
|
41
52
|
* ```
|
|
42
53
|
*
|
|
@@ -50,7 +61,10 @@ export interface PowerSensor extends Sensor {
|
|
|
50
61
|
* @example
|
|
51
62
|
*
|
|
52
63
|
* ```ts
|
|
53
|
-
* const powerSensor = new VIAM.PowerSensorClient(
|
|
64
|
+
* const powerSensor = new VIAM.PowerSensorClient(
|
|
65
|
+
* machine,
|
|
66
|
+
* 'my_power_sensor'
|
|
67
|
+
* );
|
|
54
68
|
* const readings = await powerSensor.getReadings();
|
|
55
69
|
* ```
|
|
56
70
|
*
|
|
@@ -47,8 +47,9 @@ export interface Switch extends Resource {
|
|
|
47
47
|
*/
|
|
48
48
|
getPosition: (extra?: Struct) => Promise<number>;
|
|
49
49
|
/**
|
|
50
|
-
* Get the total number of positions available on the switch, along with their
|
|
51
|
-
* should either be null, undefined, empty, or the same length
|
|
50
|
+
* Get the total number of positions available on the switch, along with their
|
|
51
|
+
* labels. Labels should either be null, undefined, empty, or the same length
|
|
52
|
+
* has the number of positions.
|
|
52
53
|
*
|
|
53
54
|
* @example
|
|
54
55
|
*
|
package/dist/debug.d.ts
CHANGED
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
* @example Log connection events to the browser console:
|
|
7
7
|
*
|
|
8
8
|
* ```ts
|
|
9
|
-
* import {
|
|
9
|
+
* import {
|
|
10
|
+
* setDebugLogWriter,
|
|
11
|
+
* createConsoleLogWriter,
|
|
12
|
+
* } from '@viamrobotics/sdk';
|
|
10
13
|
* setDebugLogWriter(createConsoleLogWriter());
|
|
11
14
|
* ```
|
|
12
15
|
*
|
|
@@ -16,7 +19,9 @@
|
|
|
16
19
|
* import fs from 'node:fs';
|
|
17
20
|
* import { setDebugLogWriter } from '@viamrobotics/sdk';
|
|
18
21
|
* const logFile = fs.createWriteStream('viam-debug.log', { flags: 'a' });
|
|
19
|
-
* setDebugLogWriter((entry) =>
|
|
22
|
+
* setDebugLogWriter((entry) =>
|
|
23
|
+
* logFile.write(JSON.stringify(entry) + '\n')
|
|
24
|
+
* );
|
|
20
25
|
* ```
|
|
21
26
|
*
|
|
22
27
|
* Logged events:
|
|
@@ -34,8 +39,8 @@ export interface DebugLogEntry {
|
|
|
34
39
|
/** The time at which the event occurred. */
|
|
35
40
|
timestamp: Date;
|
|
36
41
|
/**
|
|
37
|
-
* The type of event. One of: `dial_started`, `dial_success`, `dial_failed`,
|
|
38
|
-
* `grpc_response`, `client_closed`, `ice_disconnected`.
|
|
42
|
+
* The type of event. One of: `dial_started`, `dial_success`, `dial_failed`,
|
|
43
|
+
* `grpc_request`, `grpc_response`, `client_closed`, `ice_disconnected`.
|
|
39
44
|
*/
|
|
40
45
|
event: string;
|
|
41
46
|
/** The ID of the connection this event relates to, when applicable. */
|
|
@@ -45,13 +50,16 @@ export interface DebugLogEntry {
|
|
|
45
50
|
/** A function that receives structured debug log entries from the SDK. */
|
|
46
51
|
export type DebugLogWriter = (entry: DebugLogEntry) => void;
|
|
47
52
|
/**
|
|
48
|
-
* Set a writer function to receive structured debug log entries from the SDK.
|
|
49
|
-
* disable debug logging.
|
|
53
|
+
* Set a writer function to receive structured debug log entries from the SDK.
|
|
54
|
+
* Pass `undefined` to disable debug logging.
|
|
50
55
|
*
|
|
51
56
|
* @example
|
|
52
57
|
*
|
|
53
58
|
* ```ts
|
|
54
|
-
* import {
|
|
59
|
+
* import {
|
|
60
|
+
* setDebugLogWriter,
|
|
61
|
+
* createConsoleLogWriter,
|
|
62
|
+
* } from '@viamrobotics/sdk';
|
|
55
63
|
* // Enable:
|
|
56
64
|
* setDebugLogWriter(createConsoleLogWriter());
|
|
57
65
|
* // Disable:
|
package/dist/events.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
type Callback
|
|
1
|
+
type Callback = (args: unknown) => void;
|
|
2
2
|
/**
|
|
3
|
-
* MachineConnectionEvent events are emitted by a Client's EventDispatcher when
|
|
4
|
-
* occur.
|
|
3
|
+
* MachineConnectionEvent events are emitted by a Client's EventDispatcher when
|
|
4
|
+
* connection events occur.
|
|
5
5
|
*/
|
|
6
6
|
export declare enum MachineConnectionEvent {
|
|
7
7
|
CONNECTING = "connecting",
|
|
@@ -12,14 +12,12 @@ export declare enum MachineConnectionEvent {
|
|
|
12
12
|
RECONNECTING = "reconnecting",
|
|
13
13
|
RECONNECTION_FAILED = "reconnection_failed"
|
|
14
14
|
}
|
|
15
|
-
export declare class EventDispatcher
|
|
16
|
-
listeners: Partial<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
off<K extends keyof Events & string>(type: K, listener: Callback<Events[K]>): void;
|
|
23
|
-
emit<K extends keyof Events & string>(type: K, args: Events[K]): void;
|
|
15
|
+
export declare class EventDispatcher {
|
|
16
|
+
listeners: Partial<Record<string, Set<Callback>>>;
|
|
17
|
+
on(type: string, listener: Callback): void;
|
|
18
|
+
once(type: string, listener: Callback): void;
|
|
19
|
+
has(type: string, listener: Callback): boolean | undefined;
|
|
20
|
+
off(type: string, listener: Callback): void;
|
|
21
|
+
emit(type: string, args: unknown): void;
|
|
24
22
|
}
|
|
25
23
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventDispatcher } from '../../events';
|
|
2
|
-
import {
|
|
2
|
+
import { Resolution } from '../../gen/stream/v1/stream_pb';
|
|
3
3
|
import type { RobotClient } from '../../robot';
|
|
4
4
|
import type { Options } from '../../types';
|
|
5
5
|
import type { Stream } from './stream';
|
|
@@ -8,9 +8,7 @@ import type { Stream } from './stream';
|
|
|
8
8
|
*
|
|
9
9
|
* @group Clients
|
|
10
10
|
*/
|
|
11
|
-
export declare class StreamClient extends EventDispatcher
|
|
12
|
-
track: RTCTrackEvent;
|
|
13
|
-
}> implements Stream {
|
|
11
|
+
export declare class StreamClient extends EventDispatcher implements Stream {
|
|
14
12
|
private client;
|
|
15
13
|
private readonly options;
|
|
16
14
|
private streams;
|
|
@@ -18,16 +16,17 @@ export declare class StreamClient extends EventDispatcher<{
|
|
|
18
16
|
add(name: string): Promise<void>;
|
|
19
17
|
remove(name: string): Promise<void>;
|
|
20
18
|
/**
|
|
21
|
-
* Get the available livestream resolutions for a camera component. If the
|
|
22
|
-
* find any available resolutions, an empty list will be
|
|
19
|
+
* Get the available livestream resolutions for a camera component. If the
|
|
20
|
+
* stream client cannot find any available resolutions, an empty list will be
|
|
21
|
+
* returned.
|
|
23
22
|
*
|
|
24
23
|
* @param resourceName - The name of a camera component.
|
|
25
24
|
* @returns A list of available resolutions for livestreaming.
|
|
26
25
|
*/
|
|
27
26
|
getOptions(resourceName: string): Promise<Resolution[]>;
|
|
28
27
|
/**
|
|
29
|
-
* Set the livestream options for a camera component. This will change the
|
|
30
|
-
* stream to the specified width and height.
|
|
28
|
+
* Set the livestream options for a camera component. This will change the
|
|
29
|
+
* resolution of the stream to the specified width and height.
|
|
31
30
|
*
|
|
32
31
|
* @param name - The name of a camera component.
|
|
33
32
|
* @param width - The width of the resolution.
|
|
@@ -35,16 +34,16 @@ export declare class StreamClient extends EventDispatcher<{
|
|
|
35
34
|
*/
|
|
36
35
|
setOptions(name: string, width: number, height: number): Promise<void>;
|
|
37
36
|
/**
|
|
38
|
-
* Reset the livestream options for a camera component. This will reset the
|
|
39
|
-
* default component attributes.
|
|
37
|
+
* Reset the livestream options for a camera component. This will reset the
|
|
38
|
+
* resolution to the default component attributes.
|
|
40
39
|
*
|
|
41
40
|
* @param name - The name of a camera component.
|
|
42
41
|
*/
|
|
43
42
|
resetOptions(name: string): Promise<void>;
|
|
44
43
|
private STREAM_TIMEOUT;
|
|
45
44
|
/**
|
|
46
|
-
* Get a stream by name from a StreamClient. Will time out if stream is not
|
|
47
|
-
* seconds.
|
|
45
|
+
* Get a stream by name from a StreamClient. Will time out if stream is not
|
|
46
|
+
* received within 5 seconds.
|
|
48
47
|
*
|
|
49
48
|
* @param name - The name of a camera component.
|
|
50
49
|
*/
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
// @generated by protoc-gen-connect-es v1.
|
|
15
|
+
// @generated by protoc-gen-connect-es v1.5.0
|
|
16
16
|
// @generated from file google/bytestream/bytestream.proto (package google.bytestream, syntax proto3)
|
|
17
17
|
/* eslint-disable */
|
|
18
18
|
// @ts-nocheck
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
// @generated by protoc-gen-connect-es v1.
|
|
15
|
+
// @generated by protoc-gen-connect-es v1.5.0
|
|
16
16
|
// @generated from file google/iam/v1/iam_policy.proto (package google.iam.v1, syntax proto3)
|
|
17
17
|
/* eslint-disable */
|
|
18
18
|
// @ts-nocheck
|