This repository has been archived by the owner on Jul 12, 2019. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mostly fixes https://github.com/zapier/zapier-platform-cli/issues/15. This adds a typing file to the root of the core repo. Going forward, we'll need to update the file whenever the API or options changes, but that should be pretty low key. The great news is that this doesn't get in the way of normal operations and even provides types to js users using VS Code (which picks these up for regular javascript).
This only covers the items and interfaces exported by core. Ideally we'll be able to turn the json schema into types at well, but there are some speedbumps there. Instead of holding back indefinitely, let's get these out and I can circle back for the rest at some point.
To test, run the following commands:
mkdir ts-test
npm i typescript zapier-platform-core
tsc --init
tsc
The big thing is that the input and output types below match what's in the code. I went pretty carefully through the docs (and if they weren't clear, code), so it should all be there! I'm also using these for a ts zapier app (that'll be pushed soon), so know soon if there's anything I missed.