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