How to use code to collapse the selected l layer group in uxp?

Hello,
How to use code to collapse the selected l layer group in uxp?
I can’t get this function from the API of uxp, but it’s strange that I can get the function of collapsing all groups.

Collapsing a group with batchPlay can be done using:

await batchPlay(
[
   // collapse current selected group
      {
        "_obj": "collapseAllGroupsEvent",
        "_isCommand": true,
        "_options": {
          "dialogOptions": "dontDisplay"
        }
      }
],{});