Beginner Question: Where is `publicAPI.getActiveSource` declared?

I can find declarations for most functions in the vtk.js source code. For example, publicAPI.setActiveSource is in /Proxy/Core/ProxyManager/core.js:

  publicAPI.setActiveSource = (source) => {
    if (model.activeSource !== source) {
      if (model.activeSourceSubscription) {
        model.activeSourceSubscription.unsubscribe();
        model.activeSourceSubscription = null;
      }
      model.activeSource = source;
      if (source) {
        model.activeSourceSubscription = source.onModified(publicAPI.modified);
      }
      publicAPI.modified();
      publicAPI.invokeActiveSourceChange(source);
    }
  };

But when I search for publicAPI.getActiveSource I find only usages. For example it is used in Proxy/Core/ProxyManager/properties.js in the publicAPI.getSections function.

Is it being created dynamically? Any help is appreciated.

Thanks!

Yes, it’s created dynamically here: vtk-js/index.js at master · Kitware/vtk-js · GitHub. The setGet function generates a setter and getter for a given list of properties.

1 Like