{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Nitro Modules Configuration",
  "type": "object",
  "required": [
    "cxxNamespace",
    "ios",
    "android",
    "autolinking"
  ],
  "properties": {
    "cxxNamespace": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1,
      "description": "Represents the C++ namespace of the module that will be generated. This can have multiple sub-namespaces, and is always relative to `margelo::nitro`."
    },
    "ios": {
      "type": "object",
      "required": [
        "iosModuleName"
      ],
      "properties": {
        "iosModuleName": {
          "type": "string",
          "minLength": 1,
          "description": "Represents the iOS module name of the module that will be generated This will be used to generate Swift bridges, as those are always namespaced within the clang module. If you are using CocoaPods, this should be the Pod name defined in the `.podspec`."
        }
      },
      "description": "Required: iOS configuration"
    },
    "android": {
      "type": "object",
      "required": [
        "androidNamespace",
        "androidCxxLibName"
      ],
      "properties": {
        "androidNamespace": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "description": "Represents the Android namespace ('package') of the module that will be generated. This can have multiple sub-namespaces, and is always relative to `com.margelo.nitro`."
        },
        "androidCxxLibName": {
          "type": "string",
          "minLength": 1,
          "description": "Represents the name of the Android C++ library (aka name in CMakeLists.txt `add_library(..)`). This will be loaded via `System.loadLibrary(...)`."
        }
      },
      "description": "Required: Android configuration"
    },
    "autolinking": {
      "type": "object",
      "description": "Configures the code that gets generated for autolinking (registering) Hybrid Object constructors.",
      "patternProperties": {
        "^.*$": {
          "type": "object",
          "oneOf": [
            {
              "required": [
                "all"
              ],
              "properties": {
                "all": {
                  "type": "object",
                  "required": [
                    "language",
                    "implementationClassName"
                  ],
                  "properties": {
                    "language": {
                      "type": "string",
                      "enum": [
                        "c++"
                      ]
                    },
                    "implementationClassName": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "not": {
                "required": [
                  "all"
                ]
              },
              "minProperties": 1,
              "properties": {
                "ios": {
                  "type": "object",
                  "required": [
                    "language",
                    "implementationClassName"
                  ],
                  "properties": {
                    "language": {
                      "type": "string",
                      "enum": [
                        "c++",
                        "swift"
                      ]
                    },
                    "implementationClassName": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                "android": {
                  "type": "object",
                  "required": [
                    "language",
                    "implementationClassName"
                  ],
                  "properties": {
                    "language": {
                      "type": "string",
                      "enum": [
                        "c++",
                        "kotlin"
                      ]
                    },
                    "implementationClassName": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "patternProperties": {
                "^(?!all$|ios$|android$).+$": {
                  "type": "object",
                  "required": [
                    "language",
                    "implementationClassName"
                  ],
                  "properties": {
                    "language": {
                      "type": "string",
                      "enum": [
                        "c++",
                        "swift",
                        "kotlin"
                      ]
                    },
                    "implementationClassName": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            }
          ]
        }
      }
    },
    "ignorePaths": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "A list of paths relative to the project directory that should be ignored by nitrogen. Nitrogen will not look for `.nitro.ts` files in these directories."
    },
    "gitAttributesGeneratedFlag": {
      "type": "boolean",
      "default": true,
      "description": "Configures whether all nitro-generated files should be marked as `linguist-generated` for GitHub. This excludes generated files from diffing and language statistics."
    }
  }
}
