Skip to content

@mega-yfue/eufy-sdk / ReadValue

Type Alias: ReadValue<T>

ts
type ReadValue<T> = T extends object ? Exclude<R, undefined> : T extends object ? ValueOf<P> : never;

What a getter answers: a decode's own return type when there is one, otherwise the narrowing of the stored type. A decode IS the value a caller receives, so its type has to win — that is exactly the case (snoozeTime, a duration lifted out of a config blob) where the stored type is not the answer.

Type Parameters

T

T

Independent and unofficial. Not affiliated with, endorsed by, or sponsored by Anker Innovations, Anker eufy, or eufy. "Anker eufy", "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.