How to split mesh into multiple meshes completely?

I am having problem in splitting simple shapes like box. I am using typescripting for threejs. I can’t use CSG or this method because CSG is not splitting shapes actually, while polybool I can’t find typescript version.

I just want to split the blue highlight meshes in the above example