Does it mean if there would be a bug in ios-scriptable-types (or if bug would be upstream, but maybe we would be possible to patch it out during conversion) we wouldn’t be able to fix, since it’s fetching .json from the website to reparse the data?
Yeah, I’ve stumbled upon few things in UITableRow.onSelect:
defined as onSelect: () => void, but actually it has 1 argument - index, so in theory it should be onSelect: (index: number) => void.
In docs it also states Defaults to null, but it’s not reflected in the type. But docs are not entirely correct here - it’s actually defaults to undefined. So the definition should be something like onSelect?: (index: number) => void.
One more thing that would be nice to document is that index in onSelect starts from 1, seems a bit unexpected until you stumble upon it.
Though all 3 seems like original docs issues - except maybe type definitions missing | null, though it’s not correct either way and unsure what scriptable.json structure was and whether it had default values in machine readable form or they had to be parsed from description.
I think that onSelect: ((index: number) => void) | undefined is better because the property exists all the time. You can verify that with log(Object.keys(new UITableRow())).
That’s totally possible. I’ve corrected multiple such issues by hand.
I’ve even parsed some types from the description. I think the location data response was such a case.
Yes. I think these types are more up to date than in my repo.
If you like you can also compare the version I have in my repo. I’m quite sure there will be some differences.
If you make a PR at DefinitivelyTyped then also please add your changes to the tests
Ahh, thanks for pointing it out, I don’t use ts/js a lot and I’ve picked up somewhere idea that xxx? is just a shortcut for | undefined. The more i know.