typescript_ast/ast/
function.rs

1use std::collections::HashMap;
2
3use super::{statement::Statement, tstype::TsType, value::Value};
4
5#[derive(Debug)]
6pub struct Param {
7    pub name: String,
8    pub kinds: Vec<TsType>,
9    pub default: Option<Value>,
10}
11
12#[derive(Debug)]
13pub struct Function {
14    pub name: Option<String>,
15    pub template_args: HashMap<String, Vec<TsType>>,
16    pub is_async: bool,
17    pub params: Vec<Param>,
18    pub returns: Vec<TsType>,
19    pub block: Vec<Statement>,
20}