Skip to content

Commit 82cfdeb

Browse files
wayneparrottminggangw
authored andcommitted
fix: ActionServer CancelCallback type definition
The internal actionserver code treats the cancelcallback as an awaitable object. Yet the CancelCallback type definition specifies only a return type of CancelResponse. The proper CancelCallback function definition should return a union of CallbackResponse or a Promise that resolves to a CallbackResponse.
1 parent f699e79 commit 82cfdeb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

types/action_server.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ declare module 'rclnodejs' {
8484
type HandleAcceptedCallback<T extends TypeClass<ActionTypeClassName>> = (
8585
goalHandle: ServerGoalHandle<T>
8686
) => void;
87-
type CancelCallback = () => CancelResponse;
87+
type CancelCallback = () => Promise<CancelResponse> | CancelResponse;
8888

8989
interface ActionServerOptions extends Options<ActionQoS> {
9090
/**

0 commit comments

Comments
 (0)