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

💥 Remove Emitter.listeners type clash #50

Merged
merged 1 commit into from
Jun 28, 2023
Merged

💥 Remove Emitter.listeners type clash #50

merged 1 commit into from
Jun 28, 2023

Commits on Jun 28, 2023

  1. 💥 Remove Emitter.listeners type clash

    At the moment, since `@ts-expect-error` [doesn't apply][1] to type
    definitions, we get a downstream compilation 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)[]'.
    
    19     listeners: Record<string, {
    ```
    
    This change removes the clash by renaming the internal variable. Note
    that, since `listeners` is `public`, this is technically breaking.
    
    [1]: microsoft/TypeScript#38628
    alecgibson committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    738170f View commit details
    Browse the repository at this point in the history