11// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
22
3- export type DocNode =
4- | DocNodeModuleDoc
5- | DocNodeFunction
6- | DocNodeVariable
7- | DocNodeEnum
8- | DocNodeClass
9- | DocNodeTypeAlias
10- | DocNodeNamespace
11- | DocNodeInterface
12- | DocNodeImport
13- | DocNodeReference ;
3+ export interface DocNode {
4+ name : string ;
5+ isDefault ?: true ;
6+ declarations : Declaration [ ] ;
7+ }
148
159/** Indicates how the documentation node was declared. `"private"` indicates
1610 * the node is un-exported. `"export"` indicates it is exported from the current
1711 * module. `"declare"` indicates that it is a type only declaration. */
1812export type DeclarationKind = "private" | "export" | "declare" ;
1913
20- interface DocNodeBase {
14+ export type Declaration =
15+ | DeclarationModuleDoc
16+ | DeclarationFunction
17+ | DeclarationVariable
18+ | DeclarationEnum
19+ | DeclarationClass
20+ | DeclarationTypeAlias
21+ | DeclarationNamespace
22+ | DeclarationInterface
23+ | DeclarationImport
24+ | DeclarationReference ;
25+
26+ interface DeclarationBase {
2127 kind : DocNodeKind ;
22- name : string ;
2328 location : Location ;
2429 declarationKind : DeclarationKind ;
2530 jsDoc ?: JsDoc ;
26- isDefault ?: true ;
2731}
2832
2933export type DocNodeKind =
@@ -38,52 +42,52 @@ export type DocNodeKind =
3842 | "import"
3943 | "reference" ;
4044
41- export interface DocNodeModuleDoc extends DocNodeBase {
45+ export interface DeclarationModuleDoc extends DeclarationBase {
4246 kind : "moduleDoc" ;
4347 jsDoc : JsDoc ;
4448}
4549
46- export interface DocNodeFunction extends DocNodeBase {
50+ export interface DeclarationFunction extends DeclarationBase {
4751 kind : "function" ;
4852 functionDef : FunctionDef ;
4953}
5054
51- export interface DocNodeVariable extends DocNodeBase {
55+ export interface DeclarationVariable extends DeclarationBase {
5256 kind : "variable" ;
5357 variableDef : VariableDef ;
5458}
5559
56- export interface DocNodeEnum extends DocNodeBase {
60+ export interface DeclarationEnum extends DeclarationBase {
5761 kind : "enum" ;
5862 enumDef : EnumDef ;
5963}
6064
61- export interface DocNodeClass extends DocNodeBase {
65+ export interface DeclarationClass extends DeclarationBase {
6266 kind : "class" ;
6367 classDef : ClassDef ;
6468}
6569
66- export interface DocNodeTypeAlias extends DocNodeBase {
70+ export interface DeclarationTypeAlias extends DeclarationBase {
6771 kind : "typeAlias" ;
6872 typeAliasDef : TypeAliasDef ;
6973}
7074
71- export interface DocNodeNamespace extends DocNodeBase {
75+ export interface DeclarationNamespace extends DeclarationBase {
7276 kind : "namespace" ;
7377 namespaceDef : NamespaceDef ;
7478}
7579
76- export interface DocNodeInterface extends DocNodeBase {
80+ export interface DeclarationInterface extends DeclarationBase {
7781 kind : "interface" ;
7882 interfaceDef : InterfaceDef ;
7983}
8084
81- export interface DocNodeImport extends DocNodeBase {
85+ export interface DeclarationImport extends DeclarationBase {
8286 kind : "import" ;
8387 importDef : ImportDef ;
8488}
8589
86- export interface DocNodeReference extends DocNodeBase {
90+ export interface DeclarationReference extends DeclarationBase {
8791 kind : "reference" ;
8892 reference_def : ReferenceDef ;
8993}
0 commit comments