How to do range query using Figma plugin API?

How can I perform range query using Figma plugin API, similar to how the selection box works internally? The closest I can get is calling findOne and filter the results, but that might be too slow for large documents. Thanks for the help!