# mod.ts
export type Colors = "red" | "green" | "blue";

// Ensure that we have exactly the keys from 'Colors'.
export const favoriteColors = {
    "red": "yes",
    "green": false,
    "blue": "kinda",
    "platypus": false
//  ~~~~~~~~~~ error - "platypus" was never listed in 'Colors'.
} satisfies Record<Colors, unknown>;

export const g: boolean = favoriteColors.green;

# diagnostics
error[missing-jsdoc]: exported symbol is missing JSDoc documentation
 --> /mod.ts:1:1
  | 
1 | export type Colors = "red" | "green" | "blue";
  | ^


error[missing-jsdoc]: exported symbol is missing JSDoc documentation
 --> /mod.ts:4:14
  | 
4 | export const favoriteColors = {
  |              ^


error[missing-jsdoc]: exported symbol is missing JSDoc documentation
  --> /mod.ts:12:14
   | 
12 | export const g: boolean = favoriteColors.green;
   |              ^

# output.txt
Defined in file:///mod.ts:4:14

const favoriteColors: { red: string; green: boolean; blue: string; platypus: boolean; }

Defined in file:///mod.ts:12:14

const g: boolean

Defined in file:///mod.ts:1:1

type Colors = "red" | "green" | "blue"


# output.json
[
  {
    "name": "Colors",
    "isDefault": false,
    "location": {
      "filename": "file:///mod.ts",
      "line": 1,
      "col": 0,
      "byteIndex": 0
    },
    "declarationKind": "export",
    "kind": "typeAlias",
    "typeAliasDef": {
      "tsType": {
        "repr": "",
        "kind": "union",
        "union": [
          {
            "repr": "red",
            "kind": "literal",
            "literal": {
              "kind": "string",
              "string": "red"
            }
          },
          {
            "repr": "green",
            "kind": "literal",
            "literal": {
              "kind": "string",
              "string": "green"
            }
          },
          {
            "repr": "blue",
            "kind": "literal",
            "literal": {
              "kind": "string",
              "string": "blue"
            }
          }
        ]
      },
      "typeParams": []
    }
  },
  {
    "name": "favoriteColors",
    "isDefault": false,
    "location": {
      "filename": "file:///mod.ts",
      "line": 4,
      "col": 13,
      "byteIndex": 116
    },
    "declarationKind": "export",
    "kind": "variable",
    "variableDef": {
      "tsType": {
        "repr": "",
        "kind": "typeLiteral",
        "typeLiteral": {
          "constructors": [],
          "methods": [],
          "properties": [
            {
              "name": "red",
              "location": {
                "filename": "file:///mod.ts",
                "line": 5,
                "col": 4,
                "byteIndex": 139
              },
              "params": [],
              "computed": false,
              "optional": false,
              "tsType": {
                "repr": "string",
                "kind": "keyword",
                "keyword": "string"
              },
              "typeParams": []
            },
            {
              "name": "green",
              "location": {
                "filename": "file:///mod.ts",
                "line": 6,
                "col": 4,
                "byteIndex": 157
              },
              "params": [],
              "computed": false,
              "optional": false,
              "tsType": {
                "repr": "boolean",
                "kind": "keyword",
                "keyword": "boolean"
              },
              "typeParams": []
            },
            {
              "name": "blue",
              "location": {
                "filename": "file:///mod.ts",
                "line": 7,
                "col": 4,
                "byteIndex": 177
              },
              "params": [],
              "computed": false,
              "optional": false,
              "tsType": {
                "repr": "string",
                "kind": "keyword",
                "keyword": "string"
              },
              "typeParams": []
            },
            {
              "name": "platypus",
              "location": {
                "filename": "file:///mod.ts",
                "line": 8,
                "col": 4,
                "byteIndex": 198
              },
              "params": [],
              "computed": false,
              "optional": false,
              "tsType": {
                "repr": "boolean",
                "kind": "keyword",
                "keyword": "boolean"
              },
              "typeParams": []
            }
          ],
          "callSignatures": [],
          "indexSignatures": []
        }
      },
      "kind": "const"
    }
  },
  {
    "name": "g",
    "isDefault": false,
    "location": {
      "filename": "file:///mod.ts",
      "line": 12,
      "col": 13,
      "byteIndex": 331
    },
    "declarationKind": "export",
    "kind": "variable",
    "variableDef": {
      "tsType": {
        "repr": "boolean",
        "kind": "keyword",
        "keyword": "boolean"
      },
      "kind": "const"
    }
  }
]
