Skip to content

Can't import enums from d.ts files in custom script #50

@Oceanity

Description

@Oceanity

I was recently trying to import the enum NotificationType into a script as it's needed for type in the NotificationBase to be passed into the notificationManager.addNotification method, but because it's in a d.ts file it's not being recognized as a valid export, even when specifying the .d.ts extension on the import path

Might be good to allow the values of the enums to be an accepted type in the places they are used because manually typing in the string value of a NotificationType is currently not being seen as a valid value

It is possible to use type: "update" as NotificationType using the import, at least, but there isn't any type safety to ensure the string you're casting as NotificationType is actually an accepted value

Image

Image

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