Skip to content

type of .$emit of Component Instance is Intersection of functions #14124

@FineArchs

Description

@FineArchs

Vue version

3.5.24

Link to minimal reproduction

https://play.vuejs.org/#eNp9Uk1v2zAM/SuEMMAJEDjoxy6ZY3QbcugO27D2Ng+Da9OpWlkSJMrLEOS/l5Lb1AXaHvXeI/keqb34bG0+BBQrURD2VtWEZaUBCqltIKD/FteVINxRJeAigfye4TCHdQnYS5plkW1ua73FbAE45G1N9bwSy7HRTSAyGi4aJZv7WDupHLnEcOkJF5UnxXJEubpYTjzx0zdOWgLFo6Ipz5Y8UrDMyt4aR7AHh90CWuykxg3P8HCAzpkeMk6ZxS6N0Z7SfFhPhcU+2p3hCl4GGmoVGPTkpN7OVzAY2R6VLwPIdgU69DfojrpDOZt/iklG72/leE5whap7dJwvH6+TcYd4CdicsudL9l/rBq8ZKSJsulRV/s4+xFjZn+lAseABnLmT2/zOG82XTkEr0ZjeSoXuhyXJO6nEChITuVop8+9bwsgFXDzhzS0296/gd34XsUr8dOjRDViJI0e12yJ/n0hvrr6nr3Qke9MGxep3yF/ojQrR4yj7EnTLtie65PYy7Y9vdO03O0Ltn0JFo1F5SPpK8EK/vhP92e5Zfp7q+Iq8xb8DutiTF3iWf8xPz8XhARL9E9g=

Steps to reproduce

Mouseover the type E2 of the reproduction above, and it's shown as type E2 = ((event: "textchange", value: string) => void) & ((event: "buttonclick", id: number) => void)

Generally: get the instance type of some component that has at least 2 emits and look at its .$emit

What is expected?

Type of emitter functions are joined with union(|)

What is actually happening?

They are joined with Intersection(&)

System Info

Any additional comments?

It results in misworking of vue-component-type-helpers's ComponentEmit<T>

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