Skip to content

Commit 5467e69

Browse files
mattrichardMinggang Wang
authored andcommitted
Add missing type declarations for action server/client destroy method
1 parent 17b9c66 commit 5467e69

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

test/types/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,9 @@ client.isServiceServerAvailable();
367367
// $ExpectType Promise<boolean>
368368
actionClient.waitForServer();
369369

370+
// $ExpectType void
371+
actionClient.destroy();
372+
370373
// $ExpectType Promise<ClientGoalHandle<"rclnodejs_test_msgs/action/Fibonacci">>
371374
const goalHandlePromise = actionClient.sendGoal(new Fibonacci.Goal());
372375

@@ -411,6 +414,9 @@ actionServer.registerCancelCallback();
411414
// $ExpectType void
412415
actionServer.registerExecuteCallback(() => new Fibonacci.Result());
413416

417+
// $ExpectType void
418+
actionServer.destroy();
419+
414420
function executeCallback(
415421
goalHandle: rclnodejs.ServerGoalHandle<'rclnodejs_test_msgs/action/Fibonacci'>
416422
) {

types/action_client.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,10 @@ declare module 'rclnodejs' {
132132
* @returns True if the service is available.
133133
*/
134134
waitForServer(timeout?: number): Promise<boolean>;
135+
136+
/**
137+
* Destroy the underlying action client handle.
138+
*/
139+
destroy(): void;
135140
}
136141
}

types/action_server.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,10 @@ declare module 'rclnodejs' {
173173
* @param executeCallback - Callback function.
174174
*/
175175
registerExecuteCallback(executeCallback: ExecuteCallback<T>): void;
176+
177+
/**
178+
* Destroy the action server and all goals.
179+
*/
180+
destroy(): void;
176181
}
177182
}

0 commit comments

Comments
 (0)