Open tpluscode opened 1 year ago
As a general question, is this how you envision the use of RDF/JS Environment? Any code which requires an environment might take is as parameter.
The types add the ability for consumer to require certain factories to be included. For example, Environment<ScoreFactory | DatasetFactory>
would check that the environment has been constructed at least using these two factories. rdf-ext
would satisfy that type but a custom environment would be fine, and types enforce its interface
Now that RDF/JS Environment types have been published, would you agree to changing the interface of the generated code to actually take an environment instance parameter?
Typed like this in TS it would require that the
factory
is any instance of an environment which includes aDataFactory
. And incidentally, that would continue to work with rdf-ext v1 using the interface we generated in version 0.0.1 of the serializer