Use WP_Theme::scandir function to scan a plugin directory. Is there a way?

You can use PHP5 RecursiveDirectoryIterator with RecursiveIteratorIterator

$directory = '/project_root/wp-content/plugins/your-plugin'; //Your plugin dir

$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory));

    while ($it->valid()) { //Check the file exist
    if (!$it->isDot()) { //if not parent ".." or current "."
            if (strpos($it->key(), '.php') !== false
               || strpos($it->key(), '.css') !== false
               || strpos($it->key(), '.js') !== false
            ) {
                //Do your stuff with matched extension files
                echo $it->key() . '<br>'; //output: main.js, index.php, style.css etc....
            }
        }
    }