c55fbcb8ed
* feat(webapi): Remove unnecessary polyfills now that we dropped support for Node 14 * feat(webapi): Removed more unnecessary polyfills for Node 16 * chore: changeset
57 lines
1.2 KiB
TypeScript
57 lines
1.2 KiB
TypeScript
const exclusionsForHTMLElement = [
|
|
'CustomElementsRegistry',
|
|
'HTMLElement',
|
|
'HTMLBodyElement',
|
|
'HTMLCanvasElement',
|
|
'HTMLDivElement',
|
|
'HTMLHeadElement',
|
|
'HTMLHtmlElement',
|
|
'HTMLImageElement',
|
|
'HTMLStyleElement',
|
|
'HTMLTemplateElement',
|
|
'HTMLUnknownElement',
|
|
'Image',
|
|
]
|
|
const exclusionsForElement = ['Element', ...exclusionsForHTMLElement] as const
|
|
const exclusionsForDocument = [
|
|
'CustomElementsRegistry',
|
|
'Document',
|
|
'HTMLDocument',
|
|
'document',
|
|
'customElements',
|
|
] as const
|
|
const exclusionsForNode = [
|
|
'Node',
|
|
'DocumentFragment',
|
|
'ShadowRoot',
|
|
...exclusionsForDocument,
|
|
...exclusionsForElement,
|
|
] as const
|
|
const exclusionsForEventTarget = [
|
|
'Event',
|
|
'CustomEvent',
|
|
'EventTarget',
|
|
'OffscreenCanvas',
|
|
'MediaQueryList',
|
|
'Window',
|
|
...exclusionsForNode,
|
|
] as const
|
|
const exclusionsForEvent = [
|
|
'Event',
|
|
'CustomEvent',
|
|
'EventTarget',
|
|
'MediaQueryList',
|
|
'OffscreenCanvas',
|
|
'Window',
|
|
...exclusionsForNode,
|
|
] as const
|
|
|
|
export const exclusions = {
|
|
'Document+': exclusionsForDocument,
|
|
'Element+': exclusionsForElement,
|
|
'Event+': exclusionsForEvent,
|
|
'EventTarget+': exclusionsForEventTarget,
|
|
'HTMLElement+': exclusionsForHTMLElement,
|
|
'Node+': exclusionsForNode,
|
|
'StyleSheet+': ['StyleSheet', 'CSSStyleSheet'],
|
|
}
|