collectype

collectype v0.11.0


collectype / types/utility / BooleanKeys

Type Alias: BooleanKeys<T>

BooleanKeys<T> = { [K in keyof T]: T[K] extends boolean ? K : never }[keyof T]

Defined in: types/utility.ts:134

Returns the union of keys in T whose value type is boolean (including optional properties).

Type Parameters

T

T

The object type to inspect.

Example

type A = { foo: boolean; bar?: boolean; baz: string };
  type Keys = BooleanKeys<A>; // "foo" | "bar"