Skip to content

Browser Notification type definition incorrect #14701

@chris-ls

Description

@chris-ls

TypeScript Version: 2.2.1

Looking at lib.es6.d.ts we have

interface Notification extends EventTarget {
    // ...
    readonly permission: string;
    // ...
}

and

declare var Notification: {
    prototype: Notification;
    new(title: string, options?: NotificationOptions): Notification;
    requestPermission(callback?: NotificationPermissionCallback): Promise<string>;
}

The permission string is a static property on the Notification class.
i.e. We should have:

declare var Notification: {
    prototype: Notification;
    readonly permission: string;
    new(title: string, options?: NotificationOptions): Notification;
    requestPermission(callback?: NotificationPermissionCallback): Promise<string>;
}

and it should be removed from the Notification Interface definition.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions