From e6525a1df4fd7b38ed64e134c0b5b042cd6b400b Mon Sep 17 00:00:00 2001 From: JessamyT Date: Mon, 14 Apr 2025 15:44:32 -0700 Subject: [PATCH 1/5] DOCS-3790: Add backlinks for input through switch --- .../input-controller/input-controller.ts | 4 ++++ src/components/motor/motor.ts | 20 +++++++++++++++++++ .../movement-sensor/movement-sensor.ts | 18 +++++++++++++++++ src/components/power-sensor/power-sensor.ts | 8 ++++++++ src/components/sensor/sensor.ts | 2 ++ src/components/servo/servo.ts | 8 ++++++++ src/components/switch/switch.ts | 6 ++++++ 7 files changed, 66 insertions(+) diff --git a/src/components/input-controller/input-controller.ts b/src/components/input-controller/input-controller.ts index 6a6378839..9dd085769 100644 --- a/src/components/input-controller/input-controller.ts +++ b/src/components/input-controller/input-controller.ts @@ -25,6 +25,8 @@ export interface InputController extends Resource { * const recentEvents = await controller.getEvents(); * console.log('Recent events:', recentEvents); * ``` + * + * For more information, see [InputController API](https://docs.viam.com/dev/reference/apis/components/inputcontroller/#getevents). */ getEvents(extra?: Struct): Promise; @@ -51,6 +53,8 @@ export interface InputController extends Resource { * // Trigger the event * await controller.triggerEvent(buttonPressEvent); * ``` + * + * For more information, see [InputController API](https://docs.viam.com/dev/reference/apis/components/inputcontroller/#triggerevent). */ triggerEvent(event: InputControllerEvent, extra?: Struct): Promise; } diff --git a/src/components/motor/motor.ts b/src/components/motor/motor.ts index d4b746987..aad440969 100644 --- a/src/components/motor/motor.ts +++ b/src/components/motor/motor.ts @@ -22,6 +22,8 @@ export interface Motor extends Resource { * * @param power - A value between -1 and 1 where negative values indicate a * backwards direction and positive values a forward direction. + * + * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#setpower). */ setPower(power: number, extra?: Struct): Promise; @@ -44,6 +46,8 @@ export interface Motor extends Resource { * position. If this value is 0, this will run the motor at the given rpm * indefinitely. If this value is nonzero, this will block until the number * of revolutions has been completed or another operation comes in. + * + * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#gofor). */ goFor(rpm: number, revolutions: number, extra?: Struct): Promise; @@ -63,6 +67,8 @@ export interface Motor extends Resource { * @param rpm - Speed in revolutions per minute. * @param positionRevolutions - Number of revolutions relative to the motor's * home position. + * + * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#goto). */ goTo(rpm: number, positionRevolutions: number, extra?: Struct): Promise; @@ -80,6 +86,8 @@ export interface Motor extends Resource { * ``` * * @param rpm - Speed in revolutions per minute. + * + * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#setrpm). */ setRPM(rpm: number, extra?: Struct): Promise; @@ -97,6 +105,8 @@ export interface Motor extends Resource { * ``` * * @param offset - Position from which to offset the current position. + * + * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#resetzeroposition). */ resetZeroPosition(offset: number, extra?: Struct): Promise; @@ -111,6 +121,8 @@ export interface Motor extends Resource { * // Stop the motor * await motor.stop(); * ``` + * + * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#stop). */ stop(extra?: Struct): Promise; @@ -127,6 +139,8 @@ export interface Motor extends Resource { * const properties = await motor.getProperties(); * console.log('Properties:', properties); * ``` + * + * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#getproperties). */ getProperties(extra?: Struct): Promise; @@ -143,6 +157,8 @@ export interface Motor extends Resource { * const position = await motor.getPosition(); * console.log('Position:', position); * ``` + * + * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#getposition). */ getPosition(extra?: Struct): Promise; @@ -159,6 +175,8 @@ export interface Motor extends Resource { * console.log('Powered:', isPowered); * console.log('Power percentage:', powerPct); * ``` + * + * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#ispowered). */ isPowered(extra?: Struct): Promise; @@ -174,6 +192,8 @@ export interface Motor extends Resource { * const moving = await motor.isMoving(); * console.log('Moving:', moving); * ``` + * + * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#ismoving). */ isMoving(): Promise; } diff --git a/src/components/movement-sensor/movement-sensor.ts b/src/components/movement-sensor/movement-sensor.ts index 2a8afdec9..051f3330c 100644 --- a/src/components/movement-sensor/movement-sensor.ts +++ b/src/components/movement-sensor/movement-sensor.ts @@ -30,6 +30,8 @@ export interface MovementSensor extends Resource { * ); * const linearVelocity = await movementSensor.getLinearVelocity(); * ``` + * + * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearvelocity). */ getLinearVelocity(extra?: Struct): Promise; @@ -45,6 +47,8 @@ export interface MovementSensor extends Resource { * ); * const angularVelocity = await movementSensor.getAngularVelocity(); * ``` + * + * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getangularvelocity). */ getAngularVelocity(extra?: Struct): Promise; @@ -61,6 +65,8 @@ export interface MovementSensor extends Resource { * ); * const compassHeading = await movementSensor.getCompassHeading(); * ``` + * + * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getcompassheading). */ getCompassHeading(extra?: Struct): Promise; @@ -76,6 +82,8 @@ export interface MovementSensor extends Resource { * ); * const orientation = await movementSensor.getOrientation(); * ``` + * + * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getorientation). */ getOrientation(extra?: Struct): Promise; @@ -91,6 +99,8 @@ export interface MovementSensor extends Resource { * ); * const position = await movementSensor.getPosition(); * ``` + * + * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getposition). */ getPosition(extra?: Struct): Promise; @@ -106,6 +116,8 @@ export interface MovementSensor extends Resource { * ); * const properties = await movementSensor.getProperties(); * ``` + * + * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getproperties). */ getProperties(extra?: Struct): Promise; @@ -121,6 +133,8 @@ export interface MovementSensor extends Resource { * ); * const accuracy = await movementSensor.getAccuracy(); * ``` + * + * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getaccuracy). */ getAccuracy(extra?: Struct): Promise; @@ -137,6 +151,8 @@ export interface MovementSensor extends Resource { * const linearAcceleration = * await movementSensor.getLinearAcceleration(); * ``` + * + * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearacceleration). */ getLinearAcceleration(extra?: Struct): Promise; @@ -152,6 +168,8 @@ export interface MovementSensor extends Resource { * ); * const readings = await movementSensor.getReadings(); * ``` + * + * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getreadings). */ getReadings(extra?: Struct): Promise>; } diff --git a/src/components/power-sensor/power-sensor.ts b/src/components/power-sensor/power-sensor.ts index 0d08c2d1b..acded0eac 100644 --- a/src/components/power-sensor/power-sensor.ts +++ b/src/components/power-sensor/power-sensor.ts @@ -16,6 +16,8 @@ export interface PowerSensor extends Sensor { * ); * const [voltage, isAc] = await powerSensor.getVoltage(); * ``` + * + * For more information, see [Power Sensor API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getvoltage). */ getVoltage(extra?: Struct): Promise; /** @@ -31,6 +33,8 @@ export interface PowerSensor extends Sensor { * ); * const [current, isAc] = await powerSensor.getCurrent(); * ``` + * + * For more information, see [Power Sensor API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getcurrent). */ getCurrent(extra?: Struct): Promise; /** @@ -45,6 +49,8 @@ export interface PowerSensor extends Sensor { * ); * const power = await powerSensor.getPower(); * ``` + * + * For more information, see [Power Sensor API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getpower). */ getPower(extra?: Struct): Promise; /** @@ -59,6 +65,8 @@ export interface PowerSensor extends Sensor { * ); * const readings = await powerSensor.getReadings(); * ``` + * + * For more information, see [Power Sensor API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getreadings). */ getReadings(extra?: Struct): Promise>; } diff --git a/src/components/sensor/sensor.ts b/src/components/sensor/sensor.ts index e3d7c3938..e17a2af89 100644 --- a/src/components/sensor/sensor.ts +++ b/src/components/sensor/sensor.ts @@ -14,6 +14,8 @@ export interface Sensor extends Resource { * // Get the readings of a sensor. * const readings = await sensor.getReadings(); * ``` + * + * For more information, see [Sensor API](https://docs.viam.com/dev/reference/apis/components/sensor/#getreadings). */ getReadings(extra?: Struct): Promise>; } diff --git a/src/components/servo/servo.ts b/src/components/servo/servo.ts index 1fbd74ccb..faf39493b 100644 --- a/src/components/servo/servo.ts +++ b/src/components/servo/servo.ts @@ -17,6 +17,8 @@ export interface Servo extends Resource { * // Move the servo from its origin to the desired angle of 90 degrees * await servo.move(90); * ``` + * + * For more information, see [Servo API](https://docs.viam.com/dev/reference/apis/components/servo/#move). */ move(angleDeg: number, extra?: Struct): Promise; @@ -31,6 +33,8 @@ export interface Servo extends Resource { * // Get the current set angle of the servo * const pos = await servo.getPosition(); * ``` + * + * For more information, see [Servo API](https://docs.viam.com/dev/reference/apis/components/servo/#getposition). */ getPosition(extra?: Struct): Promise; @@ -48,6 +52,8 @@ export interface Servo extends Resource { * // Stop the servo. It is assumed that the servo stops moving immediately * await servo.stop(); * ``` + * + * For more information, see [Servo API](https://docs.viam.com/dev/reference/apis/components/servo/#stop). */ stop(extra?: Struct): Promise; @@ -62,6 +68,8 @@ export interface Servo extends Resource { * const moving = await servo.isMoving(); * console.log('Moving:', moving); * ``` + * + * For more information, see [Servo API](https://docs.viam.com/dev/reference/apis/components/servo/#ismoving). */ isMoving(): Promise; } diff --git a/src/components/switch/switch.ts b/src/components/switch/switch.ts index 47af02c62..c372d3a5b 100644 --- a/src/components/switch/switch.ts +++ b/src/components/switch/switch.ts @@ -17,6 +17,8 @@ export interface Switch extends Resource { * // Update the switch from its current position to position 0 * await mySwitch.setPosition(0); * ``` + * + * For more information, see [Switch API](https://docs.viam.com/dev/reference/apis/components/switch/#setposition). */ setPosition: (position: number, extra?: Struct) => Promise; @@ -40,6 +42,8 @@ export interface Switch extends Resource { * // Get the current set position * const pos2 = await mySwitch.getPosition(); * ``` + * + * For more information, see [Switch API](https://docs.viam.com/dev/reference/apis/components/switch/#getposition). */ getPosition: (extra?: Struct) => Promise; @@ -55,6 +59,8 @@ export interface Switch extends Resource { * const numPositions = await mySwitch.getNumberOfPositions(); * console.log('Number of positions:', numPositions); * ``` + * + * For more information, see [Switch API](https://docs.viam.com/dev/reference/apis/components/switch/#getnumberofpositions). */ getNumberOfPositions: (extra?: Struct) => Promise; } From 5a1b86ba22ae7b7f0b432ebce27859f6460f6ad5 Mon Sep 17 00:00:00 2001 From: JessamyT Date: Mon, 14 Apr 2025 15:45:21 -0700 Subject: [PATCH 2/5] lint --- .../input-controller/input-controller.ts | 6 ++-- src/components/motor/motor.ts | 30 ++++++++++++------- .../movement-sensor/movement-sensor.ts | 27 +++++++++++------ src/components/power-sensor/power-sensor.ts | 12 +++++--- src/components/sensor/sensor.ts | 3 +- src/components/servo/servo.ts | 12 +++++--- src/components/switch/switch.ts | 9 ++++-- 7 files changed, 66 insertions(+), 33 deletions(-) diff --git a/src/components/input-controller/input-controller.ts b/src/components/input-controller/input-controller.ts index 9dd085769..b4ec73e1e 100644 --- a/src/components/input-controller/input-controller.ts +++ b/src/components/input-controller/input-controller.ts @@ -26,7 +26,8 @@ export interface InputController extends Resource { * console.log('Recent events:', recentEvents); * ``` * - * For more information, see [InputController API](https://docs.viam.com/dev/reference/apis/components/inputcontroller/#getevents). + * For more information, see [InputController + * API](https://docs.viam.com/dev/reference/apis/components/inputcontroller/#getevents). */ getEvents(extra?: Struct): Promise; @@ -54,7 +55,8 @@ export interface InputController extends Resource { * await controller.triggerEvent(buttonPressEvent); * ``` * - * For more information, see [InputController API](https://docs.viam.com/dev/reference/apis/components/inputcontroller/#triggerevent). + * For more information, see [InputController + * API](https://docs.viam.com/dev/reference/apis/components/inputcontroller/#triggerevent). */ triggerEvent(event: InputControllerEvent, extra?: Struct): Promise; } diff --git a/src/components/motor/motor.ts b/src/components/motor/motor.ts index aad440969..618744983 100644 --- a/src/components/motor/motor.ts +++ b/src/components/motor/motor.ts @@ -23,7 +23,8 @@ export interface Motor extends Resource { * @param power - A value between -1 and 1 where negative values indicate a * backwards direction and positive values a forward direction. * - * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#setpower). + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#setpower). */ setPower(power: number, extra?: Struct): Promise; @@ -47,7 +48,8 @@ export interface Motor extends Resource { * indefinitely. If this value is nonzero, this will block until the number * of revolutions has been completed or another operation comes in. * - * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#gofor). + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#gofor). */ goFor(rpm: number, revolutions: number, extra?: Struct): Promise; @@ -68,7 +70,8 @@ export interface Motor extends Resource { * @param positionRevolutions - Number of revolutions relative to the motor's * home position. * - * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#goto). + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#goto). */ goTo(rpm: number, positionRevolutions: number, extra?: Struct): Promise; @@ -87,7 +90,8 @@ export interface Motor extends Resource { * * @param rpm - Speed in revolutions per minute. * - * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#setrpm). + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#setrpm). */ setRPM(rpm: number, extra?: Struct): Promise; @@ -106,7 +110,8 @@ export interface Motor extends Resource { * * @param offset - Position from which to offset the current position. * - * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#resetzeroposition). + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#resetzeroposition). */ resetZeroPosition(offset: number, extra?: Struct): Promise; @@ -122,7 +127,8 @@ export interface Motor extends Resource { * await motor.stop(); * ``` * - * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#stop). + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#stop). */ stop(extra?: Struct): Promise; @@ -140,7 +146,8 @@ export interface Motor extends Resource { * console.log('Properties:', properties); * ``` * - * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#getproperties). + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#getproperties). */ getProperties(extra?: Struct): Promise; @@ -158,7 +165,8 @@ export interface Motor extends Resource { * console.log('Position:', position); * ``` * - * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#getposition). + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#getposition). */ getPosition(extra?: Struct): Promise; @@ -176,7 +184,8 @@ export interface Motor extends Resource { * console.log('Power percentage:', powerPct); * ``` * - * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#ispowered). + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#ispowered). */ isPowered(extra?: Struct): Promise; @@ -193,7 +202,8 @@ export interface Motor extends Resource { * console.log('Moving:', moving); * ``` * - * For more information, see [Motor API](https://docs.viam.com/dev/reference/apis/components/motor/#ismoving). + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#ismoving). */ isMoving(): Promise; } diff --git a/src/components/movement-sensor/movement-sensor.ts b/src/components/movement-sensor/movement-sensor.ts index 051f3330c..8bf610627 100644 --- a/src/components/movement-sensor/movement-sensor.ts +++ b/src/components/movement-sensor/movement-sensor.ts @@ -31,7 +31,8 @@ export interface MovementSensor extends Resource { * const linearVelocity = await movementSensor.getLinearVelocity(); * ``` * - * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearvelocity). + * For more information, see [Movement Sensor + * API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearvelocity). */ getLinearVelocity(extra?: Struct): Promise; @@ -48,7 +49,8 @@ export interface MovementSensor extends Resource { * const angularVelocity = await movementSensor.getAngularVelocity(); * ``` * - * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getangularvelocity). + * For more information, see [Movement Sensor + * API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getangularvelocity). */ getAngularVelocity(extra?: Struct): Promise; @@ -66,7 +68,8 @@ export interface MovementSensor extends Resource { * const compassHeading = await movementSensor.getCompassHeading(); * ``` * - * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getcompassheading). + * For more information, see [Movement Sensor + * API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getcompassheading). */ getCompassHeading(extra?: Struct): Promise; @@ -83,7 +86,8 @@ export interface MovementSensor extends Resource { * const orientation = await movementSensor.getOrientation(); * ``` * - * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getorientation). + * For more information, see [Movement Sensor + * API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getorientation). */ getOrientation(extra?: Struct): Promise; @@ -100,7 +104,8 @@ export interface MovementSensor extends Resource { * const position = await movementSensor.getPosition(); * ``` * - * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getposition). + * For more information, see [Movement Sensor + * API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getposition). */ getPosition(extra?: Struct): Promise; @@ -117,7 +122,8 @@ export interface MovementSensor extends Resource { * const properties = await movementSensor.getProperties(); * ``` * - * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getproperties). + * For more information, see [Movement Sensor + * API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getproperties). */ getProperties(extra?: Struct): Promise; @@ -134,7 +140,8 @@ export interface MovementSensor extends Resource { * const accuracy = await movementSensor.getAccuracy(); * ``` * - * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getaccuracy). + * For more information, see [Movement Sensor + * API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getaccuracy). */ getAccuracy(extra?: Struct): Promise; @@ -152,7 +159,8 @@ export interface MovementSensor extends Resource { * await movementSensor.getLinearAcceleration(); * ``` * - * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearacceleration). + * For more information, see [Movement Sensor + * API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearacceleration). */ getLinearAcceleration(extra?: Struct): Promise; @@ -169,7 +177,8 @@ export interface MovementSensor extends Resource { * const readings = await movementSensor.getReadings(); * ``` * - * For more information, see [Movement Sensor API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getreadings). + * For more information, see [Movement Sensor + * API](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getreadings). */ getReadings(extra?: Struct): Promise>; } diff --git a/src/components/power-sensor/power-sensor.ts b/src/components/power-sensor/power-sensor.ts index acded0eac..353a2fbec 100644 --- a/src/components/power-sensor/power-sensor.ts +++ b/src/components/power-sensor/power-sensor.ts @@ -17,7 +17,8 @@ export interface PowerSensor extends Sensor { * const [voltage, isAc] = await powerSensor.getVoltage(); * ``` * - * For more information, see [Power Sensor API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getvoltage). + * For more information, see [Power Sensor + * API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getvoltage). */ getVoltage(extra?: Struct): Promise; /** @@ -34,7 +35,8 @@ export interface PowerSensor extends Sensor { * const [current, isAc] = await powerSensor.getCurrent(); * ``` * - * For more information, see [Power Sensor API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getcurrent). + * For more information, see [Power Sensor + * API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getcurrent). */ getCurrent(extra?: Struct): Promise; /** @@ -50,7 +52,8 @@ export interface PowerSensor extends Sensor { * const power = await powerSensor.getPower(); * ``` * - * For more information, see [Power Sensor API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getpower). + * For more information, see [Power Sensor + * API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getpower). */ getPower(extra?: Struct): Promise; /** @@ -66,7 +69,8 @@ export interface PowerSensor extends Sensor { * const readings = await powerSensor.getReadings(); * ``` * - * For more information, see [Power Sensor API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getreadings). + * For more information, see [Power Sensor + * API](https://docs.viam.com/dev/reference/apis/components/power-sensor/#getreadings). */ getReadings(extra?: Struct): Promise>; } diff --git a/src/components/sensor/sensor.ts b/src/components/sensor/sensor.ts index e17a2af89..392e9789e 100644 --- a/src/components/sensor/sensor.ts +++ b/src/components/sensor/sensor.ts @@ -15,7 +15,8 @@ export interface Sensor extends Resource { * const readings = await sensor.getReadings(); * ``` * - * For more information, see [Sensor API](https://docs.viam.com/dev/reference/apis/components/sensor/#getreadings). + * For more information, see [Sensor + * API](https://docs.viam.com/dev/reference/apis/components/sensor/#getreadings). */ getReadings(extra?: Struct): Promise>; } diff --git a/src/components/servo/servo.ts b/src/components/servo/servo.ts index faf39493b..117fe08ed 100644 --- a/src/components/servo/servo.ts +++ b/src/components/servo/servo.ts @@ -18,7 +18,8 @@ export interface Servo extends Resource { * await servo.move(90); * ``` * - * For more information, see [Servo API](https://docs.viam.com/dev/reference/apis/components/servo/#move). + * For more information, see [Servo + * API](https://docs.viam.com/dev/reference/apis/components/servo/#move). */ move(angleDeg: number, extra?: Struct): Promise; @@ -34,7 +35,8 @@ export interface Servo extends Resource { * const pos = await servo.getPosition(); * ``` * - * For more information, see [Servo API](https://docs.viam.com/dev/reference/apis/components/servo/#getposition). + * For more information, see [Servo + * API](https://docs.viam.com/dev/reference/apis/components/servo/#getposition). */ getPosition(extra?: Struct): Promise; @@ -53,7 +55,8 @@ export interface Servo extends Resource { * await servo.stop(); * ``` * - * For more information, see [Servo API](https://docs.viam.com/dev/reference/apis/components/servo/#stop). + * For more information, see [Servo + * API](https://docs.viam.com/dev/reference/apis/components/servo/#stop). */ stop(extra?: Struct): Promise; @@ -69,7 +72,8 @@ export interface Servo extends Resource { * console.log('Moving:', moving); * ``` * - * For more information, see [Servo API](https://docs.viam.com/dev/reference/apis/components/servo/#ismoving). + * For more information, see [Servo + * API](https://docs.viam.com/dev/reference/apis/components/servo/#ismoving). */ isMoving(): Promise; } diff --git a/src/components/switch/switch.ts b/src/components/switch/switch.ts index c372d3a5b..79cd0e0a9 100644 --- a/src/components/switch/switch.ts +++ b/src/components/switch/switch.ts @@ -18,7 +18,8 @@ export interface Switch extends Resource { * await mySwitch.setPosition(0); * ``` * - * For more information, see [Switch API](https://docs.viam.com/dev/reference/apis/components/switch/#setposition). + * For more information, see [Switch + * API](https://docs.viam.com/dev/reference/apis/components/switch/#setposition). */ setPosition: (position: number, extra?: Struct) => Promise; @@ -43,7 +44,8 @@ export interface Switch extends Resource { * const pos2 = await mySwitch.getPosition(); * ``` * - * For more information, see [Switch API](https://docs.viam.com/dev/reference/apis/components/switch/#getposition). + * For more information, see [Switch + * API](https://docs.viam.com/dev/reference/apis/components/switch/#getposition). */ getPosition: (extra?: Struct) => Promise; @@ -60,7 +62,8 @@ export interface Switch extends Resource { * console.log('Number of positions:', numPositions); * ``` * - * For more information, see [Switch API](https://docs.viam.com/dev/reference/apis/components/switch/#getnumberofpositions). + * For more information, see [Switch + * API](https://docs.viam.com/dev/reference/apis/components/switch/#getnumberofpositions). */ getNumberOfPositions: (extra?: Struct) => Promise; } From 3e45f6cc5ae451c30001d49afd19fd0cf101df48 Mon Sep 17 00:00:00 2001 From: JessamyT Date: Mon, 14 Apr 2025 15:54:57 -0700 Subject: [PATCH 3/5] Fix order --- src/components/motor/motor.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/components/motor/motor.ts b/src/components/motor/motor.ts index 618744983..05f7908e8 100644 --- a/src/components/motor/motor.ts +++ b/src/components/motor/motor.ts @@ -20,11 +20,11 @@ export interface Motor extends Resource { * await motor.setPower(0.4); * ``` * + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#setpower). + * * @param power - A value between -1 and 1 where negative values indicate a * backwards direction and positive values a forward direction. - * - * For more information, see [Motor - * API](https://docs.viam.com/dev/reference/apis/components/motor/#setpower). */ setPower(power: number, extra?: Struct): Promise; @@ -42,14 +42,14 @@ export interface Motor extends Resource { * await motor.goFor(60, 7.2); * ``` * + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#gofor). + * * @param rpm - Speed in revolutions per minute. * @param revolutions - Number of revolutions relative to the motor's starting * position. If this value is 0, this will run the motor at the given rpm * indefinitely. If this value is nonzero, this will block until the number * of revolutions has been completed or another operation comes in. - * - * For more information, see [Motor - * API](https://docs.viam.com/dev/reference/apis/components/motor/#gofor). */ goFor(rpm: number, revolutions: number, extra?: Struct): Promise; @@ -66,12 +66,12 @@ export interface Motor extends Resource { * await motor.goTo(75, 8.3); * ``` * + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#goto). + * * @param rpm - Speed in revolutions per minute. * @param positionRevolutions - Number of revolutions relative to the motor's * home position. - * - * For more information, see [Motor - * API](https://docs.viam.com/dev/reference/apis/components/motor/#goto). */ goTo(rpm: number, positionRevolutions: number, extra?: Struct): Promise; @@ -88,10 +88,10 @@ export interface Motor extends Resource { * await motor.setRPM(75); * ``` * - * @param rpm - Speed in revolutions per minute. + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#setrpm). * - * For more information, see [Motor - * API](https://docs.viam.com/dev/reference/apis/components/motor/#setrpm). + * @param rpm - Speed in revolutions per minute. */ setRPM(rpm: number, extra?: Struct): Promise; @@ -108,10 +108,10 @@ export interface Motor extends Resource { * await motor.resetZeroPosition(0.0); * ``` * - * @param offset - Position from which to offset the current position. + * For more information, see [Motor + * API](https://docs.viam.com/dev/reference/apis/components/motor/#resetzeroposition). * - * For more information, see [Motor - * API](https://docs.viam.com/dev/reference/apis/components/motor/#resetzeroposition). + * @param offset - Position from which to offset the current position. */ resetZeroPosition(offset: number, extra?: Struct): Promise; From b67942ab0b172882d64f38f40c28a72a7e3df664 Mon Sep 17 00:00:00 2001 From: JessamyT Date: Mon, 14 Apr 2025 16:11:40 -0700 Subject: [PATCH 4/5] Add backlinks from vision --- src/services/vision/vision.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/services/vision/vision.ts b/src/services/vision/vision.ts index 3ca6da348..815c658fd 100644 --- a/src/services/vision/vision.ts +++ b/src/services/vision/vision.ts @@ -22,6 +22,9 @@ export interface Vision extends Resource { * const detections = await vision.getDetectionsFromCamera('my_camera'); * ``` * + * For more information, see [Vision + * API](https://docs.viam.com/dev/reference/apis/services/vision/#getdetectionsfromcamera). + * * @param cameraName - The name of the camera to use for detection. * @returns - The list of Detections. */ @@ -49,6 +52,9 @@ export interface Vision extends Resource { * ); * ``` * + * For more information, see [Vision + * API](https://docs.viam.com/dev/reference/apis/services/vision/#getdetections). + * * @param image - The image from which to get detections. * @param width - The width of the image. * @param height - The height of the image. @@ -76,6 +82,9 @@ export interface Vision extends Resource { * ); * ``` * + * For more information, see [Vision + * API](https://docs.viam.com/dev/reference/apis/services/vision/#getclassificationsfromcamera). + * * @param cameraName - The name of the camera to use for classification. * @param count - The number of Classifications requested. * @returns - The list of Classifications. @@ -106,6 +115,9 @@ export interface Vision extends Resource { * ); * ``` * + * For more information, see [Vision + * API](https://docs.viam.com/dev/reference/apis/services/vision/#getclassifications). + * * @param image - The image from which to get classifications. * @param width - The width of the image. * @param height - The height of the image. @@ -134,6 +146,9 @@ export interface Vision extends Resource { * await vision.getObjectPointClouds('my_camera'); * ``` * + * For more information, see [Vision + * API](https://docs.viam.com/dev/reference/apis/services/vision/#getobjectpointclouds). + * * @param cameraName - The name of the camera. * @returns - The list of PointCloudObjects */ @@ -154,6 +169,9 @@ export interface Vision extends Resource { * const properties = await vision.getProperties(); * ``` * + * For more information, see [Vision + * API](https://docs.viam.com/dev/reference/apis/services/vision/#getproperties). + * * @returns - The properties of the vision service */ getProperties: (extra?: Struct) => Promise; @@ -174,6 +192,9 @@ export interface Vision extends Resource { * }); * ``` * + * For more information, see [Vision + * API](https://docs.viam.com/dev/reference/apis/services/vision/#captureallfromcamera). + * * @param cameraName - The name of the camera to use for classification, * detection, and segmentation. * @param opts - The fields desired in the response. From b8a445dab59d5f46329d807504cf29530b7fc426 Mon Sep 17 00:00:00 2001 From: JessamyT Date: Mon, 14 Apr 2025 16:24:27 -0700 Subject: [PATCH 5/5] Fix links --- src/components/input-controller/input-controller.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/input-controller/input-controller.ts b/src/components/input-controller/input-controller.ts index b4ec73e1e..92088a7aa 100644 --- a/src/components/input-controller/input-controller.ts +++ b/src/components/input-controller/input-controller.ts @@ -26,8 +26,8 @@ export interface InputController extends Resource { * console.log('Recent events:', recentEvents); * ``` * - * For more information, see [InputController - * API](https://docs.viam.com/dev/reference/apis/components/inputcontroller/#getevents). + * For more information, see [Input Controller + * API](https://docs.viam.com/dev/reference/apis/components/input-controller/#getevents). */ getEvents(extra?: Struct): Promise; @@ -55,8 +55,8 @@ export interface InputController extends Resource { * await controller.triggerEvent(buttonPressEvent); * ``` * - * For more information, see [InputController - * API](https://docs.viam.com/dev/reference/apis/components/inputcontroller/#triggerevent). + * For more information, see [Input Controller + * API](https://docs.viam.com/dev/reference/apis/components/input-controller/#triggerevent). */ triggerEvent(event: InputControllerEvent, extra?: Struct): Promise; }