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

TimeEvent implementation does not exist in index.d.ts #182

Open
husoman opened this issue Feb 18, 2020 · 5 comments
Open

TimeEvent implementation does not exist in index.d.ts #182

husoman opened this issue Feb 18, 2020 · 5 comments

Comments

@husoman
Copy link

husoman commented Feb 18, 2020

When I try to import TimeEvent from pondjs, it gives the following error:
Module '"pondjs"' has no exported member 'TimeEvent'.

Can you fix this problem please?

@pjm17971
Copy link
Contributor

I think you want timeEvent()? If not, what are you trying to do?

@husoman
Copy link
Author

husoman commented Feb 21, 2020

Hi, I didn't understand what did you mean by timeEvent().

I need TimeEvent to draw LineChart of 'react-timeseries-charts' library, because TimeSeries of LineChart requires an events object as one of its parameters. I can import Event from "pondjs" but when I run the code, the constructor of Event class gives an error due to the following condition:

if (this.constructor.name === "Event") { throw new TypeError("Cannot construct Event instances directly"); }

However, in the index.d.ts file, in the constructor of TimeSeries it is written as
Event[] | IndexedEvent[] | TimeRangeEvent[].

In my opinion, it should be
TimeEvent[] | IndexedEvent[] | TimeRangeEvent[]

So that Event class should be TimeEvent in the index.d.ts file.

@pjm17971
Copy link
Contributor

Ok, those definitions are essentially community maintained (for pre-1.0 code, 1.0 onwards Pond is written in Typescript), but for use with the charts library, yeah, you will be on 0.9.x I think. Anyway, if you have a suggested fix can you send a PR and I'll merge it in? The PR should be against the v0.8.x branch which maintains updates to the 0.x code.

@husoman
Copy link
Author

husoman commented Feb 26, 2020

Hi, I've sent the pull request.

@husoman
Copy link
Author

husoman commented Mar 4, 2020

Hi, I've seen that my pull request has 1 failing check. I'm facing this issue even if I only do the following steps without making any change to the code.

git clone --single-branch --branch v0.8.x [email protected]:esnet/pond.git
npm install
npm test

So, I'm assuming that the failing check is not related to my change. Do you have any suggestion for me?

ps: I've updated my pull request for solving the errors after this message.

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

No branches or pull requests

2 participants