PropertiesOfType<O, T>: keyof {
    [Property in keyof O as [T] extends [never]
        ? [NonNullable<O[Property]>] extends [never]
            ? Property
            : never
        : [NonNullable<O[Property]>] extends [never]
            ? never
            : NonNullable<O[Property]> extends T
                ? Property
                : never]: never
}

Returns the properties of object O with types that extend type T. Ignores undefined types.

Type Parameters

  • O extends object

    The object type.

  • T

    The type to filter by.