How can I update this code to vtk.js version 28?

I want to upgrade this to vtk.js v28

const wobj = resliceCursorWidget.updateReslicePlane(
  obj.reslice,
  xyzToViewType[obj.id]
);
lineWidget.getManipulator().setOriginFrom(wobj.origin);
lineWidget.getManipulator().setNormalFrom(resliceCursorWidget.getWidgetState().getPlanes()[xyzToViewType[obj.id]].normal);

updateReslicePlane no longer returns wobj now only returns true or false
setOriginFrom and setNormalFrom no longer exist

I have already read this document and I can’t find anything related to this.

The From 25.x to 26 has a section on ResliceCursor. Was that not your question?

You should be able to get the origin and normal like this:

    const origin = resliceCursorWidget.getWidgetState().getCenter();
    const planeNormal = resliceCursorWidget.getPlaneNormalFromViewType(xyzToViewType[obj.id]);

And regarding the lineWidget, perhaps you want to do:

lineWidget.getManipulator().setWidgetOrigin(...);
lineWidget.getManipulator().setWidgetNormal(...);