( id: string, )
| 19 | |
| 20 | // oxlint-disable-next-line typescript/no-unnecessary-type-parameters |
| 21 | export function getXULElementById<E extends XUL.XULElement>( |
| 22 | id: string, |
| 23 | ): E | null { |
| 24 | // oxlint-disable-next-line typescript/no-unsafe-type-assertion |
| 25 | return document.getElementById(id) as E | null; |
| 26 | } |
| 27 | |
| 28 | export function isXULElement(target: EventTarget): target is XUL.XULElement { |
| 29 | return 'namespaceURI' in target && target.namespaceURI === XUL_NS; |