puppeteer/src/global.ts
Remco Haszing 723052d5bb
feat(typescript): allow using puppeteer without dom lib (#6998)
The dom lib inserts all dom related types into the project, which is often
undesirable when working on a NodeJS project.

This change injects global stubs for the dom types required by puppeteer, so
puppeteer can work without users having to add dom types to their project.

Closes #6989
2021-09-11 20:59:51 +00:00

21 lines
607 B
TypeScript

/**
* These global declarations exist so puppeteer can work without the need to use `"dom"`
* types.
*
* To get full type information for these interfaces, add `"types": "dom"`in your
* `tsconfig.json` file.
*/
declare global {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface Document {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface Element {}
// eslint-disable-next-line max-len
// eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/no-unused-vars
interface NodeListOf<TNode> {}
}
export {};