Skip to content

type error of defineComponent's second generic param related to EmitsOptions #12673

Open
@LoTwT

Description

Vue version

latest ( 3.5.13 )

Link to minimal reproduction

https://play.vuejs.org/#eNp9UsFq3DAQ/ZWpLnbAsUnT0+I1tCXQ9tCWttBD1YOxZzdKbElII8dg/O8ZyewmhJCTPfPeG72n0SI+WltOAcVO1L5zyhJ4pGAbqdVojSNYwOEBVjg4M0LG1ExqqTujPcHoj7CPeJ59wWEw8Ne4oX+XXUhdV9s4HsQF4WiHlpArgPr2qlmWJF7XuuIqdZW2gWC6HE2Pw14KxqWAisG6eqYXhSDPxx/UsbzzRrPzJeql6Mxo1YDuhyXF9qTYQUIi1rK7h2+pRy5gcep3t9jdv9K/83PsSfHToUc3oRRnjFp3RNrgm9/fceb/M8juw8DsN8Bf6M0QoseN9inonm0/4yW3X9P9K338429mQu1PoaLRyFwTXwreyec3oj/ZvS4/JJ3UK99i1JTkZ77A86p7PCidphmNmk5rT2dI8bT4yODNv6DXy1rwkGB7XtUO/k3tEPjryXGK/7A2eW6dsb6AjuYL2DebSS5KHBXl2abMCsiu3l/HV/QqyNgLSBt9ibPytGkcv2CnIU9H1L2aGpbUVfzh6EyRGueUmAO0YdjyiPURLLgDZg==

Steps to reproduce

  • open the reproduction link
  • check the Comp.tsx

What is expected?

pass the type check of EmitOptions with the named tuple syntax

What is actually happening?

  • type error when using named tuple syntax
  • ctx.emit has corresponding types and type safe
image

System Info

No response

Any additional comments?

refer to Type-only props/emit declarations

The named tuple syntax can work, but the function syntax can't. Should they all be supported?

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions