{ type A = string | number | boolean | Date | null ; type TmpA = Exclude < A , Date | RegExp > ; type TmpB = Extract < A , Date | RegExp > ; type TmpC = NonNullable < A > ; } { type TmpA = ReturnType < ( ) => number > ; type TmpB = ReturnType < { m ( ) : string ; } [ "m" ] > ; type TmpC = InstanceType < typeof Date > ; type TmpD = InstanceType < { new ( ) : RegExp ; } > ; } { class Clazz { str ? : string ; func ? : ( num : number ) => number ; method ( ) { } } type A = Clazz [ keyof Clazz ] ; type B = Extract < A , Function > ; } { type Flip < T , K extends keyof T > = { [ P in Exclude < keyof T , K > ] : T [ P ] ; } ; type PickWithNonNullable < T , K extends keyof T > = { [ P in K ] - ? : NonNullable < T [ P ] > ; } ; type PropertyNonNullable < T , K extends keyof T > = PickWithNonNullable < T , K > & Flip < T , K > ; class Clazz { str ? : string ; func ? : ( num : number ) => number ; method ( ) { } } type A = PropertyNonNullable < Clazz , "func" > ; type B = PropertyNonNullable < A , "str" > ; const obj = new Clazz ( ) ; obj . func = num => num ; obj . func ( 1 ) ; const a = obj as A ; obj . str = "" ; obj . str . charAt ( 0 ) ; const b = a as B ; } { type FunctionPropertyNames < T > = { [ K in keyof T ] : T [ K ] extends Function ? K : never ; } [ keyof T ] ; type FunctionProperties < T > = Pick < T , FunctionPropertyNames < T > > ; type NonFunctionPropertyNames < T > = { [ K in keyof T ] : T [ K ] extends Function ? never : K ; } [ keyof T ] ; type NonFunctionProperties < T > = Pick < T , NonFunctionPropertyNames < T > > ; }