1 export type FunctionPropertyNames<T> = {
2 [K in keyof T]: T[K] extends Function ? K : never
5 export type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>>
7 export type PickWith<T, KT extends keyof T, V> = {
8 [P in KT]: T[P] extends V ? V : never
11 export type PickWithOpt<T, KT extends keyof T, V> = {
12 [P in KT]?: T[P] extends V ? V : never
15 // https://github.com/krzkaczor/ts-essentials Rocks!
16 export type DeepPartial<T> = {
17 [P in keyof T]?: T[P] extends Array<infer U>
18 ? Array<DeepPartial<U>>
19 : T[P] extends ReadonlyArray<infer U>
20 ? ReadonlyArray<DeepPartial<U>>