mirror of
https://github.com/denoland/deno.git
synced 2025-09-28 21:24:48 +00:00
fix(doc): Added extends field to interface (#4739)
This commit is contained in:
parent
a9923f3f93
commit
c915e4d77d
4 changed files with 42 additions and 14 deletions
|
@ -4,6 +4,7 @@ use serde::Serialize;
|
|||
|
||||
use super::params::ts_fn_param_to_param_def;
|
||||
use super::parser::DocParser;
|
||||
use super::ts_type::ts_entity_name_to_name;
|
||||
use super::ts_type::ts_type_ann_to_def;
|
||||
use super::ts_type::TsTypeDef;
|
||||
use super::ts_type_param::maybe_type_param_decl_to_type_param_defs;
|
||||
|
@ -49,7 +50,7 @@ pub struct InterfaceCallSignatureDef {
|
|||
#[derive(Debug, Serialize, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct InterfaceDef {
|
||||
// TODO(bartlomieju): extends
|
||||
pub extends: Vec<String>,
|
||||
pub methods: Vec<InterfaceMethodDef>,
|
||||
pub properties: Vec<InterfacePropertyDef>,
|
||||
pub call_signatures: Vec<InterfaceCallSignatureDef>,
|
||||
|
@ -201,7 +202,14 @@ pub fn get_doc_for_ts_interface_decl(
|
|||
interface_decl.type_params.as_ref(),
|
||||
);
|
||||
|
||||
let extends: Vec<String> = interface_decl
|
||||
.extends
|
||||
.iter()
|
||||
.map(|expr| ts_entity_name_to_name(&expr.expr))
|
||||
.collect();
|
||||
|
||||
let interface_def = InterfaceDef {
|
||||
extends,
|
||||
methods,
|
||||
properties,
|
||||
call_signatures,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue