Open jsbiff opened 1 year ago
So, this might be a harmless warning in the browser. I did some googling on this error, and it seems to have something to do with TypeScript, and additionally, I noticed the exificient.js demo works, but it ALSO throws that error.
I tried the demos on http://exificient.github.io/javascript/ and they seem to work fine.
BTW, yes, on the console I see the same warning.
The typescript type exports are missing for all classes, which are required to implement and XML encoding and decoding like described in the example from the main page.
// Note: the necessary grammars can be generated from XML schema using
// the project https://github.com/EXIficient/exificient-grammars
// class com.siemens.ct.exi.grammars.persistency.Grammars2JSON
// encode XML
var exiEncoder = new EXIEncoder(grammars);
exiEncoder.encodeXmlText(textXML);
var uint8ArrayLength = exiEncoder.getUint8ArrayLength();
var uint8Array = exiEncoder.getUint8Array();
// decode EXI to XML again
var exiDecoder = new EXIDecoder(grammars);
var xmlHandler = new XMLEventHandler(); // register XML handler
exiDecoder.registerEventHandler(xmlHandler);
exiDecoder.decode(arrayBuffer); // EXI input data
xmlHandler.getXML(); // get XML
The typescript type exports are missing for all classes,
That is correct, since it is meant to be used as JS library. No need for TS export, even though TS support might be useful as well.
.. which are required to implement and XML encoding and decoding like described in the example from the main page.
Note sure why TS exports are needed. As you can see the online demo at the http://exificient.github.io/javascript/ works. Having said that, there are currently no plans to work on updates...
When trying to use exificient.js, Firefox (109.0 Windows 64-bit) is logging an error:
Uncaught ReferenceError: exports is not defined