`scriptable.json` is gone?

Hi! Reading old thread (ref), it seems there use to be https://docs.scriptable.app/scriptable.json Tern file that provided documentation in a machine readable format, is it gone now? Reading GitHub - schl3ck/ios-scriptable-types · GitHub , it seems generation is now parsing HTML pages to later generate type definitions from.

No particular use for it, just curiousity, thought that maybe it had some additional metadata that can be useful.

That’s interesting. I haven’t run the converter in a while since the last Scriptable feature update was 2 years ago. So I didn’t notice.

The HTML converter was first and then Simon added the scriptable.json. I don’t know if the HTML method still works.

I don’t know anymore how exactly the scriptable.json looked, but I think that the converter has used all available information.

When there is another feature update then I’ll ask Simon if he can provide it again. Until then I don’t think that we’ll need it.

1 Like

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?

We’re still able to fix it, because I can edit the result manually :wink:
Have you found one?

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.

What woud be the workflow to address those issues? Can I submit a PR to DefinetlyTyped and edit DefinitelyTyped/types/scriptable-ios/index.d.ts at master · DefinitelyTyped/DefinitelyTyped directly?

I’ve just found a copy of the scriptable.json in my local clone of GitHub - schl3ck/ios-scriptable-types · GitHub. I’ve committed it so you can check it out if you like.


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 :wink:

1 Like

It’s great that we have it preserved now.

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.

Submitted a PR - [scriptable-ios] fix `UITableRow.onSelect` type: add `index` param, m… by Andrej730 · Pull Request #74806 · DefinitelyTyped/DefinitelyTyped · GitHub