Scatter Mesh in trois.js

What is the best way to extend the trois.js library https://troisjs.github.io/ to be able use the scattermesh example? three.js examples

when i understand it correctly, the meshsurfacesampler.js (three.js/MeshSurfaceSampler.js at 724575ae82a282f468e15eb69a241ea0b29bba62 · mrdoob/three.js · GitHub) is missing. What would be the best way to implement it in trois?