Get List of Report Parameters

I am trying to create a window where users can schedule their own reports. Is there a script function where I can return the list of available parameters for each report?

If you’re in a client:

event.source.parent.getComponent('Report Viewer').getDynamicProps()

Inside the report itself, in a scripting datasource you could dir(data)