import * as padImpl from 'pad' ; export const clamp = ( val , min , max ) : number => Math . min ( max , Math . max ( min , val ) ) ; export const pad = ( val , count ) : string => padImpl ( count , '' + val , '\u00A0' ) ; export const number = ( val , padding ) => '`\u200B' + pad ( val , padding + 2 ) + '`' ; export const unit = ( unit , val , padding ) : string => number ( val + unit , padding ) ; export const percent = ( val , padding ) : string => unit ( '%' , + ( val ) . toFixed ( 2 ) , padding ) ; export const decimalPercent = ( val , padding ) : string => percent ( val * 100 , padding ) ; export const deg = ( val , padding ) : string => unit ( '\u00B0' , + ( val ) . toFixed ( 2 ) , padding ) ; export const func = ( name , ... keys ) : string => `**${ name }(**${ keys . join ( ', ' ) }**)**` ;