trello icon indicating copy to clipboard operation
trello copied to clipboard

No Typescript Definitions

Open jaredallard opened this issue 5 years ago • 10 comments

It'd be awesome if there were some! :sparkles:

jaredallard avatar Aug 18 '18 06:08 jaredallard

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.

sarangjo avatar Dec 28 '18 08:12 sarangjo

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 avatar Apr 03 '19 09:04 karlvr

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.

karlvr avatar Apr 05 '19 09:04 karlvr

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

sheam avatar Apr 29 '19 19:04 sheam

@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.

karlvr avatar Apr 29 '19 20:04 karlvr

@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".

sheam avatar Apr 29 '19 20:04 sheam

@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');

karlvr avatar Apr 30 '19 09:04 karlvr

Hey, any updates here?

vaagnavanesyan avatar May 24 '20 16:05 vaagnavanesyan

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

ohadch avatar Jan 10 '21 14:01 ohadch

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

karlvr avatar Jan 10 '21 20:01 karlvr