<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _generate_type(self, data_type, indent_spaces, extra_args):
 """ Generates a TypeScript type for the given type. """

        if is_alias(data_type):
            self._generate_alias_type(data_type)
        elif is_struct_type(data_type):
            self._generate_struct_type(data_type, indent_spaces, extra_args)
        elif is_union_type(data_type):
            self._generate_union_type(data_type, indent_spaces)