hap-fluent / ValueTransformer
Type Alias: ValueTransformer<TInput, TOutput>
ts
type ValueTransformer<TInput, TOutput> = (value) => TOutput;Defined in: packages/hap-fluent/src/type-utils.ts:174
A function that transforms a characteristic value from one type/shape to another.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TInput | CharacteristicValue | Input value type. |
TOutput | CharacteristicValue | Output value type. |
Parameters
| Parameter | Type |
|---|---|
value | TInput |
Returns
TOutput
Example
typescript
const percentToDecimal: ValueTransformer<number, number> = (value) => value / 100;