{
  "$ref": "$defs/theme",
  "$defs": {
    "theme": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "mode": {
          "type": "string",
          "enum": [
            "light",
            "dark",
            "auto"
          ],
          "description": "Theme mode: light for light backgrounds, dark for dark backgrounds, auto for system preference"
        },
        "schema": {
          "type": "object",
          "properties": {
            "defaultStyle": {
              "type": "object",
              "properties": {
                "color": {
                  "type": "string",
                  "minLength": 1
                },
                "styleCodes": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "bold",
                      "italic",
                      "underline",
                      "dim",
                      "blink",
                      "reverse",
                      "strikethrough"
                    ]
                  }
                },
                "htmlStyleFormat": {
                  "type": "string",
                  "enum": [
                    "css",
                    "className"
                  ],
                  "description": "HTML style format"
                }
              },
              "required": [
                "color"
              ],
              "additionalProperties": false
            },
            "matchWords": {
              "type": "object",
              "additionalProperties": {
                "$ref": "2/defaultStyle"
              }
            },
            "matchStartsWith": {
              "type": "object",
              "additionalProperties": {
                "$ref": "2/defaultStyle"
              }
            },
            "matchEndsWith": {
              "type": "object",
              "additionalProperties": {
                "$ref": "2/defaultStyle"
              }
            },
            "matchContains": {
              "type": "object",
              "additionalProperties": {
                "$ref": "2/defaultStyle"
              }
            },
            "matchPatterns": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "pattern": {
                    "type": "string"
                  },
                  "options": {
                    "$ref": "4/defaultStyle"
                  }
                },
                "required": [
                  "name",
                  "pattern",
                  "options"
                ],
                "additionalProperties": false
              }
            },
            "whiteSpace": {
              "type": "string",
              "enum": [
                "preserve",
                "trim"
              ],
              "default": "preserve"
            },
            "newLine": {
              "type": "string",
              "enum": [
                "preserve",
                "trim"
              ],
              "default": "preserve"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "name",
        "schema"
      ],
      "additionalProperties": false
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#",
  "version": "0.1.1"
}