Skip to content

Make EmitterWebhookEventName readonly #491

Open
@elibarzilay

Description

@elibarzilay

What’s missing?

Methods like .on and .removeListener use event: E | E[], it would be nice to change it to event: E | readonly E[], since it's convenient to have an as const list of event names (which currently get a type error when passing it to an E[] argument).

Why?

Makes TS code better.

Alternatives you tried

const eventNames = [ ... ] as const;
const eventNamesSillyCopy = eventNames.slice(0);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: FeatureNew feature or requesttypescriptRelevant to TypeScript users only

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions