import { useColorSchemeContext } from './context' ; interface IDynamicValue < T > { light : T ; dark : T ; } export class DynamicValue < T > implements IDynamicValue < T > { constructor ( public readonly light , public readonly dark ) { } } export function useDynamicValue < T > ( dynamic ) ; export function useDynamicValue < T > ( light , dark ) ; export function useDynamicValue < T > ( light , dark ? ) { const mode = useColorSchemeContext ( ) ; if ( arguments . length > 1 ) { return mode === 'dark' ? dark ! : ( light as T ) ; } else { return ( light as IDynamicValue < T > ) [ mode ] ; } }