import { ScaledUnitFormat } from './scaled-unit-format';
/**
 * A formatter for units that can be formatted/translated by Intl.NumberFormat
 */
export class IntlNumberFormatScaledUnitFormat extends ScaledUnitFormat {
    constructor(scaledUnitFormatFactoryOptions, unitSpecificIntlNumberFormatOptions) {
        super(scaledUnitFormatFactoryOptions);
        this.formatter = new Intl.NumberFormat(this.locale, {
            ...unitSpecificIntlNumberFormatOptions,
            // Application configured options override unit specific options
            ...this.intlNumberFormatOptions
        });
    }
    static createFactory(unitSpecificIntlNumberFormatOptions) {
        return (scaledUnitFormatFactoryOptions) => new IntlNumberFormatScaledUnitFormat(scaledUnitFormatFactoryOptions, unitSpecificIntlNumberFormatOptions);
    }
    format(value) {
        return this.formatter.format(value);
    }
}
//# sourceMappingURL=intl-number-format-scaled-unit-format.js.map