license const BROWSER_SUPPORTS_SHADOW_DOM = 'ShadowRoot' in window ; const attachShadow = ( el ) => { return el . attachShadow ? el . attachShadow ( { mode : 'closed' } ) : ( el as any ) . createShadowRoot ( ) ; } ; function assertElement ( el ) { if ( el instanceof Element ) { return el ; } throw new Error ( 'Expected element to be Element' ) ; } function assertHTMLElement ( el ) { if ( el instanceof HTMLElement ) { return el ; } throw new Error ( 'Expected element to be HTMLElement' ) ; } export { BROWSER_SUPPORTS_SHADOW_DOM , assertElement , assertHTMLElement , attachShadow } ;