{
  "$schema": "https://kubb.dev/schemas/kubb-extension.json",
  "kind": "plugin",
  "name": "plugin-ts",
  "export": "pluginTs",
  "displayName": "TypeScript",
  "description": "Generates TypeScript types and interfaces from your OpenAPI spec, the typed foundation the other Kubb plugins build on.",
  "category": "types",
  "icon": {
    "light": "https://kubb.dev/feature/typescript.svg"
  },
  "tags": ["typescript", "types", "interfaces", "codegen", "openapi"],
  "docs": "https://kubb.dev/extensions/kubb-labs/plugin-ts",
  "maintainers": [
    {
      "name": "Stijn Van Hulle",
      "github": "stijnvanhulle"
    }
  ],
  "compatibility": {
    "kubb": ">=5.19.0",
    "node": ">=22.22"
  },
  "options": [
    {
      "key": "outputPath",
      "path": ["output", "path"],
      "label": "Output Path",
      "description": "Output folder for generated files",
      "type": "text",
      "default": "types"
    },
    {
      "key": "barrel",
      "path": ["output", "barrel"],
      "label": "Barrel",
      "description": "How index.ts barrel files are generated",
      "type": "select",
      "default": {
        "type": "named"
      },
      "choices": [
        {
          "label": "named",
          "value": {
            "type": "named"
          }
        },
        {
          "label": "named (nested)",
          "value": {
            "type": "named",
            "nested": true
          }
        },
        {
          "label": "all",
          "value": {
            "type": "all"
          }
        },
        {
          "label": "all (nested)",
          "value": {
            "type": "all",
            "nested": true
          }
        },
        {
          "label": "false (disabled)",
          "value": false
        }
      ]
    },
    {
      "key": "outputMode",
      "path": ["output", "mode"],
      "label": "Output Mode",
      "description": "How the plugin consolidates its code into files. File mode writes everything into a single file, so the output path must include a file extension and cannot be grouped.",
      "type": "select",
      "default": "directory",
      "choices": [
        {
          "label": "directory (one file per schema)",
          "value": "directory"
        },
        {
          "label": "file (single file)",
          "value": "file"
        }
      ]
    },
    {
      "key": "group",
      "path": ["group"],
      "label": "Group",
      "description": "Group generated operations by OpenAPI tag or path",
      "type": "select",
      "default": null,
      "choices": [
        {
          "label": "none",
          "value": null
        },
        {
          "label": "by tag",
          "value": {
            "type": "tag"
          }
        },
        {
          "label": "by path",
          "value": {
            "type": "path"
          }
        }
      ]
    },
    {
      "key": "excludeTags",
      "path": ["exclude"],
      "label": "Exclude Tags",
      "description": "Comma-separated OpenAPI tags to exclude from generation",
      "type": "list",
      "item": {
        "type": "tag",
        "pattern": "$item"
      }
    },
    {
      "key": "includeTags",
      "path": ["include"],
      "label": "Include Tags",
      "description": "Comma-separated OpenAPI tags to include. Only operations with these tags are generated",
      "type": "list",
      "item": {
        "type": "tag",
        "pattern": "$item"
      }
    },
    {
      "key": "enumType",
      "path": ["enum", "type"],
      "label": "Enum Type",
      "description": "How OpenAPI enums are represented in the generated TypeScript",
      "type": "select",
      "default": "asConst",
      "choices": [
        {
          "label": "asConst",
          "value": "asConst"
        },
        {
          "label": "enum",
          "value": "enum"
        },
        {
          "label": "constEnum",
          "value": "constEnum"
        },
        {
          "label": "literal",
          "value": "literal"
        },
        {
          "label": "inlineLiteral",
          "value": "inlineLiteral"
        }
      ]
    },
    {
      "key": "enumConstCasing",
      "path": ["enum", "constCasing"],
      "label": "Enum Const Casing",
      "description": "Casing of the generated const variable (asConst only)",
      "type": "select",
      "default": "camelCase",
      "choices": [
        {
          "label": "camelCase",
          "value": "camelCase"
        },
        {
          "label": "pascalCase",
          "value": "pascalCase"
        }
      ]
    },
    {
      "key": "enumTypeSuffix",
      "path": ["enum", "typeSuffix"],
      "label": "Enum Type Suffix",
      "description": "Suffix appended to the generated enum type alias (asConst only)",
      "type": "text",
      "default": "Key"
    },
    {
      "key": "enumKeyCasing",
      "path": ["enum", "keyCasing"],
      "label": "Enum Key Casing",
      "description": "Casing for enum key names",
      "type": "select",
      "default": "none",
      "choices": [
        {
          "label": "none",
          "value": "none"
        },
        {
          "label": "pascalCase",
          "value": "pascalCase"
        },
        {
          "label": "camelCase",
          "value": "camelCase"
        },
        {
          "label": "snakeCase",
          "value": "snakeCase"
        },
        {
          "label": "SCREAMING_SNAKE_CASE",
          "value": "screamingSnakeCase"
        }
      ]
    },
    {
      "key": "syntaxType",
      "path": ["syntaxType"],
      "label": "Syntax Type",
      "type": "select",
      "default": "type",
      "choices": [
        {
          "label": "type",
          "value": "type"
        },
        {
          "label": "interface",
          "value": "interface"
        }
      ]
    },
    {
      "key": "optionalType",
      "path": ["optionalType"],
      "label": "Optional Type",
      "type": "select",
      "default": "questionToken",
      "choices": [
        {
          "label": "questionToken",
          "value": "questionToken"
        },
        {
          "label": "undefined",
          "value": "undefined"
        },
        {
          "label": "questionTokenAndUndefined",
          "value": "questionTokenAndUndefined"
        }
      ]
    },
    {
      "key": "arrayType",
      "path": ["arrayType"],
      "label": "Array Type",
      "type": "select",
      "default": "array",
      "choices": [
        {
          "label": "array (T[])",
          "value": "array"
        },
        {
          "label": "generic (Array<T>)",
          "value": "generic"
        }
      ]
    },
    {
      "key": "banner",
      "path": ["output", "banner"],
      "label": "Banner",
      "description": "Text added at the top of every generated file",
      "type": "text"
    },
    {
      "key": "footer",
      "path": ["output", "footer"],
      "label": "Footer",
      "description": "Text added at the end of every generated file",
      "type": "text"
    }
  ]
}
