Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Typescript Definitions #59

Open
jaredallard opened this issue Aug 18, 2018 · 10 comments
Open

No Typescript Definitions #59

jaredallard opened this issue Aug 18, 2018 · 10 comments

Comments

@jaredallard
Copy link

It'd be awesome if there were some! ✨

@sarangjo
Copy link

This would be great for functions as well as the different objects the Trello API offers! If I can find some free time I might take a crack at this.

@karlvr
Copy link

karlvr commented Apr 3, 2019

I have started work on this and will be continuing over the next few weeks and will then submit a PR. Initial work is here:

https://github.com/karlvr/trello/blob/types/index.d.ts

If anyone has made more progress, please let me know and I'll instead contribute to your effort!

There doesn't appear to be a canonical definition of the Trello API, unfortunately. The API documentation seems to gloss over and just simply omit thing! I guess that will make this something of a moving target.

@karlvr
Copy link

karlvr commented Apr 5, 2019

I've combined this with #74 and I've written a script to automatically generate the types, resulting in https://github.com/karlvr/trello/blob/types-query/index.d.ts

There's obviously more model types to make, but it's a start and the automatic generation script makes it pretty easy to keep up to date.

@sheam
Copy link

sheam commented Apr 29, 2019

@karlvr Do you have an example of how to use your typings?

@karlvr
Copy link

karlvr commented Apr 29, 2019

@sheam I have included them in the package.json, so if you include the library from my fork you magically get the typings. No need to install them separately.

@sheam
Copy link

sheam commented Apr 29, 2019

@karlvr so in package.json

    "trello": "https://github.com/karlvr/trello"
  },

Then in code:

const t = new Trello('key', 'token');

This gives me: "trello_1.Trello is not a constructor".

const t = new trello.Trello('', '');

This gives me: "trello.Trello is not a constructor".

@karlvr
Copy link

karlvr commented Apr 30, 2019

@sheam how did you import it? It should be:

import Trello from 'trello'

and then you should be able to use it:

const t = new Trello('key', 'token');

@vaagnavanesyan
Copy link

Hey, any updates here?

@ohadch
Copy link

ohadch commented Jan 10, 2021

Hey, anything new? I will be glad to help, just don't want to do any duplicate work

@karlvr
Copy link

karlvr commented Jan 10, 2021

@vaagnavanesyan @ohadch nothing from me. My changes were sufficient for my efforts. I'm not sure whether anyone else has got them working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants