Preparing search index...

    Function createEnergyLabel

    • Creates an EnergyLabel instance for generating energy label SVGs.

      Type Parameters

      • T extends keyof TemplatesData

        The template name type that determines the label structure.

      Parameters

      • Optionaltemplate: T

        The template name to use for generating the label.

      • Optionaldata: Partial<TemplatesData[T]>

        Partial template data to customize the energy label.

      Returns EnergyLabel

      An EnergyLabel instance ready to generate the SVG.

      const label = createEnergyLabel('smartphones', {
      flagOrigin: 'EU',
      supplierOrTrademark: 'Sultana',
      modelIdentifier: '92COU8944VK',
      eprelRegistrationNumber: '3712289',
      energyClass: 'D',
      batteryEndurancePerCycle: 4020,
      repeatedFreeFallReliabilityClass: 'C',
      repairabilityClass: 'E',
      batteryEnduranceInCycles: '3900',
      ingressProtectionRating: 'IP14'
      })

      // Generate with specific template
      const svgString = label.toString()