Definitelytyped: React-calendar-timeline: Deprecated interface and Type-Issues with ids

Created on 7 Jan 2019  路  4Comments  路  Source: DefinitelyTyped/DefinitelyTyped

These Type-Definitions are for an old version of react-calendar-timeline, since the callbacks have far more extensive parameters. So every callback we define (i.e. a custom itemRenderer) is missing arguments (i.e. in this case itemContext, getItemProps etc), resulting in a failing compilation despite everything being right.

Additionally, though this might have changed with the versions, ids of timelineItems and timelineProps can be both numbers and strings. Thats an easy mistake given that the examples in the readme of react-calendar-timeline only use numbers, but while I have not checked the whole code basis we have used strings in these places wihout any issues for some time now.

As I dont know if thats the case for older releases too, and I honestly cant be bothered to update the whole interface for a component - which we will stop using soon anyways - to the newest version I make this issue here.

  • [x] I tried using the @types/react-calendar-timeline package and had problems.
  • [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [x] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [x] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see Definitions by: in index.d.ts) so they can respond.

    • Authors: @radziksh @acemac

If you do not mention the authors the issue will be ignored.

Most helpful comment

The defs are not my IP. I made them for a commercial project that I'm no longer a part of. I don't have access to them anymore.

They were for the development branch of this fork which is VERY similar. There are a few additional features here that I never brought back. e.g. canvasBuffer which is documented in the readme

@kel30a @NeriedAU, can you check if the defs are okay to enter the public domain?

All 4 comments

You are correct that the ts defs are really wrong.

I made a lot of changes to the base library and had a lot of forks going so I wasn't interested in keeping these up to date as PRs on react-calendar-timeline got merged in.

I can try to get you a more up to date definition, but you may have to do some of your own work to get it up to standard to do a PR here. I've lost access to the private repo with the definitions, so I will reach out to the people there.

Hi @acemac,

thanks for the effort in providing the types for this library! May I ask where to find the types as stated in your last comment? I'm fine with them being not 100% correct.

The defs are not my IP. I made them for a commercial project that I'm no longer a part of. I don't have access to them anymore.

They were for the development branch of this fork which is VERY similar. There are a few additional features here that I never brought back. e.g. canvasBuffer which is documented in the readme

@kel30a @NeriedAU, can you check if the defs are okay to enter the public domain?

@kel30a @NeriedAU, can you check if the defs are okay to enter the public domain?

Please, these types would be very useful!

Was this page helpful?
0 / 5 - 0 ratings