Really you can’t create instance of the GraphNode either as it’s abstract class. Creating new instance is not the only possible way of using classes. In my case I need to check if tree node is a scene node instance:
Manual mapping is not very good idea as you have to change the flow on every update of input data (format modification). As it’s changing every month or another such idea looks very unstable.
But my question was not about how to map the json. It’s about the point that in documentation SceneNode is an abstract class but typeof(SceneNode) returns undefined which is not correct.
The same issue exists for File and Folder “classes” in the uxp.storage namespace.
It’s entirely natural to try:
const UXPFile = require("uxp").storage.File;
if (fileOrFolder instanceof UXPFile)
// ...
But we are currently barred from doing so because
require("uxp").storage.File === undefined
The parent “class” of both File and Folder (Entry) has isFolder and isFile properties… but they seem incredibly redundant… why not just provide the class function and throw an error if someone tries to use the class constructor to instantiate something when you don’t want them to…?