{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/drupal-libraries/latest.json",
  "title": "JSON schema for Drupal libraries file",
  "x-lintel": {
    "source": "https://www.schemastore.org/drupal-libraries.json",
    "sourceSha256": "51525dc4728a7cec7747e7db55ada733e3ec28205abefb667b8c276021156d71",
    "fileMatch": [
      "*.libraries.yml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "$defs": {
    "file": {
      "type": "object",
      "properties": {
        "attributes": {
          "title": "Optional attributes",
          "type": "object"
        },
        "browsers": {
          "title": "Load asset conditionally based on browser",
          "type": "object"
        },
        "minified": {
          "title": "Whether the asset is already minified",
          "type": "boolean"
        },
        "external": {
          "type": "boolean"
        },
        "type": {
          "title": "The source of the asset",
          "type": "string"
        },
        "preprocess": {
          "title": "Whether the assets should be aggregated",
          "type": "boolean"
        },
        "weight": {
          "title": "The order relative to other assets",
          "type": "integer"
        }
      }
    },
    "cssFiles": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/file",
        "type": "object",
        "properties": {
          "group": {
            "title": "The SMACSS group in which the asset is placed",
            "type": "integer"
          },
          "media": {
            "title": "Media type",
            "type": "string",
            "enum": [
              "all",
              "screen",
              "print",
              "speech"
            ]
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": {
    "type": "object",
    "properties": {
      "version": {
        "title": "The library version",
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          }
        ]
      },
      "remote": {
        "title": "The library repository URL",
        "type": "string"
      },
      "license": {
        "type": "object",
        "properties": {
          "name": {
            "title": "The human-readable name of the license",
            "type": "string"
          },
          "url": {
            "title": "The URL of the license file/information for the version of the library used",
            "type": "string"
          },
          "gpl-compatible": {
            "title": "A boolean for whether this library is GPL compatible",
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "header": {
        "title": "A boolean for whether the script must be included in the header",
        "type": "boolean"
      },
      "drupalSettings": {
        "title": "Settings that needs to be attached to drupalSettings object in JavaScript",
        "type": "object"
      },
      "js": {
        "title": "List of JavaScript files to load",
        "type": "object",
        "additionalProperties": {
          "$ref": "#/$defs/file",
          "type": "object",
          "properties": {
            "cache": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        }
      },
      "css": {
        "title": "List of CSS files to load",
        "type": "object",
        "properties": {
          "base": {
            "$ref": "#/$defs/cssFiles"
          },
          "layout": {
            "$ref": "#/$defs/cssFiles"
          },
          "component": {
            "$ref": "#/$defs/cssFiles"
          },
          "theme": {
            "$ref": "#/$defs/cssFiles"
          },
          "state": {
            "$ref": "#/$defs/cssFiles"
          }
        }
      },
      "dependencies": {
        "title": "List libraries that should be loaded along with this library",
        "type": "array",
        "items": {
          "type": "string",
          "pattern": "^.+/.+$"
        }
      }
    },
    "additionalProperties": false
  }
}
