Closed SE2Dev closed 2 years ago
Yes we should include those types and release v2.0.4.
The line
export const GestureEvent = CustomEvent<GestureEventData>;
gives me the following error:
'(' expected
Value of type '{ new <T>(type: string, eventInitDict?: CustomEventInit<T> | undefined): CustomEvent<T>; prototype: CustomEvent<any>; }' is not callable. Did you mean to include 'new'?ts(2348)
I tried replacing const
with type
but could not figure out how to create a type using CustomEvent
.
The reason it needs to be const
is because we're not just creating a type alias, but a variable that references the constructor for CustomEvent
. I suspect your dependencies may be out of date, in which case I'd suggest running npm install
- but I can change it to make more sense if needed.
Updating the dependencies solved the issue - thanks! I will prepare v2.0.4
I saw that you created a release for v2.0.4. We still need to release a new version of the NPM package though.
@biodiv It turns out that there's an issue with Parcel's type declaration support for GestureEvent
in v2.1.0.
I've pushed 737fbcad0411541f533d665cc757d499d3ccdcb4 which serves as a workaround for the time being.
We'll need a v2.1.1 release for the NPM package though.
Thanks for figuring this out! I just updated the npm package
It seems that v2.0.3 is missing a few types that are pretty important. I added them at one point after the initial TypeScript migration, but it seems they got lost when the v2 branch got merged.
I added them back in the following commits:
We should probably release a version v2.0.4 that includes these changes.