summaryrefslogtreecommitdiff
path: root/cli/doc/node.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-08-10 17:41:19 +0200
committerGitHub <noreply@github.com>2020-08-10 17:41:19 +0200
commit6fcf06306ed2ea52031a97b918f1e929d7209250 (patch)
tree01eaea1836d5ee864aafb57677c9fb4d76e33eba /cli/doc/node.rs
parentfdb2dab7cd59a70b79704e0a0efca44be2bfc186 (diff)
feat(doc): handle imports (#6987)
This commit adds additional objects to JSON output of "deno doc" command to facilitate linking between types in different modules.
Diffstat (limited to 'cli/doc/node.rs')
-rw-r--r--cli/doc/node.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/doc/node.rs b/cli/doc/node.rs
index 4946924c6..980a5d8b9 100644
--- a/cli/doc/node.rs
+++ b/cli/doc/node.rs
@@ -11,6 +11,7 @@ pub enum DocNodeKind {
Interface,
TypeAlias,
Namespace,
+ Import,
}
#[derive(Debug, Serialize, Clone, PartialEq)]
@@ -69,6 +70,13 @@ pub struct ModuleDoc {
#[derive(Debug, Serialize, Clone)]
#[serde(rename_all = "camelCase")]
+pub struct ImportDef {
+ pub src: String,
+ pub imported: Option<String>,
+}
+
+#[derive(Debug, Serialize, Clone)]
+#[serde(rename_all = "camelCase")]
pub struct DocNode {
pub kind: DocNodeKind,
pub name: String,
@@ -95,4 +103,7 @@ pub struct DocNode {
#[serde(skip_serializing_if = "Option::is_none")]
pub interface_def: Option<super::interface::InterfaceDef>,
+
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub import_def: Option<ImportDef>,
}