import { RendererOptions } from '../shared/svu' ; const doc = ( typeof document !== 'undefined' ? document : null ) as Document ; export const nodeOps = { insert : ( child , parent , anchor ) => { parent . insertBefore ( child , anchor || null ) ; } , remove : child => { const parent = child . parentNode ; if ( parent ) { parent . removeChild ( child ) ; } } , createElement : ( tag ) : Element => doc . createElement ( tag ) , createText : text => doc . createTextNode ( text ) , createComment : text => doc . createComment ( text ) , setText : ( node , text ) => { node . nodeValue = text ; } , setElementText : ( el , text ) => { el . textContent = text ; } , parentNode : node => node . parentNode as Element | null , nextSibling : node => node . nextSibling , querySelector : selector => doc . querySelector ( selector ) , setScopeId ( el , id ) { el . setAttribute ( id , '' ) ; } , cloneNode ( el ) { return el . cloneNode ( true ) ; } } ;