Interface ComplexAttributeConverter<Type, TypeHint>
interface ComplexAttributeConverter<Type = unknown, TypeHint = unknown> {
fromAttribute(value: string | null, type?: TypeHint): Type;
toAttribute(value: Type, type?: TypeHint): unknown;
}
fromAttribute(value: string | null, type?: TypeHint): Type;
toAttribute(value: Type, type?: TypeHint): unknown;
}
Type Parameters
- Type = unknown
- TypeHint = unknown
Index
Methods
Methods
fromAttribute
toAttribute
Called to convert a property value to an attribute value.
It returns unknown instead of string, to be compatible with https://github.com/WICG/trusted-types (and similar efforts).
Returns unknown
Called to convert an attribute value to a property value.