Skip to content

Component event type check #304

Closed
Closed
@jasonlyu123

Description

@jasonlyu123

Is your feature request related to a problem? Please describe.
Current component type check can only check if it is (e: Event) => any

Describe the solution you'd like

  1. Event forward like <button on:click /> can have type check in consumer component
  2. Can type check for event dispatched by event-dispatcher

Describe alternatives you've considered
if the event dispatched by event-dispatcher can't be type-check or it is dispatched by an imported function provides a way to manually define the event's type. For example:

interface $$ComponentEventDef {
    'some-event': CustomEvent<number>
}

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