Skip to content

[chrome] Add missing definitions of functions (mainly MV3)#59188

Merged
typescript-bot merged 13 commits intoDefinitelyTyped:masterfrom
michaelts1:master
Mar 15, 2022
Merged

[chrome] Add missing definitions of functions (mainly MV3)#59188
typescript-bot merged 13 commits intoDefinitelyTyped:masterfrom
michaelts1:master

Conversation

@michaelts1
Copy link
Copy Markdown
Contributor

This pull request adds definitions for missing functions in a number of chrome.* namespaces.

I have noticed that some of the definitions for chrome are out of date and don't include the new MV3 promise-based signatures, so I decided to update the definitions myself. I have not not updated all namespaces, so there is still work to be done updating the rest of the definitions.
While updating the definitions, I have noticed a few incorrect parameter types or completely missing functions, so I went ahead and added them too.
I have tried to to keep using the same style already found in the files.

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: See bellow.

All new/modified signatures in this PR are from the official documentation (https://developer.chrome.com/docs/extensions/reference).
Note that the definitions in the linked resources incorrectly say that returning a promise "is coming soon and not yet in a stable release of Chrome". This is not true, and I have tested all function signatures using the latest stable Chrome version (v99) before adding them.
Links to individual documentation pages in case they are needed:

@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Mar 8, 2022

@michaelts1 Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners or DT maintainers

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 59188,
  "author": "michaelts1",
  "headCommitOid": "9f8ef5c5a80aa8a37f4146b39750d70a17c4d028",
  "mergeBaseOid": "7b28a955818ce689fc3a128509122cef90200dcc",
  "lastPushDate": "2022-03-08T12:02:24.000Z",
  "lastActivityDate": "2022-03-15T21:31:46.000Z",
  "mergeOfferDate": "2022-03-15T21:22:44.000Z",
  "mergeRequestDate": "2022-03-15T21:31:46.000Z",
  "mergeRequestUser": "michaelts1",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Popular",
  "pkgInfo": [
    {
      "name": "chrome",
      "kind": "edit",
      "files": [
        {
          "path": "types/chrome/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/chrome/test/index.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "matthewkimber",
        "otiai10",
        "rreverser",
        "sreimer15",
        "MatCarlson",
        "ekinsol",
        "tregagnon",
        "echoabstract",
        "spasma",
        "bdbai",
        "pokutuna",
        "JasonXian",
        "usertim",
        "idan315",
        "nicolas377",
        "idosal"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "JasonXian",
      "date": "2022-03-15T21:22:05.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 1061740745,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added Where is GH Actions? GH Actions didn't give a response to this PR Popular package This PR affects a popular package (as counted by NPM download counts). labels Mar 8, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

🔔 @matthewkimber @otiai10 @RReverser @sreimer15 @matcarlson @ekinsol @tregagnon @EchoAbstract @spasma @bdbai @pokutuna @JasonXian @userTim @idan315 @nicolas377 @idosal — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot removed the Where is GH Actions? GH Actions didn't give a response to this PR label Mar 8, 2022
@michaelts1
Copy link
Copy Markdown
Contributor Author

Should I split this PR into multiple smaller PRs?

Copy link
Copy Markdown
Contributor

@JasonXian JasonXian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are mostly additive and match docs, tests look great as well. Thanks for taking the time to do this!

@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner labels Mar 15, 2022
@michaelts1
Copy link
Copy Markdown
Contributor Author

Ready to merge

@typescript-bot typescript-bot merged commit cbbe9be into DefinitelyTyped:master Mar 15, 2022
@datgrog
Copy link
Copy Markdown

datgrog commented Mar 21, 2022

Hello, I might be wrong but chrome.runtime also need promise-based signatures ?
Screenshot 2022-03-21 at 17 34 31

@michaelts1
Copy link
Copy Markdown
Contributor Author

Yes, the definitions are wrong here. According the the docs, chrome.runtime.sendMessage does support promises now.

As I have stated above, I have not not updated all namespaces, so this is just another instance of an outdated definition. I don't have the time to update more definitions right now, but if you feel like doing so you can update them yourself and send a new PR.

@datgrog
Copy link
Copy Markdown

datgrog commented Mar 21, 2022

Not sure I can make it but thanks anyway for your reply and your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Owner Approved A listed owner of this package signed off on the pull request. Popular package This PR affects a popular package (as counted by NPM download counts). Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants