Skip to content

Ability to extend static Event interface #22978

Closed
@Busyrev

Description

@Busyrev

This is discussion question about extending builtin d.ts in projects.

In my particular case I would like to extend Event static intreface to add some static fields to Event(for special runtime that extends browser runtime).
I have found no way to do it. But for Array there is a way to use declaration merging because ArrayConstructor is separate named interface.
Here is example on playground

Tried it in #22946
@mhegazy thanks for answers in PR.

Question in general:

Find a way how to make any definition extendable without forking builtin d.ts files and changing them manually.

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