Closed TheOnlyTails closed 1 year ago
@TheOnlyTails makes sense to add this in my opinion :) Thank you!
I am not entirely sure about the existence of this hasContent
property to be honest, since if a scan happens there will always be some sort of content. It was always there and I don't think that it is really required anyways.
I am working on a new version that will drop this thing entirely and just don't call any callbacks as long no content can be read.
I will still add this to the current version since I am not sure how long it will take me to finish the other stuff :)
@thegnuu i messed up, i forgot types require =
before the brackets, so this will completely break the definitions.
No worries, I will test it anyway and fix it ☺️ Currently working on some other stuff anyways that's why I just merged it without testing ☺️
This should greatly improve the type inference when checking the result with
result.hasContent
. Right now, TypeScript has no idea that ifhasContent
is true, that implies something about the type ofresult.content
, but this PR gives it that context.(Do let me know if this is made impossible by iOS/Android platform limitations, I'm just making this since I ran into this in my project.)