import type { CSSVarsPonyfillOptions } from 'css-vars-ponyfill' ; import type { Config , ConfigObject } from '../types' ; import modules from '../modules' ; /**
 * Conditionally load and apply a shim for CSS variables in IE
 */ export function shimmie ( { onComplete , ... config } ) { const test = ( ( window || { } ) . CSS || { } ) . supports && window . CSS . supports ( '(--a: 0)' ) ; if ( ! test ) { document . body . style . visibility = 'hidden' ; import ( 'css-vars-ponyfill' ) . then ( ( { default : cssVarsPonyfill } ) => { cssVarsPonyfill ( { watch : true , updateURLs : false , onComplete ( ) { onComplete && onComplete ( ) ; document . body . style . visibility = 'visible' ; } , ... config } ) ; } ) ; } } /**
 * Configuration helper to provide typescript support
 */ export function defineConfig ( config ) { return typeof config === 'function' ? config ( modules ) : config ; }