How to add lights at runtime?

How do I add a light at runtime?
Is it like:

                     let avLight = myObject.addComponent("light");
                     avLight.lightType = 1;
                     avLight.color = [255,255,0];

Unfortunately, the number of lights is currently static for the scene
You will need to add some invisible (black) lights in the editor and pool them in a way that you turn them on when you need them
We have a plan for a fix for this (which will also enable quite a few more lights), but that’s not too soon