collectype

collectype v0.11.0


collectype / types/utility / DateKeys

Type Alias: DateKeys<T>

DateKeys<T> = { [K in keyof T]: T[K] extends Date ? K : never }[keyof T]

Defined in: types/utility.ts:154

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

Type Parameters

T

T

The object type to inspect.

Example

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