{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://transtyle.dev/schemas/config/v0.json",
  "title": "Transtyle config (transtyle.config.json)",
  "description": "Schema for a Transtyle project configuration file. See https://transtyle.dev/docs/configuration/.",
  "type": "object",
  "required": [
    "tokens"
  ],
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "tokens": {
      "type": "array",
      "minItems": 1,
      "items": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "object",
            "required": [
              "files",
              "mode"
            ],
            "additionalProperties": false,
            "properties": {
              "files": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                ]
              },
              "mode": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          }
        ]
      }
    },
    "modes": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "required": [
          "values"
        ],
        "additionalProperties": false,
        "properties": {
          "values": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          },
          "default": {
            "type": "string"
          }
        }
      }
    },
    "derivation": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "rules": {
          "type": "string"
        },
        "autoDark": {
          "type": "boolean"
        },
        "require": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "targets": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "output": {
            "type": "string"
          },
          "exporter": {
            "type": "string"
          },
          "options": {
            "type": "object"
          }
        }
      }
    },
    "check": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "failOn": {
          "type": "string",
          "enum": [
            "error",
            "warning",
            "approximation"
          ]
        },
        "contrast": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "standard": {
              "type": "string",
              "enum": [
                "wcag21-aa",
                "wcag21-aaa"
              ]
            }
          }
        }
      }
    }
  }
}
