GoogleChrome / chrome-types

Code to parse Chrome's internal extension type definitions—published on NPM as chrome-types
https://www.npmjs.com/package/chrome-types
Apache License 2.0
189 stars 30 forks source link

Difference to `@types/chrome` #47

Closed AngeloCore closed 1 year ago

AngeloCore commented 1 year ago

What is the difference between chrome-types and @types/chrome? Why are there 2 chrome typings packages?

mansurov1024 commented 1 year ago

The difference for me - the last one works. After adding chrome-types still get

error TS2304: Cannot find name 'chrome'.

With the @types/chrome this error disappears.

Also, if you have errors like

error TS2304: Cannot find name 'Blob'.

you should add

{
  "compilerOptions": {
    "lib": ["dom"]
  }
}

to your tsconfig.json.

oliverdunk commented 1 year ago

@types/chrome is a community project which lives here: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome. As far as I know, it is maintained manually.

chrome-types is automatically generated from the definitions inside of the Chromium source code. It exists primarily as part of the process for generating our documentation, but you're welcome to use it if it meets your needs.