/* eslint-disable @typescript-eslint/consistent-type-definitions -- Declaration merging necessary */ /* eslint-disable @typescript-eslint/ban-types -- The API does return `null`, not `undefined` */ import type {StrictlyParseSelector} from 'typed-query-selector/parser.js'; import 'webextension-polyfill-global'; declare global { interface ParentNode { querySelector(selector: S | readonly S[]): StrictlyParseSelector | null; querySelectorAll( selector: S | readonly S[], ): NodeListOf>; } interface Element { closest(selector: S | readonly S[]): StrictlyParseSelector | null; matches(selectors: string | readonly string[]): boolean; } }