It would be useful for us to consider, when thinking about data structures for information about APIs, that it would be useful to be able to back-reference from an interface to the methods in other interfaces that create them.
For example, it would be useful if an object describing the capabilities of the XRSession
interface include a reference to the XR.requestSession()
method, which is how you get access to session objects.
If I were to add this to our current data system, I’d lobby to add it to InterfaceData.json
:
"XRSession": {
"inh": "EventTarget",
"impl": [],
"factories": ["XR.requestSession()"]
},
In fact, I’d probably go one farther and also add a constructors
property. If it’s not present, a object has no constructors. Otherwise, it’s one or more methods in the interface which serve as constructors.