pub trait TypeScriptStmtHandler {
Show 18 methods
// Required methods
fn handle_typescript_stmt(&mut self, stmt_str: &str);
fn handle_interface_def(
&mut self,
name: String,
members: HashMap<String, Type>,
extends: Vec<String>,
);
fn handle_type_alias(&mut self, name: String, ty: Type);
fn handle_generic_type(&self, name: String, type_args: Vec<Type>) -> Type;
fn handle_union_type(&self, types: Vec<Type>) -> Type;
fn handle_intersection_type(&self, types: Vec<Type>) -> Type;
fn handle_conditional_type(
&self,
check_type: Type,
extends_type: Type,
true_type: Type,
false_type: Type,
) -> Type;
fn handle_mapped_type(
&self,
key_var: String,
source_type: Type,
mapped_type: Type,
) -> Type;
fn handle_index_access_type(
&self,
object_type: Type,
index_type: Type,
) -> Type;
fn handle_keyof_type(&self, target_type: Type) -> Type;
fn handle_literal_type(&self, literal: String) -> Type;
fn handle_this_type(&self, this_type: Type) -> Type;
fn handle_omit_this_parameter_type(&self, target_type: Type) -> Type;
fn handle_this_parameter_type(&self, target_type: Type) -> Type;
fn handle_interface_stmt(&mut self, stmt_str: &str);
fn parse_interface_members(
&self,
members_str: &str,
) -> HashMap<String, Type>;
fn handle_type_alias_stmt(&mut self, stmt_str: &str);
fn parse_type(&self, type_str: &str) -> Type;
}Expand description
TypeScript 语句处理器