The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface ...