@@ -11,23 +11,41 @@ type Callback = (args: unknown) => void;
1111
1212export interface Robot {
1313 /**
14- * Get the list of sessions currently connected to the robot.
14+ * Get the list of sessions currently connected to the machine.
15+ *
16+ * @example
17+ *
18+ * ```ts
19+ * const sessions = await machine.getSessions();
20+ * ```
1521 *
1622 * @group Sessions
1723 * @alpha
1824 */
1925 getSessions ( ) : Promise < proto . Session [ ] > ;
2026
2127 /**
22- * Get the list of operations currently running on the robot.
28+ * Get the list of operations currently running on the machine.
29+ *
30+ * @example
31+ *
32+ * ```ts
33+ * const operations = await machine.getOperations();
34+ * ```
2335 *
2436 * @group Operations
2537 * @alpha
2638 */
2739 getOperations ( ) : Promise < proto . Operation [ ] > ;
2840
2941 /**
30- * Cancels the specified operation on the robot.
42+ * Cancels the specified operation on the machine.
43+ *
44+ * @example
45+ *
46+ * ```ts
47+ * await machine.cancelOperation('INSERT OPERATION ID');
48+ * ```
3149 *
3250 * @param id - ID of operation to kill.
3351 * @group Operations
@@ -36,9 +54,15 @@ export interface Robot {
3654 cancelOperation ( id : string ) : Promise < void > ;
3755
3856 /**
39- * Blocks on the specified operation on the robot . This function will only
57+ * Blocks on the specified operation on the machine . This function will only
4058 * return when the specific operation has finished or has been cancelled.
4159 *
60+ * @example
61+ *
62+ * ```ts
63+ * await machine.blockForOperation('INSERT OPERATION ID');
64+ * ```
65+ *
4266 * @param id - ID of operation to block on.
4367 * @group Operations
4468 * @alpha
@@ -49,6 +73,12 @@ export interface Robot {
4973 * Cancel all current and outstanding operations for the robot and stop all
5074 * actuators and movement.
5175 *
76+ * @example
77+ *
78+ * ```ts
79+ * await machine.stopAll();
80+ * ```
81+ *
5282 * @param extra - Any extra parameters to pass to the components' `stop`
5383 * methods, keyed on the component's resource name.
5484 * @group Operations
@@ -57,7 +87,13 @@ export interface Robot {
5787 stopAll ( extra ?: Map < string , Struct > ) : Promise < void > ;
5888
5989 /**
60- * Get the configuration of the frame system of a given robot.
90+ * Get the configuration of the frame system of a given machine.
91+ *
92+ * @example
93+ *
94+ * ```ts
95+ * const frameSystemConfig = await machine.frameSystemConfig();
96+ * ```
6197 *
6298 * @group Frame System
6399 * @alpha
@@ -106,13 +142,25 @@ export interface Robot {
106142 /**
107143 * Get the list of models provided by modules on the machine.
108144 *
145+ * @example
146+ *
147+ * ```ts
148+ * const models = await machine.getModelsFromModules();
149+ * ```
150+ *
109151 * @group Resources
110152 * @alpha
111153 */
112154 getModelsFromModules ( ) : Promise < ModuleModel [ ] > ;
113155
114156 /**
115- * Get a list of all resources on the robot.
157+ * Get a list of all resources on the machine.
158+ *
159+ * @example
160+ *
161+ * ```ts
162+ * const resourceNames = await machine.resourceNames();
163+ * ```
116164 *
117165 * @group Resources
118166 * @alpha
@@ -122,6 +170,12 @@ export interface Robot {
122170 /**
123171 * Get a list of all resource types.
124172 *
173+ * @example
174+ *
175+ * ```ts
176+ * const resourceRPCSubtypes = await machine.resourceRPCSubtypes();
177+ * ```
178+ *
125179 * @group Resources
126180 * @alpha
127181 */
@@ -146,15 +200,27 @@ export interface Robot {
146200 ) => void ;
147201
148202 /**
149- * Get app-related information about the robot.
203+ * Get app-related information about the machine.
204+ *
205+ * @example
206+ *
207+ * ```ts
208+ * const cloudMetadata = await machine.getCloudMetadata();
209+ * ```
150210 *
151211 * @group App/Cloud
152212 * @alpha
153213 */
154214 getCloudMetadata ( ) : Promise < CloudMetadata > ;
155215
156216 /**
157- * Get the current status of the robot.
217+ * Get the current status of the machine.
218+ *
219+ * @example
220+ *
221+ * ```ts
222+ * const machineStatus = await machine.getMachineStatus();
223+ * ```
158224 *
159225 * @alpha
160226 */
@@ -163,6 +229,12 @@ export interface Robot {
163229 /**
164230 * Restarts a module running on the machine with the given id or name.
165231 *
232+ * @example
233+ *
234+ * ```ts
235+ * await machine.restartModule('namespace:module:model', 'my_model_name');
236+ * ```
237+ *
166238 * @param moduleId - The id matching the module_id field of the registry
167239 * module in your part configuration
168240 * @param moduleName - The name matching the name field of the local/registry
0 commit comments