# mod.ts
/** Namespace JSdoc */
declare namespace RootNs {
    const a = "a";

    /** Nested namespace JSDoc */
    namespace NestedNs {
      enum Foo {
        a = 1,
        b = 2,
        c = 3,
      }
    }
}

# diagnostics
error[missing-jsdoc]: exported symbol is missing JSDoc documentation
 --> /mod.ts:3:11
  | 
3 |     const a = "a";
  |           ^


error[missing-jsdoc]: exported symbol is missing JSDoc documentation
 --> /mod.ts:7:7
  | 
7 |       enum Foo {
  |       ^

# output.txt
Defined in file:///mod.ts:2:1

namespace RootNs
  Namespace JSdoc

  const a: "a"
  namespace NestedNs
    Nested namespace JSDoc


# output.json
[
  {
    "name": "RootNs",
    "isDefault": false,
    "location": {
      "filename": "file:///mod.ts",
      "line": 2,
      "col": 0,
      "byteIndex": 23
    },
    "declarationKind": "declare",
    "jsDoc": {
      "doc": "Namespace JSdoc"
    },
    "kind": "namespace",
    "namespaceDef": {
      "elements": [
        {
          "name": "a",
          "isDefault": false,
          "location": {
            "filename": "file:///mod.ts",
            "line": 3,
            "col": 10,
            "byteIndex": 60
          },
          "declarationKind": "export",
          "kind": "variable",
          "variableDef": {
            "tsType": {
              "repr": "a",
              "kind": "literal",
              "literal": {
                "kind": "string",
                "string": "a"
              }
            },
            "kind": "const"
          }
        },
        {
          "name": "NestedNs",
          "isDefault": false,
          "location": {
            "filename": "file:///mod.ts",
            "line": 6,
            "col": 4,
            "byteIndex": 108
          },
          "declarationKind": "export",
          "jsDoc": {
            "doc": "Nested namespace JSDoc"
          },
          "kind": "namespace",
          "namespaceDef": {
            "elements": [
              {
                "name": "Foo",
                "isDefault": false,
                "location": {
                  "filename": "file:///mod.ts",
                  "line": 7,
                  "col": 6,
                  "byteIndex": 135
                },
                "declarationKind": "export",
                "kind": "enum",
                "enumDef": {
                  "members": [
                    {
                      "name": "a",
                      "init": {
                        "repr": "1",
                        "kind": "literal",
                        "literal": {
                          "kind": "number",
                          "number": 1.0
                        }
                      },
                      "location": {
                        "filename": "file:///mod.ts",
                        "line": 8,
                        "col": 8,
                        "byteIndex": 154
                      }
                    },
                    {
                      "name": "b",
                      "init": {
                        "repr": "2",
                        "kind": "literal",
                        "literal": {
                          "kind": "number",
                          "number": 2.0
                        }
                      },
                      "location": {
                        "filename": "file:///mod.ts",
                        "line": 9,
                        "col": 8,
                        "byteIndex": 169
                      }
                    },
                    {
                      "name": "c",
                      "init": {
                        "repr": "3",
                        "kind": "literal",
                        "literal": {
                          "kind": "number",
                          "number": 3.0
                        }
                      },
                      "location": {
                        "filename": "file:///mod.ts",
                        "line": 10,
                        "col": 8,
                        "byteIndex": 184
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  }
]
