Skip to content

Commit f9dfd7e

Browse files
authored
DOCS-3790: Add docs backlinks for input controller-switch and vision (#537)
1 parent 8efd519 commit f9dfd7e

File tree

8 files changed

+120
-0
lines changed

8 files changed

+120
-0
lines changed

src/components/input-controller/input-controller.ts

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export interface InputController extends Resource {
2525
* const recentEvents = await controller.getEvents();
2626
* console.log('Recent events:', recentEvents);
2727
* ```
28+
*
29+
* For more information, see [Input Controller
30+
* API](https://docs.viam.com/dev/reference/apis/components/input-controller/#getevents).
2831
*/
2932
getEvents(extra?: Struct): Promise<InputControllerEvent[]>;
3033

@@ -51,6 +54,9 @@ export interface InputController extends Resource {
5154
* // Trigger the event
5255
* await controller.triggerEvent(buttonPressEvent);
5356
* ```
57+
*
58+
* For more information, see [Input Controller
59+
* API](https://docs.viam.com/dev/reference/apis/components/input-controller/#triggerevent).
5460
*/
5561
triggerEvent(event: InputControllerEvent, extra?: Struct): Promise<void>;
5662
}

src/components/motor/motor.ts

+30
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ export interface Motor extends Resource {
2020
* await motor.setPower(0.4);
2121
* ```
2222
*
23+
* For more information, see [Motor
24+
* API](https://docs.viam.com/dev/reference/apis/components/motor/#setpower).
25+
*
2326
* @param power - A value between -1 and 1 where negative values indicate a
2427
* backwards direction and positive values a forward direction.
2528
*/
@@ -39,6 +42,9 @@ export interface Motor extends Resource {
3942
* await motor.goFor(60, 7.2);
4043
* ```
4144
*
45+
* For more information, see [Motor
46+
* API](https://docs.viam.com/dev/reference/apis/components/motor/#gofor).
47+
*
4248
* @param rpm - Speed in revolutions per minute.
4349
* @param revolutions - Number of revolutions relative to the motor's starting
4450
* position. If this value is 0, this will run the motor at the given rpm
@@ -60,6 +66,9 @@ export interface Motor extends Resource {
6066
* await motor.goTo(75, 8.3);
6167
* ```
6268
*
69+
* For more information, see [Motor
70+
* API](https://docs.viam.com/dev/reference/apis/components/motor/#goto).
71+
*
6372
* @param rpm - Speed in revolutions per minute.
6473
* @param positionRevolutions - Number of revolutions relative to the motor's
6574
* home position.
@@ -79,6 +88,9 @@ export interface Motor extends Resource {
7988
* await motor.setRPM(75);
8089
* ```
8190
*
91+
* For more information, see [Motor
92+
* API](https://docs.viam.com/dev/reference/apis/components/motor/#setrpm).
93+
*
8294
* @param rpm - Speed in revolutions per minute.
8395
*/
8496
setRPM(rpm: number, extra?: Struct): Promise<void>;
@@ -96,6 +108,9 @@ export interface Motor extends Resource {
96108
* await motor.resetZeroPosition(0.0);
97109
* ```
98110
*
111+
* For more information, see [Motor
112+
* API](https://docs.viam.com/dev/reference/apis/components/motor/#resetzeroposition).
113+
*
99114
* @param offset - Position from which to offset the current position.
100115
*/
101116
resetZeroPosition(offset: number, extra?: Struct): Promise<void>;
@@ -111,6 +126,9 @@ export interface Motor extends Resource {
111126
* // Stop the motor
112127
* await motor.stop();
113128
* ```
129+
*
130+
* For more information, see [Motor
131+
* API](https://docs.viam.com/dev/reference/apis/components/motor/#stop).
114132
*/
115133
stop(extra?: Struct): Promise<void>;
116134

@@ -127,6 +145,9 @@ export interface Motor extends Resource {
127145
* const properties = await motor.getProperties();
128146
* console.log('Properties:', properties);
129147
* ```
148+
*
149+
* For more information, see [Motor
150+
* API](https://docs.viam.com/dev/reference/apis/components/motor/#getproperties).
130151
*/
131152
getProperties(extra?: Struct): Promise<Properties>;
132153

@@ -143,6 +164,9 @@ export interface Motor extends Resource {
143164
* const position = await motor.getPosition();
144165
* console.log('Position:', position);
145166
* ```
167+
*
168+
* For more information, see [Motor
169+
* API](https://docs.viam.com/dev/reference/apis/components/motor/#getposition).
146170
*/
147171
getPosition(extra?: Struct): Promise<number>;
148172

@@ -159,6 +183,9 @@ export interface Motor extends Resource {
159183
* console.log('Powered:', isPowered);
160184
* console.log('Power percentage:', powerPct);
161185
* ```
186+
*
187+
* For more information, see [Motor
188+
* API](https://docs.viam.com/dev/reference/apis/components/motor/#ispowered).
162189
*/
163190
isPowered(extra?: Struct): Promise<readonly [boolean, number]>;
164191

@@ -174,6 +201,9 @@ export interface Motor extends Resource {
174201
* const moving = await motor.isMoving();
175202
* console.log('Moving:', moving);
176203
* ```
204+
*
205+
* For more information, see [Motor
206+
* API](https://docs.viam.com/dev/reference/apis/components/motor/#ismoving).
177207
*/
178208
isMoving(): Promise<boolean>;
179209
}

src/components/movement-sensor/movement-sensor.ts

+27
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export interface MovementSensor extends Resource {
3030
* );
3131
* const linearVelocity = await movementSensor.getLinearVelocity();
3232
* ```
33+
*
34+
* For more information, see [Movement Sensor
35+
* API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearvelocity).
3336
*/
3437
getLinearVelocity(extra?: Struct): Promise<Vector3>;
3538

@@ -45,6 +48,9 @@ export interface MovementSensor extends Resource {
4548
* );
4649
* const angularVelocity = await movementSensor.getAngularVelocity();
4750
* ```
51+
*
52+
* For more information, see [Movement Sensor
53+
* API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getangularvelocity).
4854
*/
4955
getAngularVelocity(extra?: Struct): Promise<Vector3>;
5056

@@ -61,6 +67,9 @@ export interface MovementSensor extends Resource {
6167
* );
6268
* const compassHeading = await movementSensor.getCompassHeading();
6369
* ```
70+
*
71+
* For more information, see [Movement Sensor
72+
* API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getcompassheading).
6473
*/
6574
getCompassHeading(extra?: Struct): Promise<number>;
6675

@@ -76,6 +85,9 @@ export interface MovementSensor extends Resource {
7685
* );
7786
* const orientation = await movementSensor.getOrientation();
7887
* ```
88+
*
89+
* For more information, see [Movement Sensor
90+
* API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getorientation).
7991
*/
8092
getOrientation(extra?: Struct): Promise<Orientation>;
8193

@@ -91,6 +103,9 @@ export interface MovementSensor extends Resource {
91103
* );
92104
* const position = await movementSensor.getPosition();
93105
* ```
106+
*
107+
* For more information, see [Movement Sensor
108+
* API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getposition).
94109
*/
95110
getPosition(extra?: Struct): Promise<MovementSensorPosition>;
96111

@@ -106,6 +121,9 @@ export interface MovementSensor extends Resource {
106121
* );
107122
* const properties = await movementSensor.getProperties();
108123
* ```
124+
*
125+
* For more information, see [Movement Sensor
126+
* API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getproperties).
109127
*/
110128
getProperties(extra?: Struct): Promise<MovementSensorProperties>;
111129

@@ -121,6 +139,9 @@ export interface MovementSensor extends Resource {
121139
* );
122140
* const accuracy = await movementSensor.getAccuracy();
123141
* ```
142+
*
143+
* For more information, see [Movement Sensor
144+
* API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getaccuracy).
124145
*/
125146
getAccuracy(extra?: Struct): Promise<MovementSensorAccuracy>;
126147

@@ -137,6 +158,9 @@ export interface MovementSensor extends Resource {
137158
* const linearAcceleration =
138159
* await movementSensor.getLinearAcceleration();
139160
* ```
161+
*
162+
* For more information, see [Movement Sensor
163+
* API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearacceleration).
140164
*/
141165
getLinearAcceleration(extra?: Struct): Promise<Vector3>;
142166

@@ -152,6 +176,9 @@ export interface MovementSensor extends Resource {
152176
* );
153177
* const readings = await movementSensor.getReadings();
154178
* ```
179+
*
180+
* For more information, see [Movement Sensor
181+
* API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getreadings).
155182
*/
156183
getReadings(extra?: Struct): Promise<Record<string, JsonValue>>;
157184
}

src/components/power-sensor/power-sensor.ts

+12
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export interface PowerSensor extends Sensor {
1616
* );
1717
* const [voltage, isAc] = await powerSensor.getVoltage();
1818
* ```
19+
*
20+
* For more information, see [Power Sensor
21+
* API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getvoltage).
1922
*/
2023
getVoltage(extra?: Struct): Promise<readonly [number, boolean]>;
2124
/**
@@ -31,6 +34,9 @@ export interface PowerSensor extends Sensor {
3134
* );
3235
* const [current, isAc] = await powerSensor.getCurrent();
3336
* ```
37+
*
38+
* For more information, see [Power Sensor
39+
* API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getcurrent).
3440
*/
3541
getCurrent(extra?: Struct): Promise<readonly [number, boolean]>;
3642
/**
@@ -45,6 +51,9 @@ export interface PowerSensor extends Sensor {
4551
* );
4652
* const power = await powerSensor.getPower();
4753
* ```
54+
*
55+
* For more information, see [Power Sensor
56+
* API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getpower).
4857
*/
4958
getPower(extra?: Struct): Promise<number>;
5059
/**
@@ -59,6 +68,9 @@ export interface PowerSensor extends Sensor {
5968
* );
6069
* const readings = await powerSensor.getReadings();
6170
* ```
71+
*
72+
* For more information, see [Power Sensor
73+
* API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getreadings).
6274
*/
6375
getReadings(extra?: Struct): Promise<Record<string, JsonValue>>;
6476
}

src/components/sensor/sensor.ts

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ export interface Sensor extends Resource {
1414
* // Get the readings of a sensor.
1515
* const readings = await sensor.getReadings();
1616
* ```
17+
*
18+
* For more information, see [Sensor
19+
* API](https://docs.viam.com/dev/reference/apis/components/sensor/#getreadings).
1720
*/
1821
getReadings(extra?: Struct): Promise<Record<string, JsonValue>>;
1922
}

src/components/servo/servo.ts

+12
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export interface Servo extends Resource {
1717
* // Move the servo from its origin to the desired angle of 90 degrees
1818
* await servo.move(90);
1919
* ```
20+
*
21+
* For more information, see [Servo
22+
* API](https://docs.viam.com/dev/reference/apis/components/servo/#move).
2023
*/
2124
move(angleDeg: number, extra?: Struct): Promise<void>;
2225

@@ -31,6 +34,9 @@ export interface Servo extends Resource {
3134
* // Get the current set angle of the servo
3235
* const pos = await servo.getPosition();
3336
* ```
37+
*
38+
* For more information, see [Servo
39+
* API](https://docs.viam.com/dev/reference/apis/components/servo/#getposition).
3440
*/
3541
getPosition(extra?: Struct): Promise<number>;
3642

@@ -48,6 +54,9 @@ export interface Servo extends Resource {
4854
* // Stop the servo. It is assumed that the servo stops moving immediately
4955
* await servo.stop();
5056
* ```
57+
*
58+
* For more information, see [Servo
59+
* API](https://docs.viam.com/dev/reference/apis/components/servo/#stop).
5160
*/
5261
stop(extra?: Struct): Promise<void>;
5362

@@ -62,6 +71,9 @@ export interface Servo extends Resource {
6271
* const moving = await servo.isMoving();
6372
* console.log('Moving:', moving);
6473
* ```
74+
*
75+
* For more information, see [Servo
76+
* API](https://docs.viam.com/dev/reference/apis/components/servo/#ismoving).
6577
*/
6678
isMoving(): Promise<boolean>;
6779
}

src/components/switch/switch.ts

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export interface Switch extends Resource {
1717
* // Update the switch from its current position to position 0
1818
* await mySwitch.setPosition(0);
1919
* ```
20+
*
21+
* For more information, see [Switch
22+
* API](https://docs.viam.com/dev/reference/apis/components/switch/#setposition).
2023
*/
2124
setPosition: (position: number, extra?: Struct) => Promise<void>;
2225

@@ -40,6 +43,9 @@ export interface Switch extends Resource {
4043
* // Get the current set position
4144
* const pos2 = await mySwitch.getPosition();
4245
* ```
46+
*
47+
* For more information, see [Switch
48+
* API](https://docs.viam.com/dev/reference/apis/components/switch/#getposition).
4349
*/
4450
getPosition: (extra?: Struct) => Promise<number>;
4551

@@ -55,6 +61,9 @@ export interface Switch extends Resource {
5561
* const numPositions = await mySwitch.getNumberOfPositions();
5662
* console.log('Number of positions:', numPositions);
5763
* ```
64+
*
65+
* For more information, see [Switch
66+
* API](https://docs.viam.com/dev/reference/apis/components/switch/#getnumberofpositions).
5867
*/
5968
getNumberOfPositions: (extra?: Struct) => Promise<number>;
6069
}

src/services/vision/vision.ts

+21
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export interface Vision extends Resource {
2222
* const detections = await vision.getDetectionsFromCamera('my_camera');
2323
* ```
2424
*
25+
* For more information, see [Vision
26+
* API](https://docs.viam.com/dev/reference/apis/services/vision/#getdetectionsfromcamera).
27+
*
2528
* @param cameraName - The name of the camera to use for detection.
2629
* @returns - The list of Detections.
2730
*/
@@ -49,6 +52,9 @@ export interface Vision extends Resource {
4952
* );
5053
* ```
5154
*
55+
* For more information, see [Vision
56+
* API](https://docs.viam.com/dev/reference/apis/services/vision/#getdetections).
57+
*
5258
* @param image - The image from which to get detections.
5359
* @param width - The width of the image.
5460
* @param height - The height of the image.
@@ -76,6 +82,9 @@ export interface Vision extends Resource {
7682
* );
7783
* ```
7884
*
85+
* For more information, see [Vision
86+
* API](https://docs.viam.com/dev/reference/apis/services/vision/#getclassificationsfromcamera).
87+
*
7988
* @param cameraName - The name of the camera to use for classification.
8089
* @param count - The number of Classifications requested.
8190
* @returns - The list of Classifications.
@@ -106,6 +115,9 @@ export interface Vision extends Resource {
106115
* );
107116
* ```
108117
*
118+
* For more information, see [Vision
119+
* API](https://docs.viam.com/dev/reference/apis/services/vision/#getclassifications).
120+
*
109121
* @param image - The image from which to get classifications.
110122
* @param width - The width of the image.
111123
* @param height - The height of the image.
@@ -134,6 +146,9 @@ export interface Vision extends Resource {
134146
* await vision.getObjectPointClouds('my_camera');
135147
* ```
136148
*
149+
* For more information, see [Vision
150+
* API](https://docs.viam.com/dev/reference/apis/services/vision/#getobjectpointclouds).
151+
*
137152
* @param cameraName - The name of the camera.
138153
* @returns - The list of PointCloudObjects
139154
*/
@@ -154,6 +169,9 @@ export interface Vision extends Resource {
154169
* const properties = await vision.getProperties();
155170
* ```
156171
*
172+
* For more information, see [Vision
173+
* API](https://docs.viam.com/dev/reference/apis/services/vision/#getproperties).
174+
*
157175
* @returns - The properties of the vision service
158176
*/
159177
getProperties: (extra?: Struct) => Promise<Properties>;
@@ -174,6 +192,9 @@ export interface Vision extends Resource {
174192
* });
175193
* ```
176194
*
195+
* For more information, see [Vision
196+
* API](https://docs.viam.com/dev/reference/apis/services/vision/#captureallfromcamera).
197+
*
177198
* @param cameraName - The name of the camera to use for classification,
178199
* detection, and segmentation.
179200
* @param opts - The fields desired in the response.

0 commit comments

Comments
 (0)