import { noChange } from 'lit';
import { Directive, PartType } from 'lit/directive.js';
export class ValueConverterDirective extends Directive {
    update(part, [value]) {
        if (part.type !== PartType.ELEMENT) {
            throw new Error('The `ValueConverter` directive can only be used on elements');
        }
        const convertedValue = this.convert(value);
        // Apply the converted value to the part
        // The actual application logic is to be defined in the subclass
        this.applyValue(part, convertedValue);
        return noChange;
    }
    render(value) {
        return this.convert(value);
    }
    applyValue(_part, _value) {
        throw new Error('applyValue method must be implemented by subclasses');
    }
}
//# sourceMappingURL=ValueConverterDirective.js.map