Skip to content

WebWorker NotificationOptions type issue #58674

@unadlib

Description

@unadlib

🔎 Search Terms

TS2769

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions 5.0 and 5.4.5
  • This changed in commit or PR _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

No response

💻 Code

in ServiceWorker.

self.registration.showNotification(`test`, {
      actions: [
        {
          action: 'ignoreCall',
          title: 'test',
        },
        {
          action: 'answerCall',
          title: 'test',
        },
      ],
    });

/** MDN Reference */
showNotification(title: string, options?: NotificationOptions): Promise;

🙁 Actual behavior

No overload matches this call.
Overload 1 of 2, '(title: string, options?: NotificationOptions | undefined): Promise', gave the following error.
Object literal may only specify known properties, and 'actions' does not exist in type 'NotificationOptions'.
Overload 2 of 2, '(title: string, options?: NotificationOptions | undefined): Promise', gave the following error.
Object literal may only specify known properties, and 'actions' does not exist in type 'NotificationOptions'.ts(2769)
(property) actions: {
action: string;
title: string;
}[]

🙂 Expected behavior

There should be no error message

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions