Skip to content

Class static side 'typeof Emitter' incorrectly extends base class static side 'typeof EventEmitter' #385

Closed
@moltar

Description

@moltar

Describe the Bug

When building the project with TS, I get the following error:

node_modules/cloudevents/dist/transport/emitter.d.ts:48:22 - error TS2417: Class static side 'typeof Emitter' incorrectly extends base class static side 'typeof EventEmitter'.
  Types of property 'on' are incompatible.
    Type '(event: "newListener" | "removeListener" | "cloudevent", listener: (...args: any[]) => void) => void' is not assignable to type '(emitter: EventEmitter, event: string) => AsyncIterableIterator<any>'.
      Types of parameters 'event' and 'emitter' are incompatible.
        Type 'EventEmitter' is not assignable to type '"newListener" | "removeListener" | "cloudevent"'.
          Type 'EventEmitter' is not assignable to type '"cloudevent"'.

48 export declare class Emitter extends EventEmitter {
                       ~~~~~~~
    "cloudevents": "4.0.0",
    "@types/node": "14.14.27",
    "typescript": "4.1.3"

Steps to Reproduce

N/A

Expected Behavior

Build passing.

Additional context

    "cloudevents": "4.0.0",
    "@types/node": "14.14.27",
    "typescript": "4.1.3"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions