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

Type error in emitter.d.ts #3930

Closed
pablopla opened this issue Dec 10, 2023 · 3 comments · Fixed by #3948
Closed

Type error in emitter.d.ts #3930

pablopla opened this issue Dec 10, 2023 · 3 comments · Fixed by #3948
Milestone

Comments

@pablopla
Copy link

pablopla commented Dec 10, 2023

I'm getting an error when trying to build Quill2.0-beta.0 with an Angular 17 project using Webpack or esbuild:

Actual behavior:

Error: node_modules/quill/core/emitter.d.ts:23:5 - error TS2416: Property 'listeners' in type 'Emitter' is not assignable to the same property in base type 'EventEmitter<string, any>'.
  Type 'Record<string, { node: Node; handler: Function; }[]>' is not assignable to type '<T extends string>(event: T) => ((...args: any[]) => void)[]'.
    Type 'Record<string, { node: Node; handler: Function; }[]>' provides no match for the signature '<T extends string>(event: T): ((...args: any[]) => void)[]'.

23     listeners: Record<string, {

Platforms:
Webpack or esbuild

Version:
v2.0.0-beta.0

@ThanosAlmighty
Copy link

I am also affected by this issue. I figured it might be an issue with versioning, but I was able to confirm that I was on the same typescript and angular.

@jitterbox
Copy link

I forked and briefly looked at a fix for this... the choice of the listeners property name is intentional, but I can't speak to why... it doesn't seem to be used outside of your Emitter class. Could the resolution be as simple as refactoring listeners to domListeners or similar @jhchen?

image

@luin
Copy link
Member

luin commented Jan 10, 2024

@jitterbox Good catch! It makes sense to change it to a different property name.

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

Successfully merging a pull request may close this issue.

4 participants