import { ElectricityType , electricity } from '../' ; const toJoules = ( x ) => x * 3.6 * Math . pow ( 10 , 6 ) ; const FactorDataCenter = toJoules ( 0.007 * Math . pow ( 10 , - 9 ) ) / 8 ; const FactorNetwork = toJoules ( 0.058 * Math . pow ( 10 , - 9 ) ) / 8 ; const FactorDevice = toJoules ( 0.055 / ( 60 * 60 ) ) ; const getInternetUsageCarbonImpact = ( duration , dataWeight , carbonElectricityIntensity ) : number => { const GHGdataCenter = dataWeight * FactorDataCenter * electricity . world ; const GHGnetwork = dataWeight * FactorNetwork * electricity . world ; const GHGdevice = duration * FactorDevice * electricity [ carbonElectricityIntensity ] ; return GHGdataCenter + GHGnetwork + GHGdevice ; } ; export { getInternetUsageCarbonImpact } ;