how can i call js function from drupal 10 ajax?

having code

 public function ajaxCallback(array &$form, FormStateInterface $form_state)
  {
      $response = new AjaxResponse();
      $response->addCommand(new InvokeCommand('document', 'sendMessage', ['test']));
      return $response;
  }

js code

(function ($, Drupal, drupalSettings) {

  $(document).ready(function(){

    $(document).bind('sendMessage', function(msg) {
      alert('MY_EVENT');
    });

  });

})(jQuery, Drupal, drupalSettings);

whan i call ajax function having error
Ajax: TypeError: $element[response.method] is not a function

why it does not working?
how can i call js function from drupal ajax?