collectype

collectype v0.11.0


collectype / types/utility / ArrayKeys

Type Alias: ArrayKeys<T>

ArrayKeys<T> = { [K in keyof T]: T[K] extends any[] ? K : never }[keyof T]

Defined in: types/utility.ts:144

Returns the union of keys in T whose value type is an array (any[]), including optional properties.

Type Parameters

T

T

The object type to inspect.

Example

type A = { foo: string[]; bar?: number[]; baz: string };
  type Keys = ArrayKeys<A>; // "foo" | "bar"