Skip to content

Add support Notification type index signatures #4037

@Aleksandra973

Description

@Aleksandra973
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

I want to write my code such example in Ant design documentation

this.$notification[type]({
message: title,
description: description,
placement: 'bottomRight'
})

But using TypeScript in my project I need to write

this.$notification.warning({
message: title,
description: description,
placement: 'bottomRight'
})

Because class Notification hasn't index signature

What does the proposed API look like?

export declare class Notification {
[s: string]: (config: NotificationOptions) => void
...
}

instead type string we can declare enum with Notification property keys

Metadata

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