How to obtain a list of JS files from enabled modules, or expose such list from a theme as library? I'm in the process of extending jQuery Multi module. Libraries API libraries was built in, I have already added support for JavaScript libraries provided by modules, so with minimal cooperation on the side of modules' authors I have that part covered. Now time to add themes to the list - and I'm stuck.

I found no way to make a theme use hook_library() and by the API docs it's a module hook, so I can't use method I used for modules.

I can use list_themes() to list themes, but how to see a JS files?
list_themes() returns an array of objects:

The keys are the themes' machine names and the values are objects having the following properties:

scripts: An associative array of JavaScripts, using the filename as key and the complete filepath as value. Not set if no scripts are defined in the .info file.