collectype / types/utility / BooleanKeys
BooleanKeys<
T> ={ [K in keyof T]: T[K] extends boolean ? K : never }[keyofT]
Defined in: types/utility.ts:134
Returns the union of keys in T whose value type is boolean (including optional properties).
T
The object type to inspect.
type A = { foo: boolean; bar?: boolean; baz: string };
type Keys = BooleanKeys<A>; // "foo" | "bar"