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