Open fullofcaffeine opened 5 years ago
I managed to find a workaround for now, which at least makes the TS compiler happy:
Generated declaration file: https://github.com/haxe-boilerplate/pwa-ts-haxe-boilerplate-take-2/blob/workaround/src/ts/server/hx.d.ts
I would love to avoid defining those dummy classes just for the sake of a correct declaration file, though.
Hmm how are those types defined? in hxnodejs?
Yes
Oh! Right we dont support yet @:jsRequire
classes...
https://github.com/HaxeFoundation/hxnodejs/blob/master/src/js/node/http/IncomingMessage.hx
Note that you appeased typing gods, but it's as good as having replaced it by Dynamic
.
Note that you appeased typing gods, but it's as good as having replaced it by Dynamic.
Yes, I'm aware. In any event, I think the best approach now is to create some kind of adapter class that exposes simpler / more specific types to TS instead of trying to expose these directly. At least until hxtsdgen
handles more complex cases like this.
Hey Philippe,
Thank you for the latest additions to this lib!
I've tried it out but I'm having some issues. For some reason it's not generating the declaration for the param types here: https://github.com/haxe-boilerplate/pwa-ts-haxe-boilerplate-take-2/blob/master/src/ts/server/hx.d.ts#L28.
The correspondent Haxe source is: https://github.com/haxe-boilerplate/pwa-ts-haxe-boilerplate-take-2/blob/master/src/hx/server/TinkAPI.hx#L44.
Do you know why? The type is being exposed.
Thanks in advance!
Do you know why?