Skip to content

@mega-yfue/eufy-sdk / isKnownValueKind

Function: isKnownValueKind()

ts
function isKnownValueKind(kind): kind is "boolean" | "timestamp" | "enum" | "percent" | "celsius" | "dbm" | "seconds" | "hours" | "megabytes" | "degrees" | "scalar" | "bitfield" | "identifier" | "text";

Whether a kind is one this version models, narrowing it to KnownValueKind.

The counterpart to leaving the union open: the compiler cannot tell a caller that a kind is one it has a branch for, because at a declaration site any string is accepted. This is how a caller writes the fallback branch the open union asks for — and, in the other direction, how the SDK's own specs catch a kind that was typed rather than modelled.

Parameters

kind

ValueKind

Returns

kind is "boolean" | "timestamp" | "enum" | "percent" | "celsius" | "dbm" | "seconds" | "hours" | "megabytes" | "degrees" | "scalar" | "bitfield" | "identifier" | "text"

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.