# 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:1:1

namespace RootNs
  Namespace JSdoc

  const a: "a"
  namespace NestedNs
    Nested namespace JSDoc


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