diff --git a/test/types/index.test-d.ts b/test/types/index.test-d.ts index 39f88e58..d5b767ce 100644 --- a/test/types/index.test-d.ts +++ b/test/types/index.test-d.ts @@ -390,7 +390,8 @@ const actionServer = new rclnodejs.ActionServer( node, 'example_interfaces/action/Fibonacci', 'fibonacci', - executeCallback + executeCallback, + goalCallback ); expectType>( actionServer @@ -403,6 +404,13 @@ expectType( ); expectType(actionServer.destroy()); +function goalCallback( + goal: rclnodejs.ActionGoal<'example_interfaces/action/Fibonacci'> +): rclnodejs.GoalResponse { + expectType(goal.order); + return rclnodejs.GoalResponse.ACCEPT; +} + function executeCallback( goalHandle: rclnodejs.ServerGoalHandle<'example_interfaces/action/Fibonacci'> ) { diff --git a/types/action_server.d.ts b/types/action_server.d.ts index 08a996c1..ff40a271 100644 --- a/types/action_server.d.ts +++ b/types/action_server.d.ts @@ -78,7 +78,7 @@ declare module 'rclnodejs' { goalHandle: ServerGoalHandle ) => Promise> | ActionResult; type GoalCallback> = ( - goalHandle: ServerGoalHandle + goal: ActionGoal ) => GoalResponse; type HandleAcceptedCallback> = ( goalHandle: ServerGoalHandle