Never write a dts parser again.
Parser only.
haxe build-cpp.hxml
haxe build-cs.hxml
haxe build-php.hxml
haxe build-py.hxml
haxe build-js.hxml
Requires hxtsdgen, get it using haxelib install hxtsdgen
haxe build-ts.hxml
haxe build-java.hxml
haxe build-lua.hxml
haxe build-hl.hxml
var dts = new DtsFile();
dts.load(byte[] bytes); // Load
let dts = new DtsFile();
dts.load(buffer: ArrayBuffer); // Load
dts = DtsFile()
dts.load(bytes: bytearray) // Load
Use the load() method of DtsFile and pass the appropriate buffer object as given by https://api.haxe.org/haxe/io/BytesData.html