diff options
Diffstat (limited to 'cli/doc/node.rs')
-rw-r--r-- | cli/doc/node.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/cli/doc/node.rs b/cli/doc/node.rs index e1e83ad0d..1be3ba7b1 100644 --- a/cli/doc/node.rs +++ b/cli/doc/node.rs @@ -48,6 +48,35 @@ impl Into<Location> for swc_common::Loc { #[derive(Debug, Serialize, Clone)] #[serde(rename_all = "camelCase")] +pub enum ReexportKind { + /// export * from "./path/to/module.js"; + All, + /// export * as someNamespace from "./path/to/module.js"; + Namespace(String), + /// export default from "./path/to/module.js"; + Default, + /// (identifier, optional alias) + /// export { foo } from "./path/to/module.js"; + /// export { foo as bar } from "./path/to/module.js"; + Named(String, Option<String>), +} + +#[derive(Debug, Serialize, Clone)] +#[serde(rename_all = "camelCase")] +pub struct Reexport { + pub kind: ReexportKind, + pub src: String, +} + +#[derive(Debug, Serialize, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ModuleDoc { + pub exports: Vec<DocNode>, + pub reexports: Vec<Reexport>, +} + +#[derive(Debug, Serialize, Clone)] +#[serde(rename_all = "camelCase")] pub struct DocNode { pub kind: DocNodeKind, pub name: String, |