@kubb/plugin-ts 5.0.0-beta.4 → 5.0.0-beta.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["ts","ast","factory.createEnumDeclaration","File","ast","File","ast","ast","factory.createTypeReferenceNode","factory.createUrlTemplateType","factory.dateOrStringNode","factory.constToTypeNode","factory.createUnionDeclaration","factory.createIntersectionDeclaration","factory.createTypeLiteralNode","factory.buildMemberNodes","factory.createArrayDeclaration","factory.buildTupleNode","factory.buildPropertyType","factory.createPropertySignature","factory.appendJSDocToNode","factory.buildIndexSignatures","factory.createOmitDeclaration","factory.createTypeDeclaration","jsxRenderer","ast","File","ast"],"sources":["../../../internals/utils/src/casing.ts","../../../internals/utils/src/string.ts","../../../internals/utils/src/object.ts","../src/constants.ts","../src/factory.ts","../src/components/Enum.tsx","../src/components/Type.tsx","../src/utils.ts","../src/printers/printerTs.ts","../src/generators/typeGenerator.tsx","../src/resolvers/resolverTs.ts","../src/plugin.ts","../src/printers/functionPrinter.ts"],"sourcesContent":["type Options = {\n /**\n * When `true`, dot-separated segments are split on `.` and joined with `/` after casing.\n */\n isFile?: boolean\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n const normalized = text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n\n const words = normalized.split(/[\\s\\-_./\\\\:]+/).filter(Boolean)\n\n return words\n .map((word, i) => {\n const allUpper = word.length > 1 && word === word.toUpperCase()\n if (allUpper) return word\n if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1)\n return word.charAt(0).toUpperCase() + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n/**\n * Splits `text` on `.` and applies `transformPart` to each segment.\n * The last segment receives `isLast = true`, all earlier segments receive `false`.\n * Segments are joined with `/` to form a file path.\n *\n * Only splits on dots followed by a letter so that version numbers\n * embedded in operationIds (e.g. `v2025.0`) are kept intact.\n */\nfunction applyToFileParts(text: string, transformPart: (part: string, isLast: boolean) => string): string {\n const parts = text.split(/\\.(?=[a-zA-Z])/)\n return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join('/')\n}\n\n/**\n * Converts `text` to camelCase.\n * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.\n *\n * @example\n * camelCase('hello-world') // 'helloWorld'\n * camelCase('pet.petId', { isFile: true }) // 'pet/petId'\n */\nexport function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? { prefix, suffix } : {}))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n * When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.\n *\n * @example\n * pascalCase('hello-world') // 'HelloWorld'\n * pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'\n */\nexport function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => (isLast ? pascalCase(part, { prefix, suffix }) : camelCase(part)))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n\n/**\n * Converts `text` to snake_case.\n *\n * @example\n * snakeCase('helloWorld') // 'hello_world'\n * snakeCase('Hello-World') // 'hello_world'\n */\nexport function snakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n const processed = `${prefix} ${text} ${suffix}`.trim()\n return processed\n .replace(/([a-z])([A-Z])/g, '$1_$2')\n .replace(/[\\s\\-.]+/g, '_')\n .replace(/[^a-zA-Z0-9_]/g, '')\n .toLowerCase()\n .split('_')\n .filter(Boolean)\n .join('_')\n}\n\n/**\n * Converts `text` to SCREAMING_SNAKE_CASE.\n *\n * @example\n * screamingSnakeCase('helloWorld') // 'HELLO_WORLD'\n */\nexport function screamingSnakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n return snakeCase(text, { prefix, suffix }).toUpperCase()\n}\n","/**\n * Strips a single matching pair of `\"...\"`, `'...'`, or `` `...` `` from both ends of `text`.\n * Returns the string unchanged when no balanced quote pair is found.\n *\n * @example\n * trimQuotes('\"hello\"') // 'hello'\n * trimQuotes('hello') // 'hello'\n */\nexport function trimQuotes(text: string): string {\n if (text.length >= 2) {\n const first = text[0]\n const last = text[text.length - 1]\n if ((first === '\"' && last === '\"') || (first === \"'\" && last === \"'\") || (first === '`' && last === '`')) {\n return text.slice(1, -1)\n }\n }\n return text\n}\n\n/**\n * Escapes characters that are not allowed inside JS string literals.\n * Handles quotes, backslashes, and Unicode line terminators (U+2028 / U+2029).\n *\n * @see http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4\n *\n * @example\n * ```ts\n * jsStringEscape('say \"hi\"\\nbye') // 'say \\\\\"hi\\\\\"\\\\nbye'\n * ```\n */\nexport function jsStringEscape(input: unknown): string {\n return `${input}`.replace(/[\"'\\\\\\n\\r\\u2028\\u2029]/g, (character) => {\n switch (character) {\n case '\"':\n case \"'\":\n case '\\\\':\n return `\\\\${character}`\n case '\\n':\n return '\\\\n'\n case '\\r':\n return '\\\\r'\n case '\\u2028':\n return '\\\\u2028'\n case '\\u2029':\n return '\\\\u2029'\n default:\n return ''\n }\n })\n}\n\n/**\n * Strips the file extension from a path or file name.\n * Only removes the last `.ext` segment when the dot is not part of a directory name.\n *\n * @example\n * trimExtName('petStore.ts') // 'petStore'\n * trimExtName('/src/models/pet.ts') // '/src/models/pet'\n * trimExtName('/project.v2/gen/pet.ts') // '/project.v2/gen/pet'\n * trimExtName('noExtension') // 'noExtension'\n */\nexport function trimExtName(text: string): string {\n const dotIndex = text.lastIndexOf('.')\n if (dotIndex > 0 && !text.includes('/', dotIndex)) {\n return text.slice(0, dotIndex)\n }\n return text\n}\n","import { trimQuotes } from './string.ts'\n\n/**\n * Serializes a primitive value to a JSON string literal, stripping any surrounding quote characters first.\n *\n * @example\n * stringify('hello') // '\"hello\"'\n * stringify('\"hello\"') // '\"hello\"'\n */\nexport function stringify(value: string | number | boolean | undefined): string {\n if (value === undefined || value === null) return '\"\"'\n return JSON.stringify(trimQuotes(value.toString()))\n}\n\n/**\n * Converts a plain object into a multiline key-value string suitable for embedding in generated code.\n * Nested objects are recursively stringified with indentation.\n *\n * @example\n * stringifyObject({ foo: 'bar', nested: { a: 1 } })\n * // 'foo: bar,\\nnested: {\\n a: 1\\n }'\n */\nexport function stringifyObject(value: Record<string, unknown>): string {\n const items = Object.entries(value)\n .map(([key, val]) => {\n if (val !== null && typeof val === 'object') {\n return `${key}: {\\n ${stringifyObject(val as Record<string, unknown>)}\\n }`\n }\n return `${key}: ${val}`\n })\n .filter(Boolean)\n return items.join(',\\n')\n}\n\n/**\n * Converts a dot-notation path or string array into an optional-chaining accessor expression.\n *\n * @example\n * getNestedAccessor('pagination.next.id', 'lastPage')\n * // → \"lastPage?.['pagination']?.['next']?.['id']\"\n */\nexport function getNestedAccessor(param: string | string[], accessor: string): string | null {\n const parts = Array.isArray(param) ? param : param.split('.')\n if (parts.length === 0 || (parts.length === 1 && parts[0] === '')) return null\n return `${accessor}?.['${`${parts.join(\"']?.['\")}']`}`\n}\n","import type { PluginTs } from './types.ts'\n\ntype OptionalType = PluginTs['resolvedOptions']['optionalType']\ntype EnumType = PluginTs['resolvedOptions']['enumType']\n\n/**\n * `optionalType` values that cause a property's type to include `| undefined`.\n */\nexport const OPTIONAL_ADDS_UNDEFINED = new Set<OptionalType>(['undefined', 'questionTokenAndUndefined'] as const)\n\n/**\n * `optionalType` values that render the property key with a `?` token.\n */\nexport const OPTIONAL_ADDS_QUESTION_TOKEN = new Set<OptionalType>(['questionToken', 'questionTokenAndUndefined'] as const)\n\n/**\n * `enumType` values that append a `Key` suffix to the generated enum type alias.\n */\nexport const ENUM_TYPES_WITH_KEY_SUFFIX = new Set<EnumType>(['asConst', 'asPascalConst'] as const)\n\n/**\n * `enumType` values that require a runtime value declaration (object, enum, or literal).\n */\nexport const ENUM_TYPES_WITH_RUNTIME_VALUE = new Set<EnumType | undefined>(['enum', 'asConst', 'asPascalConst', 'constEnum', 'literal', undefined] as const)\n\n/**\n * `enumType` values whose type declaration is type-only (no runtime value emitted for the type alias).\n */\nexport const ENUM_TYPES_WITH_TYPE_ONLY = new Set<EnumType | undefined>(['asConst', 'asPascalConst', 'literal', undefined] as const)\n\n/**\n * Ordering priority for function parameters: lower = sorted earlier.\n */\nexport const PARAM_RANK = {\n required: 0,\n optional: 1,\n withDefault: 2,\n rest: 3,\n} as const\n","import { camelCase, pascalCase, screamingSnakeCase, snakeCase } from '@internals/utils'\nimport { ast } from '@kubb/core'\nimport { isNumber, sortBy } from 'remeda'\nimport ts from 'typescript'\nimport { OPTIONAL_ADDS_UNDEFINED } from './constants.ts'\n\nconst { SyntaxKind, factory } = ts\n\n// https://ts-ast-viewer.com/\n\n/**\n * TypeScript AST modifiers for common keywords (async, export, const, static).\n */\nexport const modifiers = {\n async: factory.createModifier(ts.SyntaxKind.AsyncKeyword),\n export: factory.createModifier(ts.SyntaxKind.ExportKeyword),\n const: factory.createModifier(ts.SyntaxKind.ConstKeyword),\n static: factory.createModifier(ts.SyntaxKind.StaticKeyword),\n} as const\n\n/**\n * TypeScript syntax kind constants for union, literal, and string types.\n */\nexport const syntaxKind = {\n union: SyntaxKind.UnionType as 192,\n literalType: SyntaxKind.LiteralType,\n stringLiteral: SyntaxKind.StringLiteral,\n} as const\n\nfunction isValidIdentifier(str: string): boolean {\n if (!str.length || str.trim() !== str) {\n return false\n }\n const node = ts.parseIsolatedEntityName(str, ts.ScriptTarget.Latest)\n\n return !!node && node.kind === ts.SyntaxKind.Identifier && ts.identifierToKeywordKind(node.kind as unknown as ts.Identifier) === undefined\n}\n\nfunction propertyName(name: string | ts.PropertyName): ts.PropertyName {\n if (typeof name === 'string') {\n const isValid = isValidIdentifier(name)\n return isValid ? factory.createIdentifier(name) : factory.createStringLiteral(name)\n }\n return name\n}\n\nconst questionToken = factory.createToken(ts.SyntaxKind.QuestionToken)\n\n/**\n * Creates a question token for optional type annotations.\n * Pass `true` to use the cached token, or provide a pre-created token.\n */\nexport function createQuestionToken(token?: boolean | ts.QuestionToken) {\n if (!token) {\n return undefined\n }\n if (token === true) {\n return questionToken\n }\n return token\n}\n\n/**\n * Creates a TypeScript intersection type node from multiple type nodes.\n * Returns the single node if only one is provided, or wraps in parentheses if requested.\n */\nexport function createIntersectionDeclaration({ nodes, withParentheses }: { nodes: Array<ts.TypeNode>; withParentheses?: boolean }): ts.TypeNode | null {\n if (!nodes.length) {\n return null\n }\n\n if (nodes.length === 1) {\n return nodes[0] || null\n }\n\n const node = factory.createIntersectionTypeNode(nodes)\n\n if (withParentheses) {\n return factory.createParenthesizedType(node)\n }\n\n return node\n}\n\n/**\n * Creates a TypeScript array type node.\n * Use `arrayType: 'array'` for bracket syntax (`T[]`), or `'generic'` for `Array<T>`.\n *\n * @example Array bracket syntax\n * `createArrayDeclaration({ nodes: [stringType], arrayType: 'array' }) // → string[]`\n *\n * @example Generic Array syntax\n * `createArrayDeclaration({ nodes: [stringType], arrayType: 'generic' }) // → Array<string>`\n */\nexport function createArrayDeclaration({ nodes, arrayType = 'array' }: { nodes: Array<ts.TypeNode>; arrayType?: 'array' | 'generic' }): ts.TypeNode | null {\n if (!nodes.length) {\n return factory.createTupleTypeNode([])\n }\n\n if (nodes.length === 1) {\n const node = nodes[0]\n if (!node) {\n return null\n }\n if (arrayType === 'generic') {\n return factory.createTypeReferenceNode(factory.createIdentifier('Array'), [node])\n }\n return factory.createArrayTypeNode(node)\n }\n\n // For union types (multiple nodes), respect arrayType preference\n const unionType = factory.createUnionTypeNode(nodes)\n if (arrayType === 'generic') {\n return factory.createTypeReferenceNode(factory.createIdentifier('Array'), [unionType])\n }\n // For array syntax with unions, we need parentheses: (string | number)[]\n return factory.createArrayTypeNode(factory.createParenthesizedType(unionType))\n}\n\n/**\n * Minimum nodes length of 2\n * @example Union type example\n * `string | number`\n */\nexport function createUnionDeclaration({ nodes, withParentheses }: { nodes: Array<ts.TypeNode>; withParentheses?: boolean }): ts.TypeNode {\n if (!nodes.length) {\n return keywordTypeNodes.any\n }\n\n if (nodes.length === 1) {\n return nodes[0] as ts.TypeNode\n }\n\n const node = factory.createUnionTypeNode(nodes)\n\n if (withParentheses) {\n return factory.createParenthesizedType(node)\n }\n\n return node\n}\n\n/**\n * Creates a TypeScript property signature for object/interface members.\n * Supports optional markers, readonly modifiers, and type annotations.\n */\nexport function createPropertySignature({\n readOnly,\n modifiers = [],\n name,\n questionToken,\n type,\n}: {\n readOnly?: boolean\n modifiers?: Array<ts.Modifier>\n name: ts.PropertyName | string\n questionToken?: ts.QuestionToken | boolean\n type?: ts.TypeNode\n}) {\n return factory.createPropertySignature(\n [...modifiers, readOnly ? factory.createToken(ts.SyntaxKind.ReadonlyKeyword) : undefined].filter(Boolean),\n propertyName(name),\n createQuestionToken(questionToken),\n type,\n )\n}\n\n/**\n * Creates a function parameter declaration with optional markers, rest parameters, and type annotations.\n */\nexport function createParameterSignature(\n name: string | ts.BindingName,\n {\n modifiers,\n dotDotDotToken,\n questionToken,\n type,\n initializer,\n }: {\n decorators?: Array<ts.Decorator>\n modifiers?: Array<ts.Modifier>\n dotDotDotToken?: ts.DotDotDotToken\n questionToken?: ts.QuestionToken | boolean\n type?: ts.TypeNode\n initializer?: ts.Expression\n },\n): ts.ParameterDeclaration {\n return factory.createParameterDeclaration(modifiers, dotDotDotToken, name, createQuestionToken(questionToken), type, initializer)\n}\n\n/**\n * Creates a JSDoc comment node from an array of comment strings.\n * Returns null if no comments are provided.\n */\nexport function createJSDoc({ comments }: { comments: string[] }) {\n if (!comments.length) {\n return null\n }\n return factory.createJSDocComment(\n factory.createNodeArray(\n comments.map((comment, i) => {\n if (i === comments.length - 1) {\n return factory.createJSDocText(comment)\n }\n\n return factory.createJSDocText(`${comment}\\n`)\n }),\n ),\n )\n}\n\n/**\n * Attaches JSDoc comments to an AST node as synthetic leading comments.\n * Filters out undefined comments before attaching.\n *\n * @see https://github.com/microsoft/TypeScript/issues/44151\n */\nexport function appendJSDocToNode<TNode extends ts.Node>({ node, comments }: { node: TNode; comments: Array<string | undefined> }) {\n const filteredComments = comments.filter(Boolean)\n\n if (!filteredComments.length) {\n return node\n }\n\n const text = filteredComments.reduce((acc = '', comment = '') => {\n return `${acc}\\n * ${comment.replaceAll('*/', '*\\\\/')}`\n }, '*')\n\n // Use the node directly instead of spreading to avoid creating Unknown nodes\n // TypeScript's addSyntheticLeadingComment accepts the node as-is\n return ts.addSyntheticLeadingComment(node, ts.SyntaxKind.MultiLineCommentTrivia, `${text || '*'}\\n`, true)\n}\n\n/**\n * Creates a TypeScript index signature for dynamic property access.\n * Defines the key type (default: `string`) and value type on an object.\n */\nexport function createIndexSignature(\n type: ts.TypeNode,\n {\n modifiers,\n indexName = 'key',\n indexType = factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),\n }: {\n indexName?: string\n indexType?: ts.TypeNode\n decorators?: Array<ts.Decorator>\n modifiers?: Array<ts.Modifier>\n } = {},\n) {\n return factory.createIndexSignature(modifiers, [createParameterSignature(indexName, { type: indexType })], type)\n}\n\n/**\n * Creates a TypeScript type alias declaration with optional modifiers and type parameters.\n */\nexport function createTypeAliasDeclaration({\n modifiers,\n name,\n typeParameters,\n type,\n}: {\n modifiers?: Array<ts.Modifier>\n name: string | ts.Identifier\n typeParameters?: Array<ts.TypeParameterDeclaration>\n type: ts.TypeNode\n}) {\n return factory.createTypeAliasDeclaration(modifiers, name, typeParameters, type)\n}\n\n/**\n * Creates a TypeScript interface declaration with optional modifiers, type parameters, and members.\n */\nexport function createInterfaceDeclaration({\n modifiers,\n name,\n typeParameters,\n members,\n}: {\n modifiers?: Array<ts.Modifier>\n name: string | ts.Identifier\n typeParameters?: Array<ts.TypeParameterDeclaration>\n members: Array<ts.TypeElement>\n}) {\n return factory.createInterfaceDeclaration(modifiers, name, typeParameters, undefined, members)\n}\n\n/**\n * Creates a TypeScript type declaration as either a type alias or interface.\n * Intelligently selects the syntax based on the type structure and attaches JSDoc comments.\n */\nexport function createTypeDeclaration({\n syntax,\n isExportable,\n comments,\n name,\n type,\n}: {\n syntax: 'type' | 'interface'\n comments: Array<string | undefined>\n isExportable?: boolean\n name: string | ts.Identifier\n type: ts.TypeNode\n}) {\n if (syntax === 'interface' && 'members' in type) {\n const node = createInterfaceDeclaration({\n members: [...(type as ts.TypeLiteralNode).members],\n modifiers: isExportable ? [modifiers.export] : [],\n name,\n typeParameters: undefined,\n })\n\n return appendJSDocToNode({\n node,\n comments,\n })\n }\n\n const node = createTypeAliasDeclaration({\n type,\n modifiers: isExportable ? [modifiers.export] : [],\n name,\n typeParameters: undefined,\n })\n\n return appendJSDocToNode({\n node,\n comments,\n })\n}\n\n/**\n * Creates a TypeScript namespace declaration (exported module).\n */\nexport function createNamespaceDeclaration({ statements, name }: { name: string; statements: ts.Statement[] }) {\n return factory.createModuleDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createIdentifier(name),\n factory.createModuleBlock(statements),\n ts.NodeFlags.Namespace,\n )\n}\n\n/**\n * Creates an import declaration with support for default imports, named imports, namespace imports, and type-only imports.\n * Optionally rename imported members with `propertyName` and `name` pairs.\n *\n * @example Default import\n * `import Pet from './Pet'`\n *\n * @example Named imports with rename\n * `import { Pet as Cat } from './Pet'`\n *\n * @example Namespace import\n * `import * as Pet from './Pet'`\n */\nexport function createImportDeclaration({\n name,\n path,\n isTypeOnly = false,\n isNameSpace = false,\n}: {\n name: string | Array<string | { propertyName: string; name?: string }>\n path: string\n isTypeOnly?: boolean\n isNameSpace?: boolean\n}) {\n if (!Array.isArray(name)) {\n let importPropertyName: ts.Identifier | undefined = factory.createIdentifier(name)\n let importName: ts.NamedImportBindings | undefined\n\n if (isNameSpace) {\n importPropertyName = undefined\n importName = factory.createNamespaceImport(factory.createIdentifier(name))\n }\n\n return factory.createImportDeclaration(\n undefined,\n factory.createImportClause(isTypeOnly, importPropertyName, importName),\n factory.createStringLiteral(path),\n undefined,\n )\n }\n\n // Sort the imports alphabetically for consistent output across platforms\n const sortedName = sortBy(name, [(item) => (typeof item === 'object' ? item.propertyName : item), 'asc'])\n\n return factory.createImportDeclaration(\n undefined,\n factory.createImportClause(\n isTypeOnly,\n undefined,\n factory.createNamedImports(\n sortedName.map((item) => {\n if (typeof item === 'object') {\n const obj = item as { propertyName: string; name?: string }\n if (obj.name) {\n return factory.createImportSpecifier(false, factory.createIdentifier(obj.propertyName), factory.createIdentifier(obj.name))\n }\n\n return factory.createImportSpecifier(false, undefined, factory.createIdentifier(obj.propertyName))\n }\n\n return factory.createImportSpecifier(false, undefined, factory.createIdentifier(item))\n }),\n ),\n ),\n factory.createStringLiteral(path),\n undefined,\n )\n}\n\n/**\n * Creates an export declaration with support for named exports, namespace exports, and type-only exports.\n * Sorts export names alphabetically for consistent output across platforms.\n */\nexport function createExportDeclaration({\n path,\n asAlias,\n isTypeOnly = false,\n name,\n}: {\n path: string\n asAlias?: boolean\n isTypeOnly?: boolean\n name?: string | Array<ts.Identifier | string>\n}) {\n if (name && !Array.isArray(name) && !asAlias) {\n console.warn(`When using name as string, asAlias should be true ${name}`)\n }\n\n if (!Array.isArray(name)) {\n const parsedName = name?.match(/^\\d/) ? `_${name?.slice(1)}` : name\n\n return factory.createExportDeclaration(\n undefined,\n isTypeOnly,\n asAlias && parsedName ? factory.createNamespaceExport(factory.createIdentifier(parsedName)) : undefined,\n factory.createStringLiteral(path),\n undefined,\n )\n }\n\n // Sort the exports alphabetically for consistent output across platforms\n const sortedName = sortBy(name, [(propertyName) => (typeof propertyName === 'string' ? propertyName : propertyName.text), 'asc'])\n\n return factory.createExportDeclaration(\n undefined,\n isTypeOnly,\n factory.createNamedExports(\n sortedName.map((propertyName) => {\n return factory.createExportSpecifier(false, undefined, typeof propertyName === 'string' ? factory.createIdentifier(propertyName) : propertyName)\n }),\n ),\n factory.createStringLiteral(path),\n undefined,\n )\n}\n\n/**\n * Apply casing transformation to enum keys\n */\nfunction applyEnumKeyCasing(key: string, casing: 'screamingSnakeCase' | 'snakeCase' | 'pascalCase' | 'camelCase' | 'none' = 'none'): string {\n if (casing === 'none') {\n return key\n }\n if (casing === 'screamingSnakeCase') {\n return screamingSnakeCase(key)\n }\n if (casing === 'snakeCase') {\n return snakeCase(key)\n }\n if (casing === 'pascalCase') {\n return pascalCase(key)\n }\n if (casing === 'camelCase') {\n return camelCase(key)\n }\n return key\n}\n\n/**\n * Creates a TypeScript enum declaration or equivalent construct in various formats.\n * Returns a tuple of [name node, type node] - name node may be undefined for certain types.\n *\n * @example\n * ```ts\n * const [name, type] = createEnumDeclaration({\n * type: 'enum',\n * name: 'petType',\n * typeName: 'PetType',\n * enums: [['cat', 'cat'], ['dog', 'dog']],\n * })\n * ```\n */\nexport function createEnumDeclaration({\n type = 'enum',\n name,\n typeName,\n enums,\n enumKeyCasing = 'none',\n}: {\n /**\n * Choose to use `enum`, `asConst`, `asPascalConst`, `constEnum`, or `literal` for enums.\n * - `enum`: TypeScript enum\n * - `asConst`: const with camelCase name (e.g., `petType`)\n * - `asPascalConst`: const with PascalCase name (e.g., `PetType`)\n * - `constEnum`: const enum\n * - `literal`: literal union type\n * @default `'enum'`\n */\n type?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal' | 'inlineLiteral'\n /**\n * Enum name in camelCase.\n */\n name: string\n /**\n * Enum name in PascalCase.\n */\n typeName: string\n enums: [key: string | number, value: string | number | boolean][]\n /**\n * Choose the casing for enum key names.\n * @default 'none'\n */\n enumKeyCasing?: 'screamingSnakeCase' | 'snakeCase' | 'pascalCase' | 'camelCase' | 'none'\n}): [name: ts.Node | undefined, type: ts.Node] {\n if (type === 'literal' || type === 'inlineLiteral') {\n return [\n undefined,\n factory.createTypeAliasDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createIdentifier(typeName),\n undefined,\n factory.createUnionTypeNode(\n enums\n .map(([_key, value]) => {\n if (isNumber(value)) {\n if (value < 0) {\n return factory.createLiteralTypeNode(\n factory.createPrefixUnaryExpression(ts.SyntaxKind.MinusToken, factory.createNumericLiteral(Math.abs(value))),\n )\n }\n return factory.createLiteralTypeNode(factory.createNumericLiteral(value?.toString()))\n }\n\n if (typeof value === 'boolean') {\n return factory.createLiteralTypeNode(value ? factory.createTrue() : factory.createFalse())\n }\n if (value) {\n return factory.createLiteralTypeNode(factory.createStringLiteral(value.toString()))\n }\n\n return undefined\n })\n .filter(Boolean),\n ),\n ),\n ]\n }\n\n if (type === 'enum' || type === 'constEnum') {\n return [\n undefined,\n factory.createEnumDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword), type === 'constEnum' ? factory.createToken(ts.SyntaxKind.ConstKeyword) : undefined].filter(Boolean),\n factory.createIdentifier(typeName),\n enums\n .map(([key, value]) => {\n let initializer: ts.Expression = factory.createStringLiteral(value?.toString())\n const isExactNumber = Number.parseInt(value.toString(), 10) === value\n\n if (isExactNumber && isNumber(Number.parseInt(value.toString(), 10))) {\n if ((value as number) < 0) {\n initializer = factory.createPrefixUnaryExpression(ts.SyntaxKind.MinusToken, factory.createNumericLiteral(Math.abs(value as number)))\n } else {\n initializer = factory.createNumericLiteral(value as number)\n }\n }\n\n if (typeof value === 'boolean') {\n initializer = value ? factory.createTrue() : factory.createFalse()\n }\n\n if (isNumber(Number.parseInt(key.toString(), 10))) {\n const casingKey = applyEnumKeyCasing(`${typeName}_${key}`, enumKeyCasing)\n return factory.createEnumMember(propertyName(casingKey), initializer)\n }\n\n if (key) {\n const casingKey = applyEnumKeyCasing(key.toString(), enumKeyCasing)\n return factory.createEnumMember(propertyName(casingKey), initializer)\n }\n\n return undefined\n })\n .filter(Boolean),\n ),\n ]\n }\n\n // used when using `as const` instead of an TypeScript enum.\n // name is already PascalCase for asPascalConst and camelCase for asConst (set in Type.tsx)\n // typeName has the Key suffix for type alias, so we use name for the const identifier\n const identifierName = name\n\n // When there are no enum items (empty or all-null enum), don't generate a runtime const.\n // Return undefined for nameNode so the barrel won't try to export a non-existent symbol.\n // Use `never` as the type alias to keep references valid without creating a broken const.\n if (enums.length === 0) {\n return [\n undefined,\n factory.createTypeAliasDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createIdentifier(typeName),\n undefined,\n factory.createKeywordTypeNode(ts.SyntaxKind.NeverKeyword),\n ),\n ]\n }\n\n return [\n factory.createVariableStatement(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createVariableDeclarationList(\n [\n factory.createVariableDeclaration(\n factory.createIdentifier(identifierName),\n undefined,\n undefined,\n factory.createAsExpression(\n factory.createObjectLiteralExpression(\n enums\n .map(([key, value]) => {\n let initializer: ts.Expression = factory.createStringLiteral(value?.toString())\n\n if (isNumber(value)) {\n // Error: Negative numbers should be created in combination with createPrefixUnaryExpression factory.\n // The method createNumericLiteral only accepts positive numbers\n // or those combined with createPrefixUnaryExpression.\n // Therefore, we need to ensure that the number is not negative.\n if (value < 0) {\n initializer = factory.createPrefixUnaryExpression(ts.SyntaxKind.MinusToken, factory.createNumericLiteral(Math.abs(value)))\n } else {\n initializer = factory.createNumericLiteral(value)\n }\n }\n\n if (typeof value === 'boolean') {\n initializer = value ? factory.createTrue() : factory.createFalse()\n }\n\n if (key) {\n const casingKey = applyEnumKeyCasing(key.toString(), enumKeyCasing)\n return factory.createPropertyAssignment(propertyName(casingKey), initializer)\n }\n\n return undefined\n })\n .filter(Boolean),\n true,\n ),\n factory.createTypeReferenceNode(factory.createIdentifier('const'), undefined),\n ),\n ),\n ],\n ts.NodeFlags.Const,\n ),\n ),\n factory.createTypeAliasDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createIdentifier(typeName),\n undefined,\n factory.createIndexedAccessTypeNode(\n factory.createParenthesizedType(factory.createTypeQueryNode(factory.createIdentifier(identifierName), undefined)),\n factory.createTypeOperatorNode(ts.SyntaxKind.KeyOfKeyword, factory.createTypeQueryNode(factory.createIdentifier(identifierName), undefined)),\n ),\n ),\n ]\n}\n\n/**\n * Creates a TypeScript `Omit<T, Keys>` type reference node.\n * Optionally wraps the type in `NonNullable<T>` if `nonNullable` is true.\n */\nexport function createOmitDeclaration({ keys, type, nonNullable }: { keys: Array<string> | string; type: ts.TypeNode; nonNullable?: boolean }) {\n const node = nonNullable ? factory.createTypeReferenceNode(factory.createIdentifier('NonNullable'), [type]) : type\n\n if (Array.isArray(keys)) {\n return factory.createTypeReferenceNode(factory.createIdentifier('Omit'), [\n node,\n factory.createUnionTypeNode(\n keys.map((key) => {\n return factory.createLiteralTypeNode(factory.createStringLiteral(key))\n }),\n ),\n ])\n }\n\n return factory.createTypeReferenceNode(factory.createIdentifier('Omit'), [node, factory.createLiteralTypeNode(factory.createStringLiteral(keys))])\n}\n\n/**\n * Pre-built TypeScript keyword type nodes for common primitive types.\n * Use these to avoid repeatedly creating the same type nodes.\n */\nexport const keywordTypeNodes = {\n any: factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword),\n unknown: factory.createKeywordTypeNode(ts.SyntaxKind.UnknownKeyword),\n void: factory.createKeywordTypeNode(ts.SyntaxKind.VoidKeyword),\n number: factory.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword),\n integer: factory.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword),\n bigint: factory.createKeywordTypeNode(ts.SyntaxKind.BigIntKeyword),\n object: factory.createKeywordTypeNode(ts.SyntaxKind.ObjectKeyword),\n string: factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),\n boolean: factory.createKeywordTypeNode(ts.SyntaxKind.BooleanKeyword),\n undefined: factory.createKeywordTypeNode(ts.SyntaxKind.UndefinedKeyword),\n null: factory.createLiteralTypeNode(factory.createToken(ts.SyntaxKind.NullKeyword)),\n never: factory.createKeywordTypeNode(ts.SyntaxKind.NeverKeyword),\n} as const\n\n/**\n * Converts a path like '/pet/{petId}/uploadImage' to a template literal type\n * like `/pet/${string}/uploadImage`\n */\n/**\n * Converts an OAS-style path (e.g. `/pets/{petId}`) or an Express-style path\n * (e.g. `/pets/:petId`) to a TypeScript template literal type\n * like `` `/pets/${string}` ``.\n */\nexport function createUrlTemplateType(path: string): ts.TypeNode {\n // normalized Express `:param` → OAS `{param}` so a single regex handles both.\n const normalized = path.replace(/:([^/]+)/g, '{$1}')\n\n if (!normalized.includes('{')) {\n return factory.createLiteralTypeNode(factory.createStringLiteral(normalized))\n }\n\n const segments = normalized.split(/(\\{[^}]+\\})/)\n const parts: string[] = []\n const parameterIndices: number[] = []\n\n segments.forEach((segment) => {\n if (segment.startsWith('{') && segment.endsWith('}')) {\n parameterIndices.push(parts.length)\n parts.push(segment)\n } else if (segment) {\n parts.push(segment)\n }\n })\n\n const head = ts.factory.createTemplateHead(parts[0] || '')\n const templateSpans: ts.TemplateLiteralTypeSpan[] = []\n\n parameterIndices.forEach((paramIndex, i) => {\n const isLast = i === parameterIndices.length - 1\n const nextPart = parts[paramIndex + 1] || ''\n const literal = isLast ? ts.factory.createTemplateTail(nextPart) : ts.factory.createTemplateMiddle(nextPart)\n templateSpans.push(ts.factory.createTemplateLiteralTypeSpan(keywordTypeNodes.string, literal))\n })\n\n return ts.factory.createTemplateLiteralType(head, templateSpans)\n}\n\n/**\n * Creates a TypeScript type literal node (anonymous object type).\n */\nexport const createTypeLiteralNode = factory.createTypeLiteralNode\n\n/**\n * Creates a TypeScript type reference node (e.g., `Array<string>`, `Record<K, V>`).\n */\nexport const createTypeReferenceNode = factory.createTypeReferenceNode\n\n/**\n * Creates a numeric literal type node.\n */\nexport const createNumericLiteral = factory.createNumericLiteral\n\n/**\n * Creates a string literal type node.\n */\nexport const createStringLiteral = factory.createStringLiteral\n\n/**\n * Creates an array type node (e.g., `T[]`).\n */\nexport const createArrayTypeNode = factory.createArrayTypeNode\n\n/**\n * Creates a parenthesized type node to control operator precedence.\n */\nexport const createParenthesizedType = factory.createParenthesizedType\n\n/**\n * Creates a literal type node (e.g., `'hello'`, `42`, `true`).\n */\nexport const createLiteralTypeNode = factory.createLiteralTypeNode\n\n/**\n * Creates a null literal type node.\n */\nexport const createNull = factory.createNull\n\n/**\n * Creates an identifier node.\n */\nexport const createIdentifier = factory.createIdentifier\n\n/**\n * Creates an optional type node (e.g., `T | undefined`).\n */\nexport const createOptionalTypeNode = factory.createOptionalTypeNode\n\n/**\n * Creates a tuple type node (e.g., `[string, number]`).\n */\nexport const createTupleTypeNode = factory.createTupleTypeNode\n\n/**\n * Creates a rest type node for variadic tuple elements (e.g., `...T[]`).\n */\nexport const createRestTypeNode = factory.createRestTypeNode\n\n/**\n * Creates a boolean true literal type node.\n */\nexport const createTrue = factory.createTrue\n\n/**\n * Creates a boolean false literal type node.\n */\nexport const createFalse = factory.createFalse\n\n/**\n * Creates an indexed access type node (e.g., `T[K]`).\n */\nexport const createIndexedAccessTypeNode = factory.createIndexedAccessTypeNode\n\n/**\n * Creates a type operator node (e.g., `keyof T`, `readonly T[]`).\n */\nexport const createTypeOperatorNode = factory.createTypeOperatorNode\n\n/**\n * Creates a prefix unary expression (e.g., negative numbers, logical not).\n */\nexport const createPrefixUnaryExpression = factory.createPrefixUnaryExpression\n\n/**\n * Exports TypeScript SyntaxKind enum for AST node type checking.\n */\nexport { SyntaxKind }\n\n// ─── Printer helpers ──────────────────────────────────────────────────────────\n\n/**\n * Converts a primitive const value to a TypeScript literal type node.\n * Handles negative numbers via a prefix unary expression.\n */\nexport function constToTypeNode(value: string | number | boolean, format: 'string' | 'number' | 'boolean'): ts.TypeNode | undefined {\n if (format === 'boolean') {\n return createLiteralTypeNode(value === true ? createTrue() : createFalse())\n }\n if (format === 'number' && typeof value === 'number') {\n if (value < 0) {\n return createLiteralTypeNode(createPrefixUnaryExpression(SyntaxKind.MinusToken, createNumericLiteral(Math.abs(value))))\n }\n return createLiteralTypeNode(createNumericLiteral(value))\n }\n return createLiteralTypeNode(createStringLiteral(String(value)))\n}\n\n/**\n * Returns a `Date` reference type node when `representation` is `'date'`, otherwise falls back to `string`.\n */\nexport function dateOrStringNode(node: { representation?: string }): ts.TypeNode {\n return node.representation === 'date' ? createTypeReferenceNode(createIdentifier('Date')) : keywordTypeNodes.string\n}\n\n/**\n * Maps an array of `SchemaNode`s through the printer, filtering out `null` and `undefined` results.\n */\nexport function buildMemberNodes(\n members: Array<ast.SchemaNode> | undefined,\n print: (node: ast.SchemaNode) => ts.TypeNode | null | undefined,\n): Array<ts.TypeNode> {\n return (members ?? []).map(print).filter(Boolean)\n}\n\n/**\n * Builds a TypeScript tuple type node from an array schema's `items`,\n * applying min/max slice and optional/rest element rules.\n */\nexport function buildTupleNode(node: ast.ArraySchemaNode, print: (node: ast.SchemaNode) => ts.TypeNode | null | undefined): ts.TypeNode | undefined {\n let items = (node.items ?? []).map(print).filter(Boolean)\n\n const restNode = node.rest ? (print(node.rest) ?? undefined) : undefined\n const { min, max } = node\n\n if (max !== undefined) {\n items = items.slice(0, max)\n if (items.length < max && restNode) {\n items = [...items, ...Array(max - items.length).fill(restNode)]\n }\n }\n\n if (min !== undefined) {\n items = items.map((item, i) => (i >= min ? createOptionalTypeNode(item) : item))\n }\n\n if (max === undefined && restNode) {\n items.push(createRestTypeNode(createArrayTypeNode(restNode)))\n }\n\n return createTupleTypeNode(items)\n}\n\n/**\n * Applies `nullable` and optional/nullish `| undefined` union modifiers to a property's resolved base type.\n */\nexport function buildPropertyType(\n schema: ast.SchemaNode,\n baseType: ts.TypeNode,\n optionalType: 'questionToken' | 'undefined' | 'questionTokenAndUndefined',\n): ts.TypeNode {\n const addsUndefined = OPTIONAL_ADDS_UNDEFINED.has(optionalType)\n const meta = ast.syncSchemaRef(schema)\n\n let type = baseType\n\n if (meta.nullable) {\n type = createUnionDeclaration({ nodes: [type, keywordTypeNodes.null] })\n }\n\n if ((meta.nullish || meta.optional) && addsUndefined) {\n type = createUnionDeclaration({ nodes: [type, keywordTypeNodes.undefined] })\n }\n\n return type\n}\n\n/**\n * Creates TypeScript index signatures for `additionalProperties` and `patternProperties` on an object schema node.\n */\nexport function buildIndexSignatures(\n node: { additionalProperties?: ast.SchemaNode | boolean; patternProperties?: Record<string, ast.SchemaNode> },\n propertyCount: number,\n print: (node: ast.SchemaNode) => ts.TypeNode | null | undefined,\n): Array<ts.TypeElement> {\n const elements: Array<ts.TypeElement> = []\n\n if (node.additionalProperties && node.additionalProperties !== true) {\n const additionalType = print(node.additionalProperties) ?? keywordTypeNodes.unknown\n\n elements.push(createIndexSignature(propertyCount > 0 ? keywordTypeNodes.unknown : additionalType))\n } else if (node.additionalProperties === true) {\n elements.push(createIndexSignature(keywordTypeNodes.unknown))\n }\n\n if (node.patternProperties) {\n const first = Object.values(node.patternProperties)[0]\n if (first) {\n let patternType = print(first) ?? keywordTypeNodes.unknown\n\n if (first.nullable) {\n patternType = createUnionDeclaration({ nodes: [patternType, keywordTypeNodes.null] })\n }\n elements.push(createIndexSignature(patternType))\n }\n }\n\n return elements\n}\n","import { camelCase, trimQuotes } from '@internals/utils'\nimport type { ast } from '@kubb/core'\nimport { safePrint } from '@kubb/parser-ts'\nimport { File } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX, ENUM_TYPES_WITH_RUNTIME_VALUE, ENUM_TYPES_WITH_TYPE_ONLY } from '../constants.ts'\nimport * as factory from '../factory.ts'\nimport type { PluginTs, ResolverTs } from '../types.ts'\n\ntype Props = {\n node: ast.EnumSchemaNode\n enumType: PluginTs['resolvedOptions']['enumType']\n enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix']\n enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing']\n resolver: ResolverTs\n key?: string | number | null\n}\n\n/**\n * Resolves the runtime identifier name and the TypeScript type name for an enum schema node.\n *\n * The raw `node.name` may be a YAML key such as `\"enumNames.Type\"` which is not a\n * valid TypeScript identifier. The resolver normalizes it; for inline enum\n * properties the adapter already emits a PascalCase+suffix name so resolution is typically a no-op.\n */\nexport function getEnumNames({\n node,\n enumType,\n enumTypeSuffix,\n resolver,\n}: {\n node: ast.EnumSchemaNode\n enumType: PluginTs['resolvedOptions']['enumType']\n enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix']\n resolver: ResolverTs\n}): {\n enumName: string\n typeName: string\n} {\n const resolved = resolver.default(node.name!, 'type')\n const enumName = enumType === 'asPascalConst' ? resolved : camelCase(node.name!)\n const typeName = ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) ? resolver.resolveEnumKeyName(node, enumTypeSuffix) : resolved\n\n return { enumName, typeName }\n}\n\n/**\n * Renders the enum declaration(s) for a single named `EnumSchemaNode`.\n *\n * Depending on `enumType` this may emit:\n * - A runtime object (`asConst` / `asPascalConst`) plus a `typeof` type alias\n * - A `const enum` or plain `enum` declaration (`constEnum` / `enum`)\n * - A union literal type alias (`literal`)\n *\n * The emitted `File.Source` nodes carry the resolved names so that the barrel\n * index picks up the correct export identifiers.\n */\nexport function Enum({ node, enumType, enumTypeSuffix, enumKeyCasing, resolver }: Props): KubbReactNode {\n const { enumName, typeName } = getEnumNames({ node, enumType, enumTypeSuffix, resolver })\n\n const [nameNode, typeNode] = factory.createEnumDeclaration({\n name: enumName,\n typeName,\n enums: (node.namedEnumValues?.map((v) => [trimQuotes(v.name.toString()), v.value]) ??\n node.enumValues?.filter((v): v is NonNullable<typeof v> => v !== null && v !== undefined).map((v) => [trimQuotes(v.toString()), v]) ??\n []) as Array<[string | number, string | number | boolean]>,\n type: enumType,\n enumKeyCasing,\n })\n\n return (\n <>\n {nameNode && (\n <File.Source name={enumName} isExportable isIndexable isTypeOnly={false}>\n {safePrint(nameNode)}\n </File.Source>\n )}\n <File.Source name={typeName} isIndexable isExportable={ENUM_TYPES_WITH_RUNTIME_VALUE.has(enumType)} isTypeOnly={ENUM_TYPES_WITH_TYPE_ONLY.has(enumType)}>\n {safePrint(typeNode)}\n </File.Source>\n </>\n )\n}\n","import { ast } from '@kubb/core'\nimport { File } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport type { PrinterTsFactory } from '../printers/printerTs.ts'\nimport type { PluginTs, ResolverTs } from '../types.ts'\nimport { Enum, getEnumNames } from './Enum.tsx'\n\ntype Props = {\n name: string\n node: ast.SchemaNode\n /**\n * Pre-configured printer instance created by the generator.\n * Created with `printerTs({ ..., nodes: options.printer?.nodes })`.\n */\n printer: ast.Printer<PrinterTsFactory>\n enumType: PluginTs['resolvedOptions']['enumType']\n enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix']\n enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing']\n resolver: ResolverTs\n}\n\nexport function Type({ name, node, printer, enumType, enumTypeSuffix, enumKeyCasing, resolver }: Props): KubbReactNode {\n const enumSchemaNodes = ast.collect<ast.EnumSchemaNode>(node, {\n schema(n): ast.EnumSchemaNode | undefined {\n const enumNode = ast.narrowSchema(n, ast.schemaTypes.enum)\n if (enumNode?.name) return enumNode\n },\n })\n\n const output = printer.print(node)\n\n if (!output) {\n return\n }\n\n const enums = [...new Map(enumSchemaNodes.map((n) => [n.name, n])).values()].map((node) => {\n return {\n node,\n ...getEnumNames({ node, enumType, enumTypeSuffix, resolver }),\n }\n })\n\n // Skip enum exports when using inlineLiteral\n const shouldExportEnums = enumType !== 'inlineLiteral'\n const shouldExportType = enumType === 'inlineLiteral' || enums.every((item) => item.typeName !== name)\n\n return (\n <>\n {shouldExportEnums &&\n enums.map(({ node }) => (\n <Enum key={node.name} node={node} enumType={enumType} enumTypeSuffix={enumTypeSuffix} enumKeyCasing={enumKeyCasing} resolver={resolver} />\n ))}\n {shouldExportType && (\n <File.Source name={name} isTypeOnly isExportable isIndexable>\n {output}\n </File.Source>\n )}\n </>\n )\n}\n","import { jsStringEscape, stringify } from '@internals/utils'\nimport { ast } from '@kubb/core'\nimport type { ResolverTs } from './types.ts'\n\n/**\n * Collects JSDoc annotation strings for a schema node.\n *\n * Only uses official JSDoc tags from https://jsdoc.app/: `@description`, `@deprecated`, `@default`, `@example`, `@type`.\n * Constraint metadata (min/max length, pattern, multipleOf, min/maxProperties) is emitted as plain-text lines.\n\n */\nexport function buildPropertyJSDocComments(schema: ast.SchemaNode): Array<string | undefined> {\n const meta = ast.syncSchemaRef(schema)\n\n const isArray = meta?.primitive === 'array'\n\n return [\n meta && 'description' in meta && meta.description ? `@description ${jsStringEscape(meta.description)}` : undefined,\n meta && 'deprecated' in meta && meta.deprecated ? '@deprecated' : undefined,\n // minItems/maxItems on arrays should not be emitted as @minLength/@maxLength\n !isArray && meta && 'min' in meta && meta.min !== undefined ? `@minLength ${meta.min}` : undefined,\n !isArray && meta && 'max' in meta && meta.max !== undefined ? `@maxLength ${meta.max}` : undefined,\n meta && 'pattern' in meta && meta.pattern ? `@pattern ${meta.pattern}` : undefined,\n meta && 'default' in meta && meta.default !== undefined\n ? `@default ${'primitive' in meta && meta.primitive === 'string' ? stringify(meta.default as string) : meta.default}`\n : undefined,\n meta && 'example' in meta && meta.example !== undefined ? `@example ${meta.example}` : undefined,\n meta && 'primitive' in meta && meta.primitive\n ? [`@type ${meta.primitive}`, 'optional' in schema && schema.optional ? ' | undefined' : undefined].filter(Boolean).join('')\n : undefined,\n ].filter(Boolean)\n}\n\ntype BuildParamsSchemaOptions = {\n params: Array<ast.ParameterNode>\n resolver: ResolverTs\n}\n\ntype BuildOperationSchemaOptions = {\n resolver: ResolverTs\n}\n\nexport function buildParams(node: ast.OperationNode, { params, resolver }: BuildParamsSchemaOptions): ast.SchemaNode {\n return ast.createSchema({\n type: 'object',\n properties: params.map((param) =>\n ast.createProperty({\n name: param.name,\n required: param.required,\n schema: ast.createSchema({\n type: 'ref',\n name: resolver.resolveParamName(node, param),\n }),\n }),\n ),\n })\n}\n\nexport function buildData(node: ast.OperationNode, { resolver }: BuildOperationSchemaOptions): ast.SchemaNode {\n const pathParams = node.parameters.filter((p) => p.in === 'path')\n const queryParams = node.parameters.filter((p) => p.in === 'query')\n const headerParams = node.parameters.filter((p) => p.in === 'header')\n\n return ast.createSchema({\n type: 'object',\n deprecated: node.deprecated,\n properties: [\n ast.createProperty({\n name: 'data',\n schema: node.requestBody?.content?.[0]?.schema\n ? ast.createSchema({ type: 'ref', name: resolver.resolveDataName(node), optional: true })\n : ast.createSchema({ type: 'never', primitive: undefined, optional: true }),\n }),\n ast.createProperty({\n name: 'pathParams',\n required: pathParams.length > 0,\n schema: pathParams.length > 0 ? buildParams(node, { params: pathParams, resolver }) : ast.createSchema({ type: 'never', primitive: undefined }),\n }),\n ast.createProperty({\n name: 'queryParams',\n schema:\n queryParams.length > 0\n ? ast.createSchema({ ...buildParams(node, { params: queryParams, resolver }), optional: true })\n : ast.createSchema({ type: 'never', primitive: undefined, optional: true }),\n }),\n ast.createProperty({\n name: 'headerParams',\n schema:\n headerParams.length > 0\n ? ast.createSchema({ ...buildParams(node, { params: headerParams, resolver }), optional: true })\n : ast.createSchema({ type: 'never', primitive: undefined, optional: true }),\n }),\n ast.createProperty({\n name: 'url',\n required: true,\n schema: ast.createSchema({ type: 'url', path: node.path }),\n }),\n ],\n })\n}\n\nexport function buildResponses(node: ast.OperationNode, { resolver }: BuildOperationSchemaOptions): ast.SchemaNode | null {\n if (node.responses.length === 0) {\n return null\n }\n\n return ast.createSchema({\n type: 'object',\n properties: node.responses.map((res) =>\n ast.createProperty({\n name: String(res.statusCode),\n required: true,\n schema: ast.createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) }),\n }),\n ),\n })\n}\n\nexport function buildResponseUnion(node: ast.OperationNode, { resolver }: BuildOperationSchemaOptions): ast.SchemaNode | null {\n const responsesWithSchema = node.responses.filter((res) => res.schema)\n\n if (responsesWithSchema.length === 0) {\n return null\n }\n\n return ast.createSchema({\n type: 'union',\n members: responsesWithSchema.map((res) => ast.createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) })),\n })\n}\n","import { ast } from '@kubb/core'\nimport { safePrint } from '@kubb/parser-ts'\nimport type ts from 'typescript'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX, OPTIONAL_ADDS_QUESTION_TOKEN, OPTIONAL_ADDS_UNDEFINED } from '../constants.ts'\nimport * as factory from '../factory.ts'\nimport type { PluginTs, ResolverTs } from '../types.ts'\nimport { buildPropertyJSDocComments } from '../utils.ts'\n\n/**\n * Partial map of node-type overrides for the TypeScript printer.\n *\n * Each key is a `SchemaType` string (e.g. `'date'`, `'string'`). The function\n * replaces the built-in handler for that node type. Use `this.transform` to\n * recurse into nested schema nodes, and `this.options` to read printer options.\n *\n * @example Override the `date` handler\n * ```ts\n * pluginTs({\n * printer: {\n * nodes: {\n * date(node) {\n * return ts.factory.createTypeReferenceNode('Date', [])\n * },\n * },\n * },\n * })\n * ```\n */\nexport type PrinterTsNodes = ast.PrinterPartial<ts.TypeNode, PrinterTsOptions>\n\nexport type PrinterTsOptions = {\n /**\n * Mark parameters as optional with `?` or `| undefined`.\n * - `'questionToken'` adds `?` to properties\n * - `'undefined'` adds `| undefined` to types\n *\n * @default `'questionToken'`\n */\n optionalType: PluginTs['resolvedOptions']['optionalType']\n /**\n * Array representation style.\n * - `'array'` uses bracket notation (`T[]`)\n * - `'generic'` uses generic syntax (`Array<T>`)\n *\n * @default `'array'`\n */\n arrayType: PluginTs['resolvedOptions']['arrayType']\n /**\n * Enum output format.\n * - `'inlineLiteral'` embeds literal unions inline\n * - `'asPascalConst'` generates named const unions\n * - `'asConst'` generates as const declarations\n *\n * @default `'inlineLiteral'`\n */\n enumType: PluginTs['resolvedOptions']['enumType']\n /**\n * Suffix appended to enum key reference names.\n *\n * @example Enum key naming\n * `StatusKey` when `enumType` is `'asConst'`\n *\n * @default `'Key'`\n */\n enumTypeSuffix?: PluginTs['resolvedOptions']['enumTypeSuffix']\n /**\n * Syntax for generated declarations.\n * - `'type'` generates type aliases\n * - `'interface'` generates interface declarations\n *\n * @default `'type'`\n */\n syntaxType?: PluginTs['resolvedOptions']['syntaxType']\n /**\n * Exported name for the type declaration.\n * When omitted, returns only the raw type node.\n */\n name?: string\n\n /**\n * JSDoc comment to attach to the generated type.\n */\n description?: string\n /**\n * Properties to exclude using `Omit<Type, Keys>`.\n * Forces type alias syntax regardless of `syntaxType` setting.\n */\n keysToOmit?: Array<string>\n /**\n * Transforms raw schema names into valid TypeScript identifiers.\n */\n resolver: ResolverTs\n /**\n * Schema names that represent enums for suffixed key references.\n */\n enumSchemaNames?: Set<string>\n /**\n * Custom handler map for node type overrides.\n */\n nodes?: PrinterTsNodes\n}\n\n/**\n * TypeScript printer factory options: maps `SchemaNode` → `ts.TypeNode` (raw) or `ts.Node` (full declaration).\n */\nexport type PrinterTsFactory = ast.PrinterFactoryOptions<'typescript', PrinterTsOptions, ts.TypeNode, string>\n\ntype PrinterTs = PrinterTsFactory\n\n/**\n * TypeScript type printer built with `definePrinter`.\n *\n * Converts a `SchemaNode` AST node into a TypeScript AST node:\n * - **`printer.print(node)`** — when `options.typeName` is set, returns a full\n * `type Name = …` or `interface Name { … }` declaration (`ts.Node`).\n * Without `typeName`, returns the raw `ts.TypeNode` for the schema.\n *\n * Dispatches on `node.type` to the appropriate handler in `nodes`. Options are closed\n * over per printer instance, so each call to `printerTs(options)` produces an independent printer.\n *\n * @example Raw type node (no `typeName`)\n * ```ts\n * const printer = printerTs({ optionalType: 'questionToken', arrayType: 'array', enumType: 'inlineLiteral' })\n * const typeNode = printer.print(schemaNode) // ts.TypeNode\n * ```\n *\n * @example Full declaration (with `typeName`)\n * ```ts\n * const printer = printerTs({ optionalType: 'questionToken', arrayType: 'array', enumType: 'inlineLiteral', typeName: 'MyType' })\n * const declaration = printer.print(schemaNode) // ts.TypeAliasDeclaration | ts.InterfaceDeclaration\n * ```\n */\nexport const printerTs = ast.definePrinter<PrinterTs>((options) => {\n const addsUndefined = OPTIONAL_ADDS_UNDEFINED.has(options.optionalType)\n\n return {\n name: 'typescript',\n options,\n nodes: {\n any: () => factory.keywordTypeNodes.any,\n unknown: () => factory.keywordTypeNodes.unknown,\n void: () => factory.keywordTypeNodes.void,\n never: () => factory.keywordTypeNodes.never,\n boolean: () => factory.keywordTypeNodes.boolean,\n null: () => factory.keywordTypeNodes.null,\n blob: () => factory.createTypeReferenceNode('Blob', []),\n string: () => factory.keywordTypeNodes.string,\n uuid: () => factory.keywordTypeNodes.string,\n email: () => factory.keywordTypeNodes.string,\n url: (node) => {\n if (node.path) {\n return factory.createUrlTemplateType(node.path)\n }\n return factory.keywordTypeNodes.string\n },\n ipv4: () => factory.keywordTypeNodes.string,\n ipv6: () => factory.keywordTypeNodes.string,\n datetime: () => factory.keywordTypeNodes.string,\n number: () => factory.keywordTypeNodes.number,\n integer: () => factory.keywordTypeNodes.number,\n bigint: () => factory.keywordTypeNodes.bigint,\n date: factory.dateOrStringNode,\n time: factory.dateOrStringNode,\n ref(node) {\n if (!node.name) {\n return undefined\n }\n // Parser-generated refs (with $ref) carry raw schema names that need resolving.\n // Use the canonical name from the $ref path — node.name may have been overridden\n // (e.g. by single-member allOf flatten using the property-derived child name).\n // Inline refs (without $ref) from utils already carry resolved type names.\n const refName = node.ref ? (ast.extractRefName(node.ref) ?? node.name) : node.name\n\n // When a Key suffix is configured, enum refs must use the suffixed name (e.g. `StatusKey`)\n // so the reference matches what the enum file actually exports.\n const isEnumRef =\n node.ref && ENUM_TYPES_WITH_KEY_SUFFIX.has(this.options.enumType) && this.options.enumTypeSuffix && this.options.enumSchemaNames?.has(refName)\n\n const name = isEnumRef\n ? this.options.resolver.resolveEnumKeyName({ name: refName }, this.options.enumTypeSuffix!)\n : node.ref\n ? this.options.resolver.default(refName, 'type')\n : refName\n\n return factory.createTypeReferenceNode(name, undefined)\n },\n enum(node) {\n const values = node.namedEnumValues?.map((v) => v.value) ?? node.enumValues ?? []\n\n if (this.options.enumType === 'inlineLiteral' || !node.name) {\n const literalNodes = values\n .filter((v): v is string | number | boolean => v !== null && v !== undefined)\n .map((value) => factory.constToTypeNode(value, typeof value as 'string' | 'number' | 'boolean'))\n .filter(Boolean)\n\n return factory.createUnionDeclaration({ withParentheses: true, nodes: literalNodes }) ?? undefined\n }\n\n const resolvedName =\n ENUM_TYPES_WITH_KEY_SUFFIX.has(this.options.enumType) && this.options.enumTypeSuffix\n ? this.options.resolver.resolveEnumKeyName(node, this.options.enumTypeSuffix)\n : this.options.resolver.default(node.name, 'type')\n\n return factory.createTypeReferenceNode(resolvedName, undefined)\n },\n union(node) {\n const members = node.members ?? []\n\n const hasStringLiteral = members.some((m) => {\n const enumNode = ast.narrowSchema(m, ast.schemaTypes.enum)\n return enumNode?.primitive === 'string'\n })\n const hasPlainString = members.some((m) => ast.isStringType(m))\n\n if (hasStringLiteral && hasPlainString) {\n const memberNodes = members\n .map((m) => {\n if (ast.isStringType(m)) {\n return factory.createIntersectionDeclaration({\n nodes: [factory.keywordTypeNodes.string, factory.createTypeLiteralNode([])],\n withParentheses: true,\n })\n }\n\n return this.transform(m)\n })\n .filter(Boolean)\n\n return factory.createUnionDeclaration({ withParentheses: true, nodes: memberNodes }) ?? undefined\n }\n\n return factory.createUnionDeclaration({ withParentheses: true, nodes: factory.buildMemberNodes(members, this.transform) }) ?? undefined\n },\n intersection(node) {\n return factory.createIntersectionDeclaration({ withParentheses: true, nodes: factory.buildMemberNodes(node.members, this.transform) }) ?? undefined\n },\n array(node) {\n const itemNodes = (node.items ?? []).map((item) => this.transform(item)).filter(Boolean)\n\n return factory.createArrayDeclaration({ nodes: itemNodes, arrayType: this.options.arrayType }) ?? undefined\n },\n tuple(node) {\n return factory.buildTupleNode(node, this.transform)\n },\n object(node) {\n const { transform, options } = this\n\n const addsQuestionToken = OPTIONAL_ADDS_QUESTION_TOKEN.has(options.optionalType)\n\n const propertyNodes: Array<ts.TypeElement> = node.properties.map((prop) => {\n const baseType = transform(prop.schema) ?? factory.keywordTypeNodes.unknown\n const type = factory.buildPropertyType(prop.schema, baseType, options.optionalType)\n const propMeta = ast.syncSchemaRef(prop.schema)\n\n const propertyNode = factory.createPropertySignature({\n questionToken: prop.schema.optional || prop.schema.nullish ? addsQuestionToken : false,\n name: prop.name,\n type,\n readOnly: propMeta?.readOnly,\n })\n\n return factory.appendJSDocToNode({ node: propertyNode, comments: buildPropertyJSDocComments(prop.schema) })\n })\n\n const allElements = [...propertyNodes, ...factory.buildIndexSignatures(node, propertyNodes.length, transform)]\n\n if (!allElements.length) {\n return factory.keywordTypeNodes.object\n }\n\n return factory.createTypeLiteralNode(allElements)\n },\n ...options.nodes,\n },\n print(node) {\n const { name, syntaxType = 'type', description, keysToOmit } = this.options\n\n let base = this.transform(node)\n if (!base) return null\n\n // For ref nodes, structural metadata lives on node.schema rather than the ref node itself.\n const meta = ast.syncSchemaRef(node)\n\n // Without name, apply modifiers inline and return.\n if (!name) {\n if (meta.nullable) {\n base = factory.createUnionDeclaration({ nodes: [base, factory.keywordTypeNodes.null] })\n }\n if ((meta.nullish || meta.optional) && addsUndefined) {\n base = factory.createUnionDeclaration({ nodes: [base, factory.keywordTypeNodes.undefined] })\n }\n return safePrint(base)\n }\n\n // When keysToOmit is present, wrap with Omit first, then apply nullable/optional\n // modifiers so they are not swallowed by NonNullable inside createOmitDeclaration.\n let inner: ts.TypeNode = keysToOmit?.length ? factory.createOmitDeclaration({ keys: keysToOmit, type: base, nonNullable: true }) : base\n\n if (meta.nullable) {\n inner = factory.createUnionDeclaration({ nodes: [inner, factory.keywordTypeNodes.null] })\n }\n\n // For named type declarations (type aliases), optional/nullish always produces | undefined\n // regardless of optionalType — the questionToken ? modifier only applies to object properties.\n if (meta.nullish || meta.optional) {\n inner = factory.createUnionDeclaration({ nodes: [inner, factory.keywordTypeNodes.undefined] })\n }\n\n const useTypeGeneration = syntaxType === 'type' || inner.kind === factory.syntaxKind.union || !!keysToOmit?.length\n\n const typeNode = factory.createTypeDeclaration({\n name,\n isExportable: true,\n type: inner,\n syntax: useTypeGeneration ? 'type' : 'interface',\n comments: buildPropertyJSDocComments({\n ...meta,\n description,\n }),\n })\n\n return safePrint(typeNode)\n },\n }\n})\n","import { ast, defineGenerator } from '@kubb/core'\nimport { File, jsxRenderer } from '@kubb/renderer-jsx'\nimport { Type } from '../components/Type.tsx'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX } from '../constants.ts'\nimport { printerTs } from '../printers/printerTs.ts'\nimport type { PluginTs } from '../types'\nimport { buildData, buildResponses, buildResponseUnion } from '../utils.ts'\n\nexport const typeGenerator = defineGenerator<PluginTs>({\n name: 'typescript',\n renderer: jsxRenderer,\n schema(node, ctx) {\n const { enumType, enumTypeSuffix, enumKeyCasing, syntaxType, optionalType, arrayType, output, group, printer } = ctx.options\n const { adapter, config, resolver, root } = ctx\n\n if (!node.name) {\n return\n }\n const mode = ctx.getMode(output)\n // Build a set of schema names that are enums so the ref handler and getImports\n // callback can use the suffixed type name (e.g. `StatusKey`) for those refs.\n const enumSchemaNames = new Set((adapter.inputNode?.schemas ?? []).filter((s) => ast.narrowSchema(s, ast.schemaTypes.enum) && s.name).map((s) => s.name!))\n\n function resolveImportName(schemaName: string): string {\n if (ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && enumTypeSuffix && enumSchemaNames.has(schemaName)) {\n return resolver.resolveEnumKeyName({ name: schemaName }, enumTypeSuffix)\n }\n return resolver.resolveTypeName(schemaName)\n }\n\n const imports = adapter.getImports(node, (schemaName) => ({\n name: resolveImportName(schemaName),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group }).path,\n }))\n\n const isEnumSchema = !!ast.narrowSchema(node, ast.schemaTypes.enum)\n\n const meta = {\n name: ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema ? resolver.resolveEnumKeyName(node, enumTypeSuffix) : resolver.resolveTypeName(node.name),\n file: resolver.resolveFile({ name: node.name, extname: '.ts' }, { root, output, group }),\n } as const\n\n const schemaPrinter = printerTs({\n optionalType,\n arrayType,\n enumType,\n enumTypeSuffix,\n name: meta.name,\n syntaxType,\n description: node.description,\n resolver,\n enumSchemaNames,\n nodes: printer?.nodes,\n })\n\n return (\n <File\n baseName={meta.file.baseName}\n path={meta.file.path}\n meta={meta.file.meta}\n banner={resolver.resolveBanner(adapter.inputNode, { output, config })}\n footer={resolver.resolveFooter(adapter.inputNode, { output, config })}\n >\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[node.name, imp.path, imp.isTypeOnly].join('-')} root={meta.file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\n <Type\n name={meta.name}\n node={node}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n resolver={resolver}\n printer={schemaPrinter}\n />\n </File>\n )\n },\n operation(node, ctx) {\n const { enumType, enumTypeSuffix, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, output, printer } = ctx.options\n const { adapter, config, resolver, root } = ctx\n\n const mode = ctx.getMode(output)\n\n const params = ast.caseParams(node.parameters, paramsCasing)\n\n const meta = {\n file: resolver.resolveFile({ name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group }),\n } as const\n\n // Build a set of schema names that are enums so the ref handler and getImports\n // callback can use the suffixed type name (e.g. `StatusKey`) for those refs.\n const enumSchemaNames = new Set((adapter.inputNode?.schemas ?? []).filter((s) => ast.narrowSchema(s, ast.schemaTypes.enum) && s.name).map((s) => s.name!))\n\n function resolveImportName(schemaName: string): string {\n if (ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && enumTypeSuffix && enumSchemaNames.has(schemaName)) {\n return resolver.resolveEnumKeyName({ name: schemaName }, enumTypeSuffix)\n }\n return resolver.resolveTypeName(schemaName)\n }\n\n function renderSchemaType({ schema, name, keysToOmit }: { schema: ast.SchemaNode | null; name: string; keysToOmit?: Array<string> }) {\n if (!schema) return null\n\n const imports = adapter.getImports(schema, (schemaName) => ({\n name: resolveImportName(schemaName),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group }).path,\n }))\n\n const schemaPrinter = printerTs({\n optionalType,\n arrayType,\n enumType,\n enumTypeSuffix,\n name,\n syntaxType,\n description: schema.description,\n keysToOmit,\n resolver,\n enumSchemaNames,\n nodes: printer?.nodes,\n })\n\n return (\n <>\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[name, imp.path, imp.isTypeOnly].join('-')} root={meta.file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\n <Type\n name={name}\n node={schema}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n resolver={resolver}\n printer={schemaPrinter}\n />\n </>\n )\n }\n\n const paramTypes = params.map((param) =>\n renderSchemaType({\n schema: param.schema,\n name: resolver.resolveParamName(node, param),\n }),\n )\n\n const requestType = node.requestBody?.content?.[0]?.schema\n ? renderSchemaType({\n schema: {\n ...node.requestBody.content![0]!.schema!,\n description: node.requestBody.description ?? node.requestBody.content![0]!.schema!.description,\n },\n name: resolver.resolveDataName(node),\n keysToOmit: node.requestBody.content![0]!.keysToOmit,\n })\n : null\n\n const responseTypes = node.responses.map((res) =>\n renderSchemaType({\n schema: res.schema,\n name: resolver.resolveResponseStatusName(node, res.statusCode),\n keysToOmit: res.keysToOmit,\n }),\n )\n\n const dataType = renderSchemaType({\n schema: buildData({ ...node, parameters: params }, { resolver }),\n name: resolver.resolveRequestConfigName(node),\n })\n\n const responsesType = renderSchemaType({\n schema: buildResponses(node, { resolver }),\n name: resolver.resolveResponsesName(node),\n })\n\n const responseType = (() => {\n if (!node.responses.some((res) => res.schema)) {\n return null\n }\n\n const responseName = resolver.resolveResponseName(node)\n\n // Skip generating the response union type when an imported component schema\n // has the same resolved name to avoid redeclaration errors.\n const responsesWithSchema = node.responses.filter((res) => res.schema)\n const importedNames = new Set(\n responsesWithSchema.flatMap((res) =>\n res.schema\n ? adapter\n .getImports(res.schema, (schemaName) => ({\n name: resolveImportName(schemaName),\n path: '',\n }))\n .flatMap((imp) => (Array.isArray(imp.name) ? imp.name : [imp.name]))\n : [],\n ),\n )\n\n if (importedNames.has(responseName)) {\n return null\n }\n\n return renderSchemaType({\n schema: {\n ...buildResponseUnion(node, { resolver })!,\n description: 'Union of all possible responses',\n },\n name: responseName,\n })\n })()\n\n return (\n <File\n baseName={meta.file.baseName}\n path={meta.file.path}\n meta={meta.file.meta}\n banner={resolver.resolveBanner(adapter.inputNode, { output, config })}\n footer={resolver.resolveFooter(adapter.inputNode, { output, config })}\n >\n {paramTypes}\n {responseTypes}\n {requestType}\n {dataType}\n {responsesType}\n {responseType}\n </File>\n )\n },\n})\n","import { pascalCase } from '@internals/utils'\nimport { defineResolver } from '@kubb/core'\nimport type { PluginTs } from '../types.ts'\n\n/**\n * Resolver for `@kubb/plugin-ts` that provides the default naming and path-resolution\n * helpers used by the plugin. Import this in other plugins to resolve the exact names and\n * paths that `plugin-ts` generates without hardcoding the conventions.\n *\n * The `default` method is automatically injected by `defineResolver` — it uses `camelCase`\n * for identifiers/files and `pascalCase` for type names.\n *\n * @example\n * ```ts\n * import { resolver } from '@kubb/plugin-ts'\n *\n * resolver.default('list pets', 'type') // → 'ListPets'\n * resolver.resolveName('list pets status 200') // → 'ListPetsStatus200'\n * resolver.resolvePathName('list pets', 'file') // → 'listPets'\n * ```\n */\nexport const resolverTs = defineResolver<PluginTs>((ctx) => {\n return {\n name: 'default',\n pluginName: 'plugin-ts',\n default(name, type) {\n return pascalCase(name, { isFile: type === 'file' })\n },\n resolveTypeName(name) {\n return pascalCase(name)\n },\n resolvePathName(name, type) {\n return pascalCase(name, { isFile: type === 'file' })\n },\n resolveParamName(node, param) {\n return ctx.resolveTypeName(`${node.operationId} ${param.in} ${param.name}`)\n },\n resolveResponseStatusName(node, statusCode) {\n return ctx.resolveTypeName(`${node.operationId} Status ${statusCode}`)\n },\n resolveDataName(node) {\n return ctx.resolveTypeName(`${node.operationId} Data`)\n },\n resolveRequestConfigName(node) {\n return ctx.resolveTypeName(`${node.operationId} RequestConfig`)\n },\n resolveResponsesName(node) {\n return ctx.resolveTypeName(`${node.operationId} Responses`)\n },\n resolveResponseName(node) {\n return ctx.resolveTypeName(`${node.operationId} Response`)\n },\n resolveEnumKeyName(node, enumTypeSuffix = 'key') {\n return `${ctx.resolveTypeName(node.name ?? '')}${enumTypeSuffix}`\n },\n resolvePathParamsName(node, param) {\n return ctx.resolveParamName(node, param)\n },\n resolveQueryParamsName(node, param) {\n return ctx.resolveParamName(node, param)\n },\n resolveHeaderParamsName(node, param) {\n return ctx.resolveParamName(node, param)\n },\n }\n})\n","import { camelCase } from '@internals/utils'\nimport { definePlugin, type Group } from '@kubb/core'\nimport { typeGenerator } from './generators/typeGenerator.tsx'\nimport { resolverTs } from './resolvers/resolverTs.ts'\nimport type { PluginTs } from './types.ts'\n\n/**\n * Canonical plugin name for `@kubb/plugin-ts`, used to identify the plugin in driver lookups and warnings.\n */\nexport const pluginTsName = 'plugin-ts' satisfies PluginTs['name']\n\n/**\n * The `@kubb/plugin-ts` plugin factory.\n *\n * Generates TypeScript type declarations from an OpenAPI/AST `RootNode`.\n * Walks schemas and operations, delegates rendering to the active generators,\n * and writes barrel files based on `output.barrelType`.\n *\n * @example\n * ```ts\n * import pluginTs from '@kubb/plugin-ts'\n *\n * export default defineConfig({\n * plugins: [pluginTs({ output: { path: 'types' }, enumType: 'asConst' })],\n * })\n * ```\n */\nexport const pluginTs = definePlugin<PluginTs>((options) => {\n const {\n output = { path: 'types', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n enumType = 'asConst',\n enumTypeSuffix = 'Key',\n enumKeyCasing = 'none',\n optionalType = 'questionToken',\n arrayType = 'array',\n syntaxType = 'type',\n paramsCasing,\n printer,\n resolver: userResolver,\n transformer: userTransformer,\n generators: userGenerators = [],\n } = options\n\n const groupConfig = group\n ? ({\n ...group,\n name: (ctx) => {\n if (group.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n },\n } satisfies Group)\n : undefined\n\n return {\n name: pluginTsName,\n options,\n hooks: {\n 'kubb:plugin:setup'(ctx) {\n ctx.setOptions({\n output,\n exclude,\n include,\n override,\n optionalType,\n group: groupConfig,\n arrayType,\n enumType,\n enumTypeSuffix,\n enumKeyCasing,\n syntaxType,\n paramsCasing,\n printer,\n })\n ctx.setResolver(userResolver ? { ...resolverTs, ...userResolver } : resolverTs)\n if (userTransformer) {\n ctx.setTransformer(userTransformer)\n }\n ctx.addGenerator(typeGenerator)\n for (const gen of userGenerators) {\n ctx.addGenerator(gen)\n }\n },\n },\n }\n})\n\nexport default pluginTs\n","import { ast } from '@kubb/core'\nimport { PARAM_RANK } from '../constants.ts'\n\n/**\n * Maps each function-printer handler key to its concrete node type.\n */\nexport type FunctionNodeByType = {\n functionParameter: ast.FunctionParameterNode\n parameterGroup: ast.ParameterGroupNode\n functionParameters: ast.FunctionParametersNode\n paramsType: ast.ParamsTypeNode\n}\n\nconst kindToHandlerKey = {\n FunctionParameter: 'functionParameter',\n ParameterGroup: 'parameterGroup',\n FunctionParameters: 'functionParameters',\n ParamsType: 'paramsType',\n} satisfies Record<string, ast.FunctionNodeType>\n\n/**\n * Creates a function-parameter printer factory.\n *\n * Uses `createPrinterFactory` and dispatches handlers by `node.kind`\n * (for function nodes) rather than by `node.type` (for schema nodes).\n */\nexport const defineFunctionPrinter = ast.createPrinterFactory<ast.FunctionParamNode, ast.FunctionNodeType, FunctionNodeByType>(\n (node) => kindToHandlerKey[node.kind],\n)\n\nexport type FunctionPrinterOptions = {\n /**\n * Rendering modes supported by `functionPrinter`.\n *\n * | Mode | Output example | Use case |\n * |---------------|---------------------------------------------|---------------------------------|\n * | `declaration` | `id: string, config: Config = {}` | Function parameter declaration |\n * | `call` | `id, { method, url }` | Function call arguments |\n * | `keys` | `{ id, config }` | Key names only (destructuring) |\n * | `values` | `{ id: id, config: config }` | Key/value object entries |\n */\n mode: 'declaration' | 'call' | 'keys' | 'values'\n /**\n * Optional transformation applied to every parameter name before printing.\n */\n transformName?: (name: string) => string\n /**\n * Optional transformation applied to every type string before printing.\n */\n transformType?: (type: string) => string\n}\n\ntype DefaultPrinter = ast.PrinterFactoryOptions<'functionParameters', FunctionPrinterOptions, string>\n\nfunction rank(param: ast.FunctionParameterNode | ast.ParameterGroupNode): number {\n if (param.kind === 'ParameterGroup') {\n if (param.default) return PARAM_RANK.withDefault\n const isOptional = param.optional ?? param.properties.every((p) => p.optional || p.default !== undefined)\n return isOptional ? PARAM_RANK.optional : PARAM_RANK.required\n }\n if (param.rest) return PARAM_RANK.rest\n if (param.default) return PARAM_RANK.withDefault\n return param.optional ? PARAM_RANK.optional : PARAM_RANK.required\n}\n\nfunction sortParams(params: ReadonlyArray<ast.FunctionParameterNode | ast.ParameterGroupNode>): Array<ast.FunctionParameterNode | ast.ParameterGroupNode> {\n return [...params].sort((a, b) => rank(a) - rank(b))\n}\n\nfunction sortChildParams(params: Array<ast.FunctionParameterNode>): Array<ast.FunctionParameterNode> {\n return [...params].sort((a, b) => rank(a) - rank(b))\n}\n\n/**\n * Default function-signature printer.\n * Covers the four standard output modes used across Kubb plugins.\n *\n * @example\n * ```ts\n * const printer = functionPrinter({ mode: 'declaration' })\n *\n * const sig = createFunctionParameters({\n * params: [\n * createFunctionParameter({ name: 'petId', type: 'string', optional: false }),\n * createFunctionParameter({ name: 'config', type: 'Config', optional: false, default: '{}' }),\n * ],\n * })\n *\n * printer.print(sig) // → \"petId: string, config: Config = {}\"\n * ```\n */\nexport const functionPrinter = defineFunctionPrinter<DefaultPrinter>((options) => ({\n name: 'functionParameters',\n options,\n nodes: {\n paramsType(node) {\n if (node.kind !== 'ParamsType') return null\n if (node.variant === 'member') {\n return `${node.base}['${node.key}']`\n }\n if (node.variant === 'struct') {\n const parts = node.properties.map((p) => {\n const typeStr = this.transform(p.type)\n const key = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(p.name) ? p.name : JSON.stringify(p.name)\n return p.optional ? `${key}?: ${typeStr}` : `${key}: ${typeStr}`\n })\n return `{ ${parts.join('; ')} }`\n }\n if (node.variant === 'reference') {\n return node.name\n }\n return null\n },\n functionParameter(node) {\n const { mode, transformName, transformType } = this.options\n const name = transformName ? transformName(node.name) : node.name\n\n const rawType = node.type ? this.transform(node.type) : undefined\n const type = rawType != null && transformType ? transformType(rawType) : rawType\n\n if (mode === 'keys' || mode === 'values') {\n return node.rest ? `...${name}` : name\n }\n\n if (mode === 'call') {\n return node.rest ? `...${name}` : name\n }\n\n if (node.rest) {\n return type ? `...${name}: ${type}` : `...${name}`\n }\n if (type) {\n if (node.optional) return `${name}?: ${type}`\n return node.default ? `${name}: ${type} = ${node.default}` : `${name}: ${type}`\n }\n return node.default ? `${name} = ${node.default}` : name\n },\n parameterGroup(node) {\n const { mode, transformName, transformType } = this.options\n const sorted = sortChildParams(node.properties)\n const isOptional = node.optional ?? sorted.every((p) => p.optional || p.default !== undefined)\n\n if (node.inline) {\n return sorted\n .map((p) => this.transform(p))\n .filter(Boolean)\n .join(', ')\n }\n\n if (mode === 'keys' || mode === 'values') {\n const keys = sorted.map((p) => p.name).join(', ')\n return `{ ${keys} }`\n }\n\n if (mode === 'call') {\n const keys = sorted.map((p) => p.name).join(', ')\n return `{ ${keys} }`\n }\n\n const names = sorted.map((p) => {\n const n = transformName ? transformName(p.name) : p.name\n\n return n\n })\n\n const nameStr = names.length ? `{ ${names.join(', ')} }` : undefined\n if (!nameStr) return null\n\n let typeAnnotation: string | undefined = node.type ? (this.transform(node.type) ?? undefined) : undefined\n if (!typeAnnotation) {\n const typeParts = sorted\n .filter((p) => p.type)\n .map((p) => {\n const rawT = p.type ? this.transform(p.type) : undefined\n const t = rawT != null && transformType ? transformType(rawT) : rawT\n return p.optional || p.default !== undefined ? `${p.name}?: ${t}` : `${p.name}: ${t}`\n })\n typeAnnotation = typeParts.length ? `{ ${typeParts.join('; ')} }` : undefined\n }\n\n if (typeAnnotation) {\n if (isOptional) return `${nameStr}: ${typeAnnotation} = ${node.default ?? '{}'}`\n return node.default ? `${nameStr}: ${typeAnnotation} = ${node.default}` : `${nameStr}: ${typeAnnotation}`\n }\n\n return node.default ? `${nameStr} = ${node.default}` : nameStr\n },\n functionParameters(node) {\n const sorted = sortParams(node.params)\n\n return sorted\n .map((p) => this.transform(p))\n .filter(Boolean)\n .join(', ')\n },\n },\n}))\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,gBAAgB,MAAc,QAAyB;AAS9D,QARmB,KAChB,MAAM,CACN,QAAQ,qBAAqB,QAAQ,CACrC,QAAQ,yBAAyB,QAAQ,CACzC,QAAQ,gBAAgB,QAEH,CAAC,MAAM,gBAAgB,CAAC,OAAO,QAE3C,CACT,KAAK,MAAM,MAAM;AAEhB,MADiB,KAAK,SAAS,KAAK,SAAS,KAAK,aAAa,CACjD,QAAO;AACrB,MAAI,MAAM,KAAK,CAAC,OAAQ,QAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;AAC3E,SAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;GACnD,CACD,KAAK,GAAG,CACR,QAAQ,iBAAiB,GAAG;;;;;;;;;;AAWjC,SAAS,iBAAiB,MAAc,eAAkE;CACxG,MAAM,QAAQ,KAAK,MAAM,iBAAiB;AAC1C,QAAO,MAAM,KAAK,MAAM,MAAM,cAAc,MAAM,MAAM,MAAM,SAAS,EAAE,CAAC,CAAC,KAAK,IAAI;;;;;;;;;;AAWtF,SAAgB,UAAU,MAAc,EAAE,QAAQ,SAAS,IAAI,SAAS,OAAgB,EAAE,EAAU;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,IAAI,KAAA,IAAa,KAAA;AAChG,OAAI,CAAC,gBAAgB;IACnB,MAAM,YAAY,OACf,QAAQ,MAAM,EAAE,KAAK,CACrB,KAAK,MAAM;KACV,MAAM,OAAO,EAAE,OAAO,KAAK,UAAU,EAAE,KAAK,GAAG,KAAA;KAC/C,MAAM,IAAI,QAAQ,QAAQ,gBAAgB,cAAc,KAAK,GAAG;AAChE,YAAO,EAAE,YAAY,EAAE,YAAY,KAAA,IAAY,GAAG,EAAE,KAAK,KAAK,MAAM,GAAG,EAAE,KAAK,IAAI;MAClF;AACJ,qBAAiB,UAAU,SAAS,KAAK,UAAU,KAAK,KAAK,CAAC,MAAM,KAAA;;AAGtE,OAAI,gBAAgB;AAClB,QAAI,WAAY,QAAO,GAAG,QAAQ,IAAI,eAAe,KAAK,KAAK,WAAW;AAC1E,WAAO,KAAK,UAAU,GAAG,QAAQ,IAAI,eAAe,KAAK,KAAK,YAAY,GAAG,QAAQ,IAAI;;AAG3F,UAAO,KAAK,UAAU,GAAG,QAAQ,KAAK,KAAK,YAAY;;EAEzD,mBAAmB,MAAM;AAGvB,UAFe,WAAW,KAAK,OAElB,CACV,KAAK,MAAM,KAAK,UAAU,EAAE,CAAC,CAC7B,OAAO,QAAQ,CACf,KAAK,KAAK;;EAEhB;CACF,EAAE"}
1
+ {"version":3,"file":"index.cjs","names":["ts","isNonNullable","ast","factory.createEnumDeclaration","File","parserTs","ast","File","ast","ast","ast","factory.createTypeReferenceNode","factory.createUrlTemplateType","factory.dateOrStringNode","factory.constToTypeNode","factory.createUnionDeclaration","factory.createIntersectionDeclaration","factory.createTypeLiteralNode","factory.buildMemberNodes","factory.createArrayDeclaration","factory.buildTupleNode","factory.buildPropertyType","factory.createPropertySignature","factory.appendJSDocToNode","factory.buildIndexSignatures","parserTs","factory.createOmitDeclaration","factory.createTypeDeclaration","jsxRendererSync","ast","File","ast"],"sources":["../../../internals/utils/src/casing.ts","../../../internals/utils/src/string.ts","../../../internals/utils/src/object.ts","../../../internals/utils/src/reserved.ts","../src/constants.ts","../src/factory.ts","../src/components/Enum.tsx","../src/components/Type.tsx","../../../internals/shared/src/operation.ts","../../../internals/shared/src/group.ts","../src/utils.ts","../src/printers/printerTs.ts","../src/generators/typeGenerator.tsx","../src/resolvers/resolverTs.ts","../src/plugin.ts","../src/printers/functionPrinter.ts"],"sourcesContent":["type Options = {\n /**\n * When `true`, dot-separated segments are split on `.` and joined with `/` after casing.\n */\n isFile?: boolean\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n const normalized = text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n\n const words = normalized.split(/[\\s\\-_./\\\\:]+/).filter(Boolean)\n\n return words\n .map((word, i) => {\n const allUpper = word.length > 1 && word === word.toUpperCase()\n if (allUpper) return word\n if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1)\n return word.charAt(0).toUpperCase() + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n/**\n * Splits `text` on `.` and applies `transformPart` to each segment.\n * The last segment receives `isLast = true`, all earlier segments receive `false`.\n * Segments are joined with `/` to form a file path.\n *\n * Only splits on dots followed by a letter so that version numbers\n * embedded in operationIds (e.g. `v2025.0`) are kept intact.\n */\nfunction applyToFileParts(text: string, transformPart: (part: string, isLast: boolean) => string): string {\n const parts = text.split(/\\.(?=[a-zA-Z])/)\n return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join('/')\n}\n\n/**\n * Converts `text` to camelCase.\n * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.\n *\n * @example\n * camelCase('hello-world') // 'helloWorld'\n * camelCase('pet.petId', { isFile: true }) // 'pet/petId'\n */\nexport function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? { prefix, suffix } : {}))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n * When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.\n *\n * @example\n * pascalCase('hello-world') // 'HelloWorld'\n * pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'\n */\nexport function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => (isLast ? pascalCase(part, { prefix, suffix }) : camelCase(part)))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n\n/**\n * Converts `text` to snake_case.\n *\n * @example\n * snakeCase('helloWorld') // 'hello_world'\n * snakeCase('Hello-World') // 'hello_world'\n */\nexport function snakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n const processed = `${prefix} ${text} ${suffix}`.trim()\n return processed\n .replace(/([a-z])([A-Z])/g, '$1_$2')\n .replace(/[\\s\\-.]+/g, '_')\n .replace(/[^a-zA-Z0-9_]/g, '')\n .toLowerCase()\n .split('_')\n .filter(Boolean)\n .join('_')\n}\n\n/**\n * Converts `text` to SCREAMING_SNAKE_CASE.\n *\n * @example\n * screamingSnakeCase('helloWorld') // 'HELLO_WORLD'\n */\nexport function screamingSnakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n return snakeCase(text, { prefix, suffix }).toUpperCase()\n}\n","/**\n * Strips a single matching pair of `\"...\"`, `'...'`, or `` `...` `` from both ends of `text`.\n * Returns the string unchanged when no balanced quote pair is found.\n *\n * @example\n * trimQuotes('\"hello\"') // 'hello'\n * trimQuotes('hello') // 'hello'\n */\nexport function trimQuotes(text: string): string {\n if (text.length >= 2) {\n const first = text[0]\n const last = text[text.length - 1]\n if ((first === '\"' && last === '\"') || (first === \"'\" && last === \"'\") || (first === '`' && last === '`')) {\n return text.slice(1, -1)\n }\n }\n return text\n}\n\n/**\n * Escapes characters that are not allowed inside JS string literals.\n * Handles quotes, backslashes, and Unicode line terminators (U+2028 / U+2029).\n *\n * @see http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4\n *\n * @example\n * ```ts\n * jsStringEscape('say \"hi\"\\nbye') // 'say \\\\\"hi\\\\\"\\\\nbye'\n * ```\n */\nexport function jsStringEscape(input: unknown): string {\n return `${input}`.replace(/[\"'\\\\\\n\\r\\u2028\\u2029]/g, (character) => {\n switch (character) {\n case '\"':\n case \"'\":\n case '\\\\':\n return `\\\\${character}`\n case '\\n':\n return '\\\\n'\n case '\\r':\n return '\\\\r'\n case '\\u2028':\n return '\\\\u2028'\n case '\\u2029':\n return '\\\\u2029'\n default:\n return ''\n }\n })\n}\n\n/**\n * Strips the file extension from a path or file name.\n * Only removes the last `.ext` segment when the dot is not part of a directory name.\n *\n * @example\n * trimExtName('petStore.ts') // 'petStore'\n * trimExtName('/src/models/pet.ts') // '/src/models/pet'\n * trimExtName('/project.v2/gen/pet.ts') // '/project.v2/gen/pet'\n * trimExtName('noExtension') // 'noExtension'\n */\nexport function trimExtName(text: string): string {\n const dotIndex = text.lastIndexOf('.')\n if (dotIndex > 0 && !text.includes('/', dotIndex)) {\n return text.slice(0, dotIndex)\n }\n return text\n}\n","import { trimQuotes } from './string.ts'\n\n/**\n * Serializes a primitive value to a JSON string literal, stripping any surrounding quote characters first.\n *\n * @example\n * stringify('hello') // '\"hello\"'\n * stringify('\"hello\"') // '\"hello\"'\n */\nexport function stringify(value: string | number | boolean | undefined): string {\n if (value === undefined || value === null) return '\"\"'\n return JSON.stringify(trimQuotes(value.toString()))\n}\n\n/**\n * Converts a plain object into a multiline key-value string suitable for embedding in generated code.\n * Nested objects are recursively stringified with indentation.\n *\n * @example\n * stringifyObject({ foo: 'bar', nested: { a: 1 } })\n * // 'foo: bar,\\nnested: {\\n a: 1\\n }'\n */\nexport function stringifyObject(value: Record<string, unknown>): string {\n const items = Object.entries(value)\n .map(([key, val]) => {\n if (val !== null && typeof val === 'object') {\n return `${key}: {\\n ${stringifyObject(val as Record<string, unknown>)}\\n }`\n }\n return `${key}: ${val}`\n })\n .filter(Boolean)\n return items.join(',\\n')\n}\n\n/**\n * Converts a dot-notation path or string array into an optional-chaining accessor expression.\n *\n * @example\n * getNestedAccessor('pagination.next.id', 'lastPage')\n * // → \"lastPage?.['pagination']?.['next']?.['id']\"\n */\nexport function getNestedAccessor(param: string | string[], accessor: string): string | null {\n const parts = Array.isArray(param) ? param : param.split('.')\n if (parts.length === 0 || (parts.length === 1 && parts[0] === '')) return null\n return `${accessor}?.['${`${parts.join(\"']?.['\")}']`}`\n}\n","/**\n * JavaScript and Java reserved words.\n * @link https://github.com/jonschlinkert/reserved/blob/master/index.js\n */\nconst reservedWords = new Set([\n 'abstract',\n 'arguments',\n 'boolean',\n 'break',\n 'byte',\n 'case',\n 'catch',\n 'char',\n 'class',\n 'const',\n 'continue',\n 'debugger',\n 'default',\n 'delete',\n 'do',\n 'double',\n 'else',\n 'enum',\n 'eval',\n 'export',\n 'extends',\n 'false',\n 'final',\n 'finally',\n 'float',\n 'for',\n 'function',\n 'goto',\n 'if',\n 'implements',\n 'import',\n 'in',\n 'instanceof',\n 'int',\n 'interface',\n 'let',\n 'long',\n 'native',\n 'new',\n 'null',\n 'package',\n 'private',\n 'protected',\n 'public',\n 'return',\n 'short',\n 'static',\n 'super',\n 'switch',\n 'synchronized',\n 'this',\n 'throw',\n 'throws',\n 'transient',\n 'true',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'volatile',\n 'while',\n 'with',\n 'yield',\n 'Array',\n 'Date',\n 'hasOwnProperty',\n 'Infinity',\n 'isFinite',\n 'isNaN',\n 'isPrototypeOf',\n 'length',\n 'Math',\n 'name',\n 'NaN',\n 'Number',\n 'Object',\n 'prototype',\n 'String',\n 'toString',\n 'undefined',\n 'valueOf',\n] as const)\n\n/**\n * Returns `true` when `name` is a syntactically valid JavaScript variable name.\n *\n * @example\n * ```ts\n * isValidVarName('status') // true\n * isValidVarName('class') // false (reserved word)\n * isValidVarName('42foo') // false (starts with digit)\n * ```\n */\nexport function isValidVarName(name: string): boolean {\n if (!name || reservedWords.has(name as 'valueOf')) {\n return false\n }\n return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name)\n}\n\n/**\n * Returns `name` when it's a syntactically valid JavaScript variable name,\n * otherwise prefixes it with `_` so the result is a valid identifier.\n *\n * Useful for sanitizing OpenAPI schema names or operation IDs that start with\n * a digit (e.g. `409`, `504AccountCancel`) before using them as exported\n * variable, type, or function names.\n *\n * @example\n * ```ts\n * ensureValidVarName('409') // '_409'\n * ensureValidVarName('504AccountCancel') // '_504AccountCancel'\n * ensureValidVarName('Pet') // 'Pet'\n * ensureValidVarName('class') // '_class'\n * ```\n */\nexport function ensureValidVarName(name: string): string {\n if (!name || isValidVarName(name)) {\n return name\n }\n return `_${name}`\n}\n","import type { PluginTs } from './types.ts'\n\ntype OptionalType = PluginTs['resolvedOptions']['optionalType']\ntype EnumType = PluginTs['resolvedOptions']['enumType']\n\n/**\n * `optionalType` values that cause a property's type to include `| undefined`.\n */\nexport const OPTIONAL_ADDS_UNDEFINED = new Set<OptionalType>(['undefined', 'questionTokenAndUndefined'] as const)\n\n/**\n * `optionalType` values that render the property key with a `?` token.\n */\nexport const OPTIONAL_ADDS_QUESTION_TOKEN = new Set<OptionalType>(['questionToken', 'questionTokenAndUndefined'] as const)\n\n/**\n * `enumType` values that append a `Key` suffix to the generated enum type alias.\n */\nexport const ENUM_TYPES_WITH_KEY_SUFFIX = new Set<EnumType>(['asConst', 'asPascalConst'] as const)\n\n/**\n * `enumType` values that require a runtime value declaration (object, enum, or literal).\n */\nexport const ENUM_TYPES_WITH_RUNTIME_VALUE = new Set<EnumType | undefined>(['enum', 'asConst', 'asPascalConst', 'constEnum', 'literal', undefined] as const)\n\n/**\n * `enumType` values whose type declaration is type-only (no runtime value emitted for the type alias).\n */\nexport const ENUM_TYPES_WITH_TYPE_ONLY = new Set<EnumType | undefined>(['asConst', 'asPascalConst', 'literal', undefined] as const)\n\n/**\n * Ordering priority for function parameters: lower = sorted earlier.\n */\nexport const PARAM_RANK = {\n required: 0,\n optional: 1,\n withDefault: 2,\n rest: 3,\n} as const\n","import { camelCase, pascalCase, screamingSnakeCase, snakeCase } from '@internals/utils'\nimport { ast } from '@kubb/core'\nimport ts from 'typescript'\nimport { OPTIONAL_ADDS_UNDEFINED } from './constants.ts'\n\nconst { SyntaxKind, factory } = ts\n\n/**\n * Compares two strings by UTF-16 code unit, keeping sorted output identical across platforms\n * regardless of locale.\n */\nfunction compareStrings(a: string, b: string): number {\n if (a < b) return -1\n if (a > b) return 1\n return 0\n}\n\nfunction isNumber(value: unknown): value is number {\n return typeof value === 'number' && !Number.isNaN(value)\n}\n\n// https://ts-ast-viewer.com/\n\n/**\n * TypeScript AST modifiers for common keywords (async, export, const, static).\n */\nexport const modifiers = {\n async: factory.createModifier(ts.SyntaxKind.AsyncKeyword),\n export: factory.createModifier(ts.SyntaxKind.ExportKeyword),\n const: factory.createModifier(ts.SyntaxKind.ConstKeyword),\n static: factory.createModifier(ts.SyntaxKind.StaticKeyword),\n} as const\n\n/**\n * TypeScript syntax kind constants for union, literal, and string types.\n */\nexport const syntaxKind = {\n union: SyntaxKind.UnionType as 192,\n literalType: SyntaxKind.LiteralType,\n stringLiteral: SyntaxKind.StringLiteral,\n} as const\n\nfunction isNonNullable<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined\n}\n\nfunction isValidIdentifier(str: string): boolean {\n if (!str.length || str.trim() !== str) {\n return false\n }\n\n // Mirrors `ts.isIdentifierText`, which is not in the public type declarations.\n // Walking by code point with `isIdentifierStart`/`isIdentifierPart` rejects\n // invalid names such as private identifiers (`#FOO`), forcing `propertyName`\n // to quote them.\n let ch = str.codePointAt(0)!\n if (!ts.isIdentifierStart(ch, ts.ScriptTarget.Latest)) {\n return false\n }\n for (let i = ch > 0xffff ? 2 : 1; i < str.length; i += ch > 0xffff ? 2 : 1) {\n ch = str.codePointAt(i)!\n if (!ts.isIdentifierPart(ch, ts.ScriptTarget.Latest)) {\n return false\n }\n }\n return true\n}\n\nfunction propertyName(name: string | ts.PropertyName): ts.PropertyName {\n if (typeof name === 'string') {\n const isValid = isValidIdentifier(name)\n return isValid ? factory.createIdentifier(name) : factory.createStringLiteral(name)\n }\n return name\n}\n\nconst questionToken = factory.createToken(ts.SyntaxKind.QuestionToken)\n\n/**\n * Creates a question token for optional type annotations.\n * Pass `true` to use the cached token, or provide a pre-created token.\n */\nexport function createQuestionToken(token?: boolean | ts.QuestionToken) {\n if (!token) {\n return undefined\n }\n if (token === true) {\n return questionToken\n }\n return token\n}\n\n/**\n * Creates a TypeScript intersection type node from multiple type nodes.\n * Returns the single node if only one is provided, or wraps in parentheses if requested.\n */\nexport function createIntersectionDeclaration({ nodes, withParentheses }: { nodes: Array<ts.TypeNode>; withParentheses?: boolean }): ts.TypeNode | null {\n if (!nodes.length) {\n return null\n }\n\n if (nodes.length === 1) {\n return nodes[0] || null\n }\n\n const node = factory.createIntersectionTypeNode(nodes)\n\n if (withParentheses) {\n return factory.createParenthesizedType(node)\n }\n\n return node\n}\n\n/**\n * Creates a TypeScript array type node.\n * Use `arrayType: 'array'` for bracket syntax (`T[]`), or `'generic'` for `Array<T>`.\n *\n * @example Array bracket syntax\n * `createArrayDeclaration({ nodes: [stringType], arrayType: 'array' }) // → string[]`\n *\n * @example Generic Array syntax\n * `createArrayDeclaration({ nodes: [stringType], arrayType: 'generic' }) // → Array<string>`\n */\nexport function createArrayDeclaration({ nodes, arrayType = 'array' }: { nodes: Array<ts.TypeNode>; arrayType?: 'array' | 'generic' }): ts.TypeNode | null {\n if (!nodes.length) {\n return factory.createTupleTypeNode([])\n }\n\n if (nodes.length === 1) {\n const node = nodes[0]\n if (!node) {\n return null\n }\n if (arrayType === 'generic') {\n return factory.createTypeReferenceNode(factory.createIdentifier('Array'), [node])\n }\n return factory.createArrayTypeNode(node)\n }\n\n // For union types (multiple nodes), respect arrayType preference\n const unionType = factory.createUnionTypeNode(nodes)\n if (arrayType === 'generic') {\n return factory.createTypeReferenceNode(factory.createIdentifier('Array'), [unionType])\n }\n // For array syntax with unions, we need parentheses: (string | number)[]\n return factory.createArrayTypeNode(factory.createParenthesizedType(unionType))\n}\n\n/**\n * Minimum nodes length of 2\n * @example Union type example\n * `string | number`\n */\nexport function createUnionDeclaration({ nodes, withParentheses }: { nodes: Array<ts.TypeNode>; withParentheses?: boolean }): ts.TypeNode {\n if (!nodes.length) {\n return keywordTypeNodes.any\n }\n\n if (nodes.length === 1) {\n return nodes[0] as ts.TypeNode\n }\n\n const node = factory.createUnionTypeNode(nodes)\n\n if (withParentheses) {\n return factory.createParenthesizedType(node)\n }\n\n return node\n}\n\n/**\n * Creates a TypeScript property signature for object/interface members.\n * Supports optional markers, readonly modifiers, and type annotations.\n */\nexport function createPropertySignature({\n readOnly,\n modifiers = [],\n name,\n questionToken,\n type,\n}: {\n readOnly?: boolean\n modifiers?: Array<ts.Modifier>\n name: ts.PropertyName | string\n questionToken?: ts.QuestionToken | boolean\n type?: ts.TypeNode\n}) {\n return factory.createPropertySignature(\n [...modifiers, readOnly ? factory.createToken(ts.SyntaxKind.ReadonlyKeyword) : undefined].filter(\n (modifier): modifier is ts.Modifier => modifier !== undefined,\n ),\n propertyName(name),\n createQuestionToken(questionToken),\n type,\n )\n}\n\n/**\n * Creates a function parameter declaration with optional markers, rest parameters, and type annotations.\n */\nexport function createParameterSignature(\n name: string | ts.BindingName,\n {\n modifiers,\n dotDotDotToken,\n questionToken,\n type,\n initializer,\n }: {\n decorators?: Array<ts.Decorator>\n modifiers?: Array<ts.Modifier>\n dotDotDotToken?: ts.DotDotDotToken\n questionToken?: ts.QuestionToken | boolean\n type?: ts.TypeNode\n initializer?: ts.Expression\n },\n): ts.ParameterDeclaration {\n return factory.createParameterDeclaration(modifiers, dotDotDotToken, name, createQuestionToken(questionToken), type, initializer)\n}\n\n/**\n * Creates a JSDoc comment node from an array of comment strings.\n * Returns null if no comments are provided.\n */\nexport function createJSDoc({ comments }: { comments: Array<string> }) {\n if (!comments.length) {\n return null\n }\n return factory.createJSDocComment(\n factory.createNodeArray(\n comments.map((comment, i) => {\n if (i === comments.length - 1) {\n return factory.createJSDocText(comment)\n }\n\n return factory.createJSDocText(`${comment}\\n`)\n }),\n ),\n )\n}\n\n/**\n * Attaches JSDoc comments to an AST node as synthetic leading comments.\n * Filters out undefined comments before attaching.\n *\n * @see https://github.com/microsoft/TypeScript/issues/44151\n */\nexport function appendJSDocToNode<TNode extends ts.Node>({ node, comments }: { node: TNode; comments: Array<string | undefined> }) {\n const filteredComments = comments.filter(Boolean)\n\n if (!filteredComments.length) {\n return node\n }\n\n const text = filteredComments.reduce((acc = '', comment = '') => {\n return `${acc}\\n * ${comment.replaceAll('*/', '*\\\\/')}`\n }, '*')\n\n // Use the node directly instead of spreading to avoid creating Unknown nodes\n // TypeScript's addSyntheticLeadingComment accepts the node as-is\n return ts.addSyntheticLeadingComment(node, ts.SyntaxKind.MultiLineCommentTrivia, `${text || '*'}\\n`, true)\n}\n\n/**\n * Creates a TypeScript index signature for dynamic property access.\n * Defines the key type (default: `string`) and value type on an object.\n */\nexport function createIndexSignature(\n type: ts.TypeNode,\n {\n modifiers,\n indexName = 'key',\n indexType = factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),\n }: {\n indexName?: string\n indexType?: ts.TypeNode\n decorators?: Array<ts.Decorator>\n modifiers?: Array<ts.Modifier>\n } = {},\n) {\n return factory.createIndexSignature(modifiers, [createParameterSignature(indexName, { type: indexType })], type)\n}\n\n/**\n * Creates a TypeScript type alias declaration with optional modifiers and type parameters.\n */\nexport function createTypeAliasDeclaration({\n modifiers,\n name,\n typeParameters,\n type,\n}: {\n modifiers?: Array<ts.Modifier>\n name: string | ts.Identifier\n typeParameters?: Array<ts.TypeParameterDeclaration>\n type: ts.TypeNode\n}) {\n return factory.createTypeAliasDeclaration(modifiers, name, typeParameters, type)\n}\n\n/**\n * Creates a TypeScript interface declaration with optional modifiers, type parameters, and members.\n */\nexport function createInterfaceDeclaration({\n modifiers,\n name,\n typeParameters,\n members,\n}: {\n modifiers?: Array<ts.Modifier>\n name: string | ts.Identifier\n typeParameters?: Array<ts.TypeParameterDeclaration>\n members: Array<ts.TypeElement>\n}) {\n return factory.createInterfaceDeclaration(modifiers, name, typeParameters, undefined, members)\n}\n\n/**\n * Creates a TypeScript type declaration as either a type alias or interface.\n * Intelligently selects the syntax based on the type structure and attaches JSDoc comments.\n */\nexport function createTypeDeclaration({\n syntax,\n isExportable,\n comments,\n name,\n type,\n}: {\n syntax: 'type' | 'interface'\n comments: Array<string | undefined>\n isExportable?: boolean\n name: string | ts.Identifier\n type: ts.TypeNode\n}) {\n if (syntax === 'interface' && 'members' in type) {\n const node = createInterfaceDeclaration({\n members: [...(type as ts.TypeLiteralNode).members],\n modifiers: isExportable ? [modifiers.export] : [],\n name,\n typeParameters: undefined,\n })\n\n return appendJSDocToNode({\n node,\n comments,\n })\n }\n\n const node = createTypeAliasDeclaration({\n type,\n modifiers: isExportable ? [modifiers.export] : [],\n name,\n typeParameters: undefined,\n })\n\n return appendJSDocToNode({\n node,\n comments,\n })\n}\n\n/**\n * Creates a TypeScript namespace declaration (exported module).\n */\nexport function createNamespaceDeclaration({ statements, name }: { name: string; statements: Array<ts.Statement> }) {\n return factory.createModuleDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createIdentifier(name),\n factory.createModuleBlock(statements),\n ts.NodeFlags.Namespace,\n )\n}\n\n/**\n * Creates an import declaration with support for default imports, named imports, namespace imports, and type-only imports.\n * Optionally rename imported members with `propertyName` and `name` pairs.\n *\n * @example Default import\n * `import Pet from './Pet'`\n *\n * @example Named imports with rename\n * `import { Pet as Cat } from './Pet'`\n *\n * @example Namespace import\n * `import * as Pet from './Pet'`\n */\nexport function createImportDeclaration({\n name,\n path,\n isTypeOnly = false,\n isNameSpace = false,\n}: {\n name: string | Array<string | { propertyName: string; name?: string }>\n path: string\n isTypeOnly?: boolean\n isNameSpace?: boolean\n}) {\n if (!Array.isArray(name)) {\n const importPropertyName = isNameSpace ? undefined : factory.createIdentifier(name)\n const importName = isNameSpace ? factory.createNamespaceImport(factory.createIdentifier(name)) : undefined\n\n return factory.createImportDeclaration(\n undefined,\n factory.createImportClause(isTypeOnly, importPropertyName, importName),\n factory.createStringLiteral(path),\n undefined,\n )\n }\n\n // Sort the imports alphabetically for consistent output across platforms\n const sortedName = name.toSorted((a, b) => compareStrings(typeof a === 'object' ? a.propertyName : a, typeof b === 'object' ? b.propertyName : b))\n\n return factory.createImportDeclaration(\n undefined,\n factory.createImportClause(\n isTypeOnly,\n undefined,\n factory.createNamedImports(\n sortedName.map((item) => {\n if (typeof item === 'object') {\n const obj = item as { propertyName: string; name?: string }\n if (obj.name) {\n return factory.createImportSpecifier(false, factory.createIdentifier(obj.propertyName), factory.createIdentifier(obj.name))\n }\n\n return factory.createImportSpecifier(false, undefined, factory.createIdentifier(obj.propertyName))\n }\n\n return factory.createImportSpecifier(false, undefined, factory.createIdentifier(item))\n }),\n ),\n ),\n factory.createStringLiteral(path),\n undefined,\n )\n}\n\n/**\n * Creates an export declaration with support for named exports, namespace exports, and type-only exports.\n * Sorts export names alphabetically for consistent output across platforms.\n */\nexport function createExportDeclaration({\n path,\n asAlias,\n isTypeOnly = false,\n name,\n}: {\n path: string\n asAlias?: boolean\n isTypeOnly?: boolean\n name?: string | Array<ts.Identifier | string>\n}) {\n if (name && !Array.isArray(name) && !asAlias) {\n console.warn(`When using name as string, asAlias should be true ${name}`)\n }\n\n if (!Array.isArray(name)) {\n const parsedName = name?.match(/^\\d/) ? `_${name?.slice(1)}` : name\n\n return factory.createExportDeclaration(\n undefined,\n isTypeOnly,\n asAlias && parsedName ? factory.createNamespaceExport(factory.createIdentifier(parsedName)) : undefined,\n factory.createStringLiteral(path),\n undefined,\n )\n }\n\n // Sort the exports alphabetically for consistent output across platforms\n const sortedName = name.toSorted((a, b) => compareStrings(typeof a === 'string' ? a : a.text, typeof b === 'string' ? b : b.text))\n\n return factory.createExportDeclaration(\n undefined,\n isTypeOnly,\n factory.createNamedExports(\n sortedName.map((propertyName) => {\n return factory.createExportSpecifier(false, undefined, typeof propertyName === 'string' ? factory.createIdentifier(propertyName) : propertyName)\n }),\n ),\n factory.createStringLiteral(path),\n undefined,\n )\n}\n\n/**\n * Apply casing transformation to enum keys\n */\nfunction applyEnumKeyCasing(key: string, casing: 'screamingSnakeCase' | 'snakeCase' | 'pascalCase' | 'camelCase' | 'none' = 'none'): string {\n if (casing === 'none') {\n return key\n }\n if (casing === 'screamingSnakeCase') {\n return screamingSnakeCase(key)\n }\n if (casing === 'snakeCase') {\n return snakeCase(key)\n }\n if (casing === 'pascalCase') {\n return pascalCase(key)\n }\n if (casing === 'camelCase') {\n return camelCase(key)\n }\n return key\n}\n\n/**\n * Creates a TypeScript enum declaration or equivalent construct in various formats.\n * Returns a tuple of [name node, type node] - name node may be undefined for certain types.\n *\n * @example\n * ```ts\n * const [name, type] = createEnumDeclaration({\n * type: 'enum',\n * name: 'petType',\n * typeName: 'PetType',\n * enums: [['cat', 'cat'], ['dog', 'dog']],\n * })\n * ```\n */\nexport function createEnumDeclaration({\n type = 'enum',\n name,\n typeName,\n enums,\n enumKeyCasing = 'none',\n}: {\n /**\n * Choose to use `enum`, `asConst`, `asPascalConst`, `constEnum`, or `literal` for enums.\n * - `enum`: TypeScript enum\n * - `asConst`: const with camelCase name (e.g., `petType`)\n * - `asPascalConst`: const with PascalCase name (e.g., `PetType`)\n * - `constEnum`: const enum\n * - `literal`: literal union type\n * @default `'enum'`\n */\n type?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal' | 'inlineLiteral'\n /**\n * Enum name in camelCase.\n */\n name: string\n /**\n * Enum name in PascalCase.\n */\n typeName: string\n enums: Array<[key: string | number, value: string | number | boolean]>\n /**\n * Choose the casing for enum key names.\n * @default 'none'\n */\n enumKeyCasing?: 'screamingSnakeCase' | 'snakeCase' | 'pascalCase' | 'camelCase' | 'none'\n}): [name: ts.Node | undefined, type: ts.Node] {\n if (type === 'literal' || type === 'inlineLiteral') {\n return [\n undefined,\n factory.createTypeAliasDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createIdentifier(typeName),\n undefined,\n factory.createUnionTypeNode(\n enums\n .map(([_key, value]) => {\n if (isNumber(value)) {\n if (value < 0) {\n return factory.createLiteralTypeNode(\n factory.createPrefixUnaryExpression(ts.SyntaxKind.MinusToken, factory.createNumericLiteral(Math.abs(value))),\n )\n }\n return factory.createLiteralTypeNode(factory.createNumericLiteral(value?.toString()))\n }\n\n if (typeof value === 'boolean') {\n return factory.createLiteralTypeNode(value ? factory.createTrue() : factory.createFalse())\n }\n if (value) {\n return factory.createLiteralTypeNode(factory.createStringLiteral(value.toString()))\n }\n\n return undefined\n })\n .filter((node): node is ts.LiteralTypeNode => node !== undefined),\n ),\n ),\n ]\n }\n\n if (type === 'enum' || type === 'constEnum') {\n return [\n undefined,\n factory.createEnumDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword), type === 'constEnum' ? factory.createToken(ts.SyntaxKind.ConstKeyword) : undefined].filter(\n (modifier): modifier is ts.ModifierToken<ts.SyntaxKind.ExportKeyword> | ts.ModifierToken<ts.SyntaxKind.ConstKeyword> => modifier !== undefined,\n ),\n factory.createIdentifier(typeName),\n enums\n .map(([key, value]) => {\n let initializer: ts.Expression = factory.createStringLiteral(value?.toString())\n const isExactNumber = Number.parseInt(value.toString(), 10) === value\n\n if (isExactNumber && isNumber(Number.parseInt(value.toString(), 10))) {\n if ((value as number) < 0) {\n initializer = factory.createPrefixUnaryExpression(ts.SyntaxKind.MinusToken, factory.createNumericLiteral(Math.abs(value as number)))\n } else {\n initializer = factory.createNumericLiteral(value as number)\n }\n }\n\n if (typeof value === 'boolean') {\n initializer = value ? factory.createTrue() : factory.createFalse()\n }\n\n if (isNumber(Number.parseInt(key.toString(), 10))) {\n const casingKey = applyEnumKeyCasing(`${typeName}_${key}`, enumKeyCasing)\n return factory.createEnumMember(propertyName(casingKey), initializer)\n }\n\n if (key) {\n const casingKey = applyEnumKeyCasing(key.toString(), enumKeyCasing)\n return factory.createEnumMember(propertyName(casingKey), initializer)\n }\n\n return undefined\n })\n .filter((member): member is ts.EnumMember => member !== undefined),\n ),\n ]\n }\n\n // used when using `as const` instead of an TypeScript enum.\n // name is already PascalCase for asPascalConst and camelCase for asConst (set in Type.tsx)\n // typeName has the Key suffix for type alias, so we use name for the const identifier\n const identifierName = name\n\n // When there are no enum items (empty or all-null enum), don't generate a runtime const.\n // Return undefined for nameNode so the barrel won't try to export a non-existent symbol.\n // Use `never` as the type alias to keep references valid without creating a broken const.\n if (enums.length === 0) {\n return [\n undefined,\n factory.createTypeAliasDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createIdentifier(typeName),\n undefined,\n factory.createKeywordTypeNode(ts.SyntaxKind.NeverKeyword),\n ),\n ]\n }\n\n return [\n factory.createVariableStatement(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createVariableDeclarationList(\n [\n factory.createVariableDeclaration(\n factory.createIdentifier(identifierName),\n undefined,\n undefined,\n factory.createAsExpression(\n factory.createObjectLiteralExpression(\n enums\n .map(([key, value]) => {\n let initializer: ts.Expression = factory.createStringLiteral(value?.toString())\n\n if (isNumber(value)) {\n // Error: Negative numbers should be created in combination with createPrefixUnaryExpression factory.\n // The method createNumericLiteral only accepts positive numbers\n // or those combined with createPrefixUnaryExpression.\n // Therefore, we need to ensure that the number is not negative.\n if (value < 0) {\n initializer = factory.createPrefixUnaryExpression(ts.SyntaxKind.MinusToken, factory.createNumericLiteral(Math.abs(value)))\n } else {\n initializer = factory.createNumericLiteral(value)\n }\n }\n\n if (typeof value === 'boolean') {\n initializer = value ? factory.createTrue() : factory.createFalse()\n }\n\n if (key) {\n const casingKey = applyEnumKeyCasing(key.toString(), enumKeyCasing)\n return factory.createPropertyAssignment(propertyName(casingKey), initializer)\n }\n\n return undefined\n })\n .filter((property): property is ts.PropertyAssignment => property !== undefined),\n true,\n ),\n factory.createTypeReferenceNode(factory.createIdentifier('const'), undefined),\n ),\n ),\n ],\n ts.NodeFlags.Const,\n ),\n ),\n factory.createTypeAliasDeclaration(\n [factory.createToken(ts.SyntaxKind.ExportKeyword)],\n factory.createIdentifier(typeName),\n undefined,\n factory.createIndexedAccessTypeNode(\n factory.createParenthesizedType(factory.createTypeQueryNode(factory.createIdentifier(identifierName), undefined)),\n factory.createTypeOperatorNode(ts.SyntaxKind.KeyOfKeyword, factory.createTypeQueryNode(factory.createIdentifier(identifierName), undefined)),\n ),\n ),\n ]\n}\n\n/**\n * Creates a TypeScript `Omit<T, Keys>` type reference node.\n * Optionally wraps the type in `NonNullable<T>` if `nonNullable` is true.\n */\nexport function createOmitDeclaration({ keys, type, nonNullable }: { keys: Array<string> | string; type: ts.TypeNode; nonNullable?: boolean }) {\n const node = nonNullable ? factory.createTypeReferenceNode(factory.createIdentifier('NonNullable'), [type]) : type\n\n if (Array.isArray(keys)) {\n return factory.createTypeReferenceNode(factory.createIdentifier('Omit'), [\n node,\n factory.createUnionTypeNode(\n keys.map((key) => {\n return factory.createLiteralTypeNode(factory.createStringLiteral(key))\n }),\n ),\n ])\n }\n\n return factory.createTypeReferenceNode(factory.createIdentifier('Omit'), [node, factory.createLiteralTypeNode(factory.createStringLiteral(keys))])\n}\n\n/**\n * Pre-built TypeScript keyword type nodes for common primitive types.\n * Use these to avoid repeatedly creating the same type nodes.\n */\nexport const keywordTypeNodes = {\n any: factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword),\n unknown: factory.createKeywordTypeNode(ts.SyntaxKind.UnknownKeyword),\n void: factory.createKeywordTypeNode(ts.SyntaxKind.VoidKeyword),\n number: factory.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword),\n integer: factory.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword),\n bigint: factory.createKeywordTypeNode(ts.SyntaxKind.BigIntKeyword),\n object: factory.createKeywordTypeNode(ts.SyntaxKind.ObjectKeyword),\n string: factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),\n boolean: factory.createKeywordTypeNode(ts.SyntaxKind.BooleanKeyword),\n undefined: factory.createKeywordTypeNode(ts.SyntaxKind.UndefinedKeyword),\n null: factory.createLiteralTypeNode(factory.createToken(ts.SyntaxKind.NullKeyword)),\n never: factory.createKeywordTypeNode(ts.SyntaxKind.NeverKeyword),\n} as const\n\n/**\n * Converts a path like '/pet/{petId}/uploadImage' to a template literal type\n * like `/pet/${string}/uploadImage`\n */\n/**\n * Converts an OAS-style path (e.g. `/pets/{petId}`) or an Express-style path\n * (e.g. `/pets/:petId`) to a TypeScript template literal type\n * like `` `/pets/${string}` ``.\n */\nexport function createUrlTemplateType(path: string): ts.TypeNode {\n // normalized Express `:param` → OAS `{param}` so a single regex handles both.\n const normalized = path.replace(/:([^/]+)/g, '{$1}')\n\n if (!normalized.includes('{')) {\n return factory.createLiteralTypeNode(factory.createStringLiteral(normalized))\n }\n\n const segments = normalized.split(/(\\{[^}]+\\})/)\n const parts: Array<string> = []\n const parameterIndices: Array<number> = []\n\n segments.forEach((segment) => {\n if (segment.startsWith('{') && segment.endsWith('}')) {\n parameterIndices.push(parts.length)\n parts.push(segment)\n } else if (segment) {\n parts.push(segment)\n }\n })\n\n const head = ts.factory.createTemplateHead(parts[0] || '')\n const templateSpans: Array<ts.TemplateLiteralTypeSpan> = []\n\n parameterIndices.forEach((paramIndex, i) => {\n const isLast = i === parameterIndices.length - 1\n const nextPart = parts[paramIndex + 1] || ''\n const literal = isLast ? ts.factory.createTemplateTail(nextPart) : ts.factory.createTemplateMiddle(nextPart)\n templateSpans.push(ts.factory.createTemplateLiteralTypeSpan(keywordTypeNodes.string, literal))\n })\n\n return ts.factory.createTemplateLiteralType(head, templateSpans)\n}\n\n/**\n * Creates a TypeScript type literal node (anonymous object type).\n */\nexport const createTypeLiteralNode = factory.createTypeLiteralNode\n\n/**\n * Creates a TypeScript type reference node (e.g., `Array<string>`, `Record<K, V>`).\n */\nexport const createTypeReferenceNode = factory.createTypeReferenceNode\n\n/**\n * Creates a numeric literal type node.\n */\nexport const createNumericLiteral = factory.createNumericLiteral\n\n/**\n * Creates a string literal type node.\n */\nexport const createStringLiteral = factory.createStringLiteral\n\n/**\n * Creates an array type node (e.g., `T[]`).\n */\nexport const createArrayTypeNode = factory.createArrayTypeNode\n\n/**\n * Creates a parenthesized type node to control operator precedence.\n */\nexport const createParenthesizedType = factory.createParenthesizedType\n\n/**\n * Creates a literal type node (e.g., `'hello'`, `42`, `true`).\n */\nexport const createLiteralTypeNode = factory.createLiteralTypeNode\n\n/**\n * Creates a null literal type node.\n */\nexport const createNull = factory.createNull\n\n/**\n * Creates an identifier node.\n */\nexport const createIdentifier = factory.createIdentifier\n\n/**\n * Creates an optional type node (e.g., `T | undefined`).\n */\nexport const createOptionalTypeNode = factory.createOptionalTypeNode\n\n/**\n * Creates a tuple type node (e.g., `[string, number]`).\n */\nexport const createTupleTypeNode = factory.createTupleTypeNode\n\n/**\n * Creates a rest type node for variadic tuple elements (e.g., `...T[]`).\n */\nexport const createRestTypeNode = factory.createRestTypeNode\n\n/**\n * Creates a boolean true literal type node.\n */\nexport const createTrue = factory.createTrue\n\n/**\n * Creates a boolean false literal type node.\n */\nexport const createFalse = factory.createFalse\n\n/**\n * Creates an indexed access type node (e.g., `T[K]`).\n */\nexport const createIndexedAccessTypeNode = factory.createIndexedAccessTypeNode\n\n/**\n * Creates a type operator node (e.g., `keyof T`, `readonly T[]`).\n */\nexport const createTypeOperatorNode = factory.createTypeOperatorNode\n\n/**\n * Creates a prefix unary expression (e.g., negative numbers, logical not).\n */\nexport const createPrefixUnaryExpression = factory.createPrefixUnaryExpression\n\n/**\n * Exports TypeScript SyntaxKind enum for AST node type checking.\n */\nexport { SyntaxKind }\n\n// ─── Printer helpers ──────────────────────────────────────────────────────────\n\n/**\n * Converts a primitive const value to a TypeScript literal type node.\n * Handles negative numbers via a prefix unary expression.\n */\nexport function constToTypeNode(value: string | number | boolean, format: 'string' | 'number' | 'boolean'): ts.TypeNode | undefined {\n if (format === 'boolean') {\n return createLiteralTypeNode(value === true ? createTrue() : createFalse())\n }\n if (format === 'number' && typeof value === 'number') {\n if (value < 0) {\n return createLiteralTypeNode(createPrefixUnaryExpression(SyntaxKind.MinusToken, createNumericLiteral(Math.abs(value))))\n }\n return createLiteralTypeNode(createNumericLiteral(value))\n }\n return createLiteralTypeNode(createStringLiteral(String(value)))\n}\n\n/**\n * Returns a `Date` reference type node when `representation` is `'date'`, otherwise falls back to `string`.\n */\nexport function dateOrStringNode(node: { representation?: string }): ts.TypeNode {\n return node.representation === 'date' ? createTypeReferenceNode(createIdentifier('Date')) : keywordTypeNodes.string\n}\n\n/**\n * Maps an array of `SchemaNode`s through the printer, filtering out `null` and `undefined` results.\n */\nexport function buildMemberNodes(\n members: Array<ast.SchemaNode> | undefined,\n print: (node: ast.SchemaNode) => ts.TypeNode | null | undefined,\n): Array<ts.TypeNode> {\n return (members ?? []).map(print).filter(isNonNullable)\n}\n\n/**\n * Builds a TypeScript tuple type node from an array schema's `items`,\n * applying min/max slice and optional/rest element rules.\n */\nexport function buildTupleNode(node: ast.ArraySchemaNode, print: (node: ast.SchemaNode) => ts.TypeNode | null | undefined): ts.TypeNode | undefined {\n let items = (node.items ?? []).map(print).filter(isNonNullable)\n\n const restNode = node.rest ? (print(node.rest) ?? undefined) : undefined\n const { min, max } = node\n\n if (max !== undefined) {\n items = items.slice(0, max)\n if (items.length < max && restNode) {\n items = [...items, ...Array(max - items.length).fill(restNode)]\n }\n }\n\n if (min !== undefined) {\n items = items.map((item, i) => (i >= min ? createOptionalTypeNode(item) : item))\n }\n\n if (max === undefined && restNode) {\n items.push(createRestTypeNode(createArrayTypeNode(restNode)))\n }\n\n return createTupleTypeNode(items)\n}\n\n/**\n * Applies `nullable` and optional/nullish `| undefined` union modifiers to a property's resolved base type.\n */\nexport function buildPropertyType(\n schema: ast.SchemaNode,\n baseType: ts.TypeNode,\n optionalType: 'questionToken' | 'undefined' | 'questionTokenAndUndefined',\n): ts.TypeNode {\n const addsUndefined = OPTIONAL_ADDS_UNDEFINED.has(optionalType)\n const meta = ast.syncSchemaRef(schema)\n\n let type = baseType\n\n if (meta.nullable) {\n type = createUnionDeclaration({ nodes: [type, keywordTypeNodes.null] })\n }\n\n if ((meta.nullish || meta.optional) && addsUndefined) {\n type = createUnionDeclaration({ nodes: [type, keywordTypeNodes.undefined] })\n }\n\n return type\n}\n\n/**\n * Creates TypeScript index signatures for `additionalProperties` and `patternProperties` on an object schema node.\n */\nexport function buildIndexSignatures(\n node: { additionalProperties?: ast.SchemaNode | boolean; patternProperties?: Record<string, ast.SchemaNode> },\n propertyCount: number,\n print: (node: ast.SchemaNode) => ts.TypeNode | null | undefined,\n): Array<ts.TypeElement> {\n const elements: Array<ts.TypeElement> = []\n\n if (node.additionalProperties && node.additionalProperties !== true) {\n const additionalType = print(node.additionalProperties) ?? keywordTypeNodes.unknown\n\n elements.push(createIndexSignature(propertyCount > 0 ? keywordTypeNodes.unknown : additionalType))\n } else if (node.additionalProperties === true) {\n elements.push(createIndexSignature(keywordTypeNodes.unknown))\n }\n\n if (node.patternProperties) {\n const first = Object.values(node.patternProperties)[0]\n if (first) {\n let patternType = print(first) ?? keywordTypeNodes.unknown\n\n if (first.nullable) {\n patternType = createUnionDeclaration({ nodes: [patternType, keywordTypeNodes.null] })\n }\n elements.push(createIndexSignature(patternType))\n }\n }\n\n return elements\n}\n","import { camelCase, trimQuotes } from '@internals/utils'\nimport type { ast } from '@kubb/core'\nimport { parserTs } from '@kubb/parser-ts'\nimport { File } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX, ENUM_TYPES_WITH_RUNTIME_VALUE, ENUM_TYPES_WITH_TYPE_ONLY } from '../constants.ts'\nimport * as factory from '../factory.ts'\nimport type { PluginTs, ResolverTs } from '../types.ts'\n\ntype Props = {\n node: ast.EnumSchemaNode\n enumType: PluginTs['resolvedOptions']['enumType']\n enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix']\n enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing']\n resolver: ResolverTs\n key?: string | number | null\n}\n\n/**\n * Resolves the runtime identifier name and the TypeScript type name for an enum schema node.\n *\n * The raw `node.name` may be a YAML key such as `\"enumNames.Type\"` which is not a\n * valid TypeScript identifier. The resolver normalizes it; for inline enum\n * properties the adapter already emits a PascalCase+suffix name so resolution is typically a no-op.\n */\nexport function getEnumNames({\n node,\n enumType,\n enumTypeSuffix,\n resolver,\n}: {\n node: ast.EnumSchemaNode\n enumType: PluginTs['resolvedOptions']['enumType']\n enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix']\n resolver: ResolverTs\n}): {\n enumName: string\n typeName: string\n} {\n const resolved = resolver.default(node.name!, 'type')\n const enumName = enumType === 'asPascalConst' ? resolved : camelCase(node.name!)\n const typeName = ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) ? resolver.resolveEnumKeyName(node, enumTypeSuffix) : resolved\n\n return { enumName, typeName }\n}\n\n/**\n * Renders the enum declaration(s) for a single named `EnumSchemaNode`.\n *\n * Depending on `enumType` this may emit:\n * - A runtime object (`asConst` / `asPascalConst`) plus a `typeof` type alias\n * - A `const enum` or plain `enum` declaration (`constEnum` / `enum`)\n * - A union literal type alias (`literal`)\n *\n * The emitted `File.Source` nodes carry the resolved names so that the barrel\n * index picks up the correct export identifiers.\n */\nexport function Enum({ node, enumType, enumTypeSuffix, enumKeyCasing, resolver }: Props): KubbReactNode {\n const { enumName, typeName } = getEnumNames({ node, enumType, enumTypeSuffix, resolver })\n\n const [nameNode, typeNode] = factory.createEnumDeclaration({\n name: enumName,\n typeName,\n enums: (node.namedEnumValues?.map((v) => [trimQuotes(v.name.toString()), v.value]) ??\n node.enumValues?.filter((v): v is NonNullable<typeof v> => v !== null && v !== undefined).map((v) => [trimQuotes(v.toString()), v]) ??\n []) as Array<[string | number, string | number | boolean]>,\n type: enumType,\n enumKeyCasing,\n })\n\n return (\n <>\n {nameNode && (\n <File.Source name={enumName} isExportable isIndexable isTypeOnly={false}>\n {parserTs.print(nameNode)}\n </File.Source>\n )}\n <File.Source name={typeName} isIndexable isExportable={ENUM_TYPES_WITH_RUNTIME_VALUE.has(enumType)} isTypeOnly={ENUM_TYPES_WITH_TYPE_ONLY.has(enumType)}>\n {parserTs.print(typeNode)}\n </File.Source>\n </>\n )\n}\n","import { ast } from '@kubb/core'\nimport { File } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport type { PrinterTsFactory } from '../printers/printerTs.ts'\nimport type { PluginTs, ResolverTs } from '../types.ts'\nimport { Enum, getEnumNames } from './Enum.tsx'\n\ntype Props = {\n name: string\n node: ast.SchemaNode\n /**\n * Pre-configured printer instance created by the generator.\n * Created with `printerTs({ ..., nodes: options.printer?.nodes })`.\n */\n printer: ast.Printer<PrinterTsFactory>\n enumType: PluginTs['resolvedOptions']['enumType']\n enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix']\n enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing']\n resolver: ResolverTs\n}\n\nexport function Type({ name, node, printer, enumType, enumTypeSuffix, enumKeyCasing, resolver }: Props): KubbReactNode {\n const enumSchemaNodes = ast.collect<ast.EnumSchemaNode>(node, {\n schema(n): ast.EnumSchemaNode | undefined {\n const enumNode = ast.narrowSchema(n, ast.schemaTypes.enum)\n if (enumNode?.name) return enumNode\n },\n })\n\n const output = printer.print(node)\n\n if (!output) {\n return\n }\n\n const enums = [...new Map(enumSchemaNodes.map((n) => [n.name, n])).values()].map((node) => {\n return {\n node,\n ...getEnumNames({ node, enumType, enumTypeSuffix, resolver }),\n }\n })\n\n // Skip enum exports when using inlineLiteral\n const shouldExportEnums = enumType !== 'inlineLiteral'\n const shouldExportType = enumType === 'inlineLiteral' || enums.every((item) => item.typeName !== name)\n\n return (\n <>\n {shouldExportEnums &&\n enums.map(({ node }) => (\n <Enum key={node.name} node={node} enumType={enumType} enumTypeSuffix={enumTypeSuffix} enumKeyCasing={enumKeyCasing} resolver={resolver} />\n ))}\n {shouldExportType && (\n <File.Source name={name} isTypeOnly isExportable isIndexable>\n {output}\n </File.Source>\n )}\n </>\n )\n}\n","import { URLPath } from '@internals/utils'\nimport { ast, type ResolverFileParams } from '@kubb/core'\n\n/**\n * Builds the `ResolverFileParams` every operation generator passes to\n * `resolver.resolveFile`: a file named `name`, tagged by the operation's first\n * tag (or `'default'`), at the operation's path. Centralizes the entry object\n * that was repeated at dozens of call sites across the client and query plugins.\n *\n * @example\n * ```ts\n * resolver.resolveFile(operationFileEntry(node, node.operationId), { root, output, group })\n * ```\n */\nexport function operationFileEntry(node: ast.OperationNode, name: string, extname: ResolverFileParams['extname'] = '.ts'): ResolverFileParams {\n return {\n name,\n extname,\n tag: node.tags[0] ?? 'default',\n path: node.path,\n }\n}\n\nexport type ContentTypeInfo = {\n contentTypes: string[]\n isMultipleContentTypes: boolean\n contentTypeUnion: string\n defaultContentType: string\n hasFormData: boolean\n}\n\nexport type RequestConfigResolver = {\n resolveDataName(node: ast.OperationNode): string\n}\n\nexport type ResponseStatusNameResolver = {\n resolveResponseStatusName(node: ast.OperationNode, statusCode: ast.StatusCode): string\n}\n\nexport type ResponseNameResolver = ResponseStatusNameResolver & {\n resolveResponseName(node: ast.OperationNode): string\n}\n\nexport type OperationTypeNameResolver = RequestConfigResolver &\n ResponseNameResolver & {\n resolvePathParamsName(node: ast.OperationNode, param: ast.ParameterNode): string\n resolveQueryParamsName(node: ast.OperationNode, param: ast.ParameterNode): string\n resolveHeaderParamsName(node: ast.OperationNode, param: ast.ParameterNode): string\n }\n\nexport type OperationCommentLink = 'pathTemplate' | 'urlPath' | false | ((node: ast.OperationNode) => string | undefined)\n\nexport type BuildOperationCommentsOptions = {\n link?: OperationCommentLink\n linkPosition?: 'beforeDeprecated' | 'afterDeprecated'\n splitLines?: boolean\n}\n\ntype ResponseLike = {\n statusCode: ast.StatusCode | number | string\n}\n\nexport type OperationParameterGroups = Record<ast.ParameterNode['in'], Array<ast.ParameterNode>>\n\nexport type ResolveOperationTypeNameOptions = {\n paramsCasing?: 'camelcase'\n responseStatusNames?: boolean | 'error'\n exclude?: ReadonlyArray<string | undefined>\n order?: 'params-first' | 'body-response-first'\n}\n\nfunction getOperationLink(node: ast.OperationNode, link: OperationCommentLink): string | null {\n if (!link) {\n return null\n }\n\n if (typeof link === 'function') {\n return link(node) ?? null\n }\n\n if (link === 'urlPath') {\n return node.path ? `{@link ${new URLPath(node.path).URL}}` : null\n }\n\n return node.path ? `{@link ${node.path.replaceAll('{', ':').replaceAll('}', '')}}` : null\n}\n\nexport function getContentTypeInfo(node: ast.OperationNode): ContentTypeInfo {\n const contentTypes = node.requestBody?.content?.map((e) => e.contentType) ?? []\n const isMultipleContentTypes = contentTypes.length > 1\n\n return {\n contentTypes,\n isMultipleContentTypes,\n contentTypeUnion: isMultipleContentTypes ? contentTypes.map((ct) => JSON.stringify(ct)).join(' | ') : '',\n defaultContentType: contentTypes[0] ?? 'application/json',\n hasFormData: contentTypes.some((ct) => ct === 'multipart/form-data'),\n }\n}\n\nexport type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'\n\n/**\n * Derives the default `responseType` for an operation from its primary success response.\n *\n * Returns a value only when that response declares a single non-JSON content type — a binary type\n * (`application/octet-stream`, `application/pdf`, `image/*`, `audio/*`, `video/*`) maps to `'blob'`\n * and other `text/*` maps to `'text'`. Otherwise `undefined`, leaving the runtime client's\n * `Content-Type` auto-detection in charge.\n */\nexport function getResponseType(node: ast.OperationNode): ResponseType | undefined {\n const contentTypes = getPrimarySuccessResponse(node)?.content?.map((entry) => entry.contentType) ?? []\n if (contentTypes.length !== 1) return undefined\n\n const baseType = contentTypes[0]!.split(';')[0]!.trim().toLowerCase()\n if (baseType === 'application/json' || baseType.endsWith('+json') || baseType === 'text/json') return undefined\n if (baseType.startsWith('text/')) return 'text'\n if (baseType === 'application/octet-stream' || baseType === 'application/pdf' || /^(image|audio|video)\\//.test(baseType)) return 'blob'\n return undefined\n}\n\n/**\n * Maps a content type to the PascalCase suffix used to name per-content-type variants\n * (e.g. `application/json` → `Json`, `application/xml` → `Xml`, `multipart/form-data` → `FormData`).\n */\nexport function getContentTypeSuffix(contentType: string): string {\n const baseType = contentType.split(';')[0]!.trim()\n if (baseType === 'application/json') return 'Json'\n if (baseType === 'multipart/form-data') return 'FormData'\n if (baseType === 'application/x-www-form-urlencoded') return 'FormUrlEncoded'\n const subtype = baseType.split('/').pop() ?? baseType\n const parts = subtype.split(/[^a-zA-Z0-9]+/).filter(Boolean)\n if (parts.length === 0) return 'Unknown'\n return parts.map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join('')\n}\n\n/**\n * Appends a content-type suffix to a base name, keeping a trailing `Data` segment last\n * (e.g. `AddPetData` + `Json` → `AddPetJsonData`, `AddPetStatus200` + `Xml` → `AddPetStatus200Xml`).\n */\nexport function getPerContentTypeName(baseName: string, suffix: string): string {\n if (baseName.endsWith('Data')) {\n return suffix.endsWith('Data') ? baseName.slice(0, -4) + suffix : `${baseName.slice(0, -4)}${suffix}Data`\n }\n return baseName + suffix\n}\n\nexport type ContentVariantInput = { contentType: string; schema?: ast.SchemaNode | null; keysToOmit?: Array<string> | null }\nexport type ContentVariant = { name: string; suffix: string; schema: ast.SchemaNode; keysToOmit?: Array<string> | null; contentType: string }\n\n/**\n * Resolves per-content-type variant names for a set of content entries, deduplicating suffix\n * collisions with a numeric counter. Entries without a schema are skipped. The returned `suffix` is\n * the final (possibly counter-augmented) value, so callers can derive parallel names in another\n * namespace (e.g. plugin-faker deriving the matching plugin-ts type name).\n */\nexport function resolveContentTypeVariants(entries: Array<ContentVariantInput>, baseName: string): Array<ContentVariant> {\n const usedNames = new Set<string>()\n return entries\n .filter((entry) => entry.schema)\n .map((entry) => {\n const baseSuffix = getContentTypeSuffix(entry.contentType)\n let suffix = baseSuffix\n let name = getPerContentTypeName(baseName, suffix)\n let counter = 2\n while (usedNames.has(name)) {\n suffix = `${baseSuffix}${counter++}`\n name = getPerContentTypeName(baseName, suffix)\n }\n usedNames.add(name)\n return { name, suffix, schema: entry.schema!, keysToOmit: entry.keysToOmit, contentType: entry.contentType }\n })\n}\n\nexport function buildRequestConfigType(node: ast.OperationNode, resolver: RequestConfigResolver): string {\n const requestName = node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : null\n const { isMultipleContentTypes, contentTypeUnion } = getContentTypeInfo(node)\n const configType = requestName ? `Partial<RequestConfig<${requestName}>>` : 'Partial<RequestConfig>'\n const configProps = ['client?: Client', isMultipleContentTypes ? `contentType?: ${contentTypeUnion}` : null].filter(Boolean).join('; ')\n\n return `${configType} & { ${configProps} }`\n}\n\nexport function buildOperationComments(node: ast.OperationNode, options: BuildOperationCommentsOptions = {}): Array<string> {\n const { link = 'pathTemplate', linkPosition = 'afterDeprecated', splitLines = false } = options\n const linkComment = getOperationLink(node, link)\n const comments =\n linkPosition === 'beforeDeprecated'\n ? [node.description && `@description ${node.description}`, node.summary && `@summary ${node.summary}`, linkComment, node.deprecated && '@deprecated']\n : [node.description && `@description ${node.description}`, node.summary && `@summary ${node.summary}`, node.deprecated && '@deprecated', linkComment]\n\n const filteredComments = comments.filter((comment): comment is string => Boolean(comment))\n\n if (!splitLines) {\n return filteredComments\n }\n\n return filteredComments.flatMap((text) => text.split(/\\r?\\n/).map((line) => line.trim())).filter((comment): comment is string => Boolean(comment))\n}\n\nexport function getOperationParameters(node: ast.OperationNode, options: { paramsCasing?: 'camelcase' } = {}): OperationParameterGroups {\n const params = ast.caseParams(node.parameters, options.paramsCasing)\n\n return {\n path: params.filter((param) => param.in === 'path'),\n query: params.filter((param) => param.in === 'query'),\n header: params.filter((param) => param.in === 'header'),\n cookie: params.filter((param) => param.in === 'cookie'),\n }\n}\n\nexport function getStatusCodeNumber(statusCode: ast.StatusCode | number | string): number | null {\n const code = Number(statusCode)\n\n return Number.isNaN(code) ? null : code\n}\n\nexport function isSuccessStatusCode(statusCode: ast.StatusCode | number | string): boolean {\n const code = getStatusCodeNumber(statusCode)\n\n return code !== null && code >= 200 && code < 300\n}\n\nexport function isErrorStatusCode(statusCode: ast.StatusCode | number | string): boolean {\n const code = getStatusCodeNumber(statusCode)\n\n return code !== null && code >= 400\n}\n\nexport function getSuccessResponses<TResponse extends ResponseLike>(responses: ReadonlyArray<TResponse>): Array<TResponse> {\n return responses.filter((response) => isSuccessStatusCode(response.statusCode))\n}\n\nexport function getOperationSuccessResponses(node: ast.OperationNode): Array<ast.ResponseNode> {\n return getSuccessResponses(node.responses)\n}\n\nexport function getPrimarySuccessResponse(node: ast.OperationNode): ast.ResponseNode | null {\n return getOperationSuccessResponses(node)[0] ?? null\n}\n\nexport function resolveErrorNames(node: ast.OperationNode, resolver: ResponseStatusNameResolver): string[] {\n return node.responses\n .filter((response) => isErrorStatusCode(response.statusCode))\n .map((response) => resolver.resolveResponseStatusName(node, response.statusCode))\n}\n\nexport function resolveSuccessNames(node: ast.OperationNode, resolver: ResponseStatusNameResolver): string[] {\n return node.responses\n .filter((response) => isSuccessStatusCode(response.statusCode))\n .map((response) => resolver.resolveResponseStatusName(node, response.statusCode))\n}\n\nexport function resolveStatusCodeNames(node: ast.OperationNode, resolver: ResponseStatusNameResolver): string[] {\n return node.responses.map((response) => resolver.resolveResponseStatusName(node, response.statusCode))\n}\n\nconst typeNamesByResolver = new WeakMap<OperationTypeNameResolver, Map<string, string[]>>()\n\nexport function resolveOperationTypeNames(\n node: ast.OperationNode,\n resolver: OperationTypeNameResolver,\n options: ResolveOperationTypeNameOptions = {},\n): string[] {\n const cacheKey = `${node.operationId}\\0${options.paramsCasing ?? ''}\\0${options.order ?? ''}\\0${options.responseStatusNames ?? ''}\\0${(options.exclude ?? []).join(',')}`\n let byResolver = typeNamesByResolver.get(resolver)\n if (byResolver) {\n const cached = byResolver.get(cacheKey)\n if (cached) return cached\n } else {\n byResolver = new Map()\n typeNamesByResolver.set(resolver, byResolver)\n }\n\n const { path, query, header } = getOperationParameters(node, { paramsCasing: options.paramsCasing })\n const responseStatusNames =\n options.responseStatusNames === 'error'\n ? resolveErrorNames(node, resolver)\n : options.responseStatusNames === false\n ? []\n : resolveStatusCodeNames(node, resolver)\n const exclude = new Set(options.exclude ?? [])\n const paramNames = [\n ...path.map((param) => resolver.resolvePathParamsName(node, param)),\n ...query.map((param) => resolver.resolveQueryParamsName(node, param)),\n ...header.map((param) => resolver.resolveHeaderParamsName(node, param)),\n ]\n const bodyAndResponseNames = [node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : null, resolver.resolveResponseName(node)]\n const names =\n options.order === 'body-response-first'\n ? [...bodyAndResponseNames, ...paramNames, ...responseStatusNames]\n : [...paramNames, ...bodyAndResponseNames, ...responseStatusNames]\n\n const result = names.filter((name): name is string => Boolean(name) && !exclude.has(name as string))\n byResolver.set(cacheKey, result)\n return result\n}\n\nexport function resolveResponseTypes(node: ast.OperationNode, resolver: ResponseNameResolver): Array<[statusCode: number | 'default', typeName: string]> {\n const types: Array<[number | 'default', string]> = []\n\n for (const response of node.responses) {\n if (response.statusCode === 'default') {\n types.push(['default', resolver.resolveResponseName(node)])\n continue\n }\n\n const code = getStatusCodeNumber(response.statusCode)\n if (code === null) {\n continue\n }\n\n types.push([code, isSuccessStatusCode(code) ? resolver.resolveResponseName(node) : resolver.resolveResponseStatusName(node, response.statusCode)])\n }\n\n return types\n}\n\nexport function findSuccessStatusCode(responses: Array<{ statusCode: ast.StatusCode | number | string }>): ast.StatusCode | null {\n for (const response of responses) {\n if (isSuccessStatusCode(response.statusCode)) {\n return response.statusCode as ast.StatusCode\n }\n }\n\n return null\n}\n","import { camelCase } from '@internals/utils'\nimport type { Group } from '@kubb/core'\n\n/**\n * Builds the `group` config a Kubb plugin passes to `ctx.setOptions`, applying the\n * shared default naming so every plugin groups output consistently:\n *\n * - `path` groups use the second path segment (`/pet/findByStatus` → `pet`).\n * - other groups use `${camelCase(group)}${suffix}` (e.g. `petController`).\n *\n * A user-provided `group.name` always wins over the default namer, so callers stay in\n * control of their output folders. Returns `null` when grouping is disabled, matching the\n * per-plugin convention.\n *\n * @param group - The user-supplied group option, or `undefined` to disable grouping.\n * @param options.suffix - Appended to non-`path` group names, e.g. `'Controller'` or `'Requests'`.\n *\n * @example\n * ```ts\n * createGroupConfig(group, { suffix: 'Controller' }) // plugin-ts, plugin-client, …\n * createGroupConfig(group, { suffix: 'Requests' }) // plugin-cypress, plugin-mcp\n * ```\n */\nexport function createGroupConfig(group: Group | undefined, options: { suffix: string }): Group | null {\n if (!group) {\n return null\n }\n\n const defaultName = (ctx: { group: string }): string => {\n if (group.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n\n return `${camelCase(ctx.group)}${options.suffix}`\n }\n\n return {\n ...group,\n name: group.name ? group.name : defaultName,\n } satisfies Group\n}\n","import { jsStringEscape, stringify } from '@internals/utils'\nimport { getOperationParameters } from '@internals/shared'\nimport { ast } from '@kubb/core'\nimport type { ResolverTs } from './types.ts'\n\n/**\n * Collects JSDoc annotation strings for a schema node.\n *\n * Only uses official JSDoc tags from https://jsdoc.app/: `@description`, `@deprecated`, `@default`, `@example`, `@type`.\n * Constraint metadata (min/max length, pattern, multipleOf, min/maxProperties) is emitted as plain-text lines.\n\n */\nexport function buildPropertyJSDocComments(schema: ast.SchemaNode): Array<string | undefined> {\n const meta = ast.syncSchemaRef(schema)\n\n const isArray = meta?.primitive === 'array'\n\n const hasDescription = meta && 'description' in meta && meta.description\n\n const formatComment =\n meta && 'format' in meta && meta.format\n ? hasDescription\n ? // Empty line between description and format\n [' ', `Format: \\`${meta.format}\\``]\n : ['@description', `Format: \\`${meta.format}\\``]\n : []\n\n return [\n hasDescription ? `@description ${jsStringEscape(meta.description)}` : null,\n ...formatComment,\n meta && 'deprecated' in meta && meta.deprecated ? '@deprecated' : null,\n // minItems/maxItems on arrays should not be emitted as @minLength/@maxLength\n !isArray && meta && 'min' in meta && meta.min !== undefined ? `@minLength ${meta.min}` : null,\n !isArray && meta && 'max' in meta && meta.max !== undefined ? `@maxLength ${meta.max}` : null,\n meta && 'pattern' in meta && meta.pattern ? `@pattern ${meta.pattern}` : null,\n meta && 'default' in meta && meta.default !== undefined\n ? `@default ${'primitive' in meta && meta.primitive === 'string' ? stringify(meta.default as string) : meta.default}`\n : null,\n meta && 'example' in meta && meta.example !== undefined ? `@example ${meta.example}` : null,\n meta && 'primitive' in meta && meta.primitive\n ? [`@type ${meta.primitive}`, 'optional' in schema && schema.optional ? ' | undefined' : null].filter(Boolean).join('')\n : null,\n ].filter(Boolean)\n}\n\ntype BuildParamsSchemaOptions = {\n params: Array<ast.ParameterNode>\n resolver: ResolverTs\n}\n\ntype BuildOperationSchemaOptions = {\n resolver: ResolverTs\n}\n\nexport function buildParams(node: ast.OperationNode, { params, resolver }: BuildParamsSchemaOptions): ast.SchemaNode {\n return ast.createSchema({\n type: 'object',\n properties: params.map((param) =>\n ast.createProperty({\n name: param.name,\n required: param.required,\n schema: ast.createSchema({\n type: 'ref',\n name: resolver.resolveParamName(node, param),\n }),\n }),\n ),\n })\n}\n\nexport function buildData(node: ast.OperationNode, { resolver }: BuildOperationSchemaOptions): ast.SchemaNode {\n const { path: pathParams, query: queryParams, header: headerParams } = getOperationParameters(node)\n\n return ast.createSchema({\n type: 'object',\n deprecated: node.deprecated,\n properties: [\n ast.createProperty({\n name: 'data',\n schema: node.requestBody?.content?.[0]?.schema\n ? ast.createSchema({ type: 'ref', name: resolver.resolveDataName(node), optional: true })\n : ast.createSchema({ type: 'never', primitive: undefined, optional: true }),\n }),\n ast.createProperty({\n name: 'pathParams',\n required: pathParams.length > 0,\n schema: pathParams.length > 0 ? buildParams(node, { params: pathParams, resolver }) : ast.createSchema({ type: 'never', primitive: undefined }),\n }),\n ast.createProperty({\n name: 'queryParams',\n schema:\n queryParams.length > 0\n ? ast.createSchema({ ...buildParams(node, { params: queryParams, resolver }), optional: true })\n : ast.createSchema({ type: 'never', primitive: undefined, optional: true }),\n }),\n ast.createProperty({\n name: 'headerParams',\n schema:\n headerParams.length > 0\n ? ast.createSchema({ ...buildParams(node, { params: headerParams, resolver }), optional: true })\n : ast.createSchema({ type: 'never', primitive: undefined, optional: true }),\n }),\n ast.createProperty({\n name: 'url',\n required: true,\n schema: ast.createSchema({ type: 'url', path: node.path }),\n }),\n ],\n })\n}\n\nexport function buildResponses(node: ast.OperationNode, { resolver }: BuildOperationSchemaOptions): ast.SchemaNode | null {\n if (node.responses.length === 0) {\n return null\n }\n\n return ast.createSchema({\n type: 'object',\n properties: node.responses.map((res) =>\n ast.createProperty({\n name: String(res.statusCode),\n required: true,\n schema: ast.createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) }),\n }),\n ),\n })\n}\n\nexport function buildResponseUnion(node: ast.OperationNode, { resolver }: BuildOperationSchemaOptions): ast.SchemaNode | null {\n const responsesWithSchema = node.responses.filter((res) => res.content?.some((entry) => entry.schema))\n\n if (responsesWithSchema.length === 0) {\n return null\n }\n\n return ast.createSchema({\n type: 'union',\n members: responsesWithSchema.map((res) => ast.createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) })),\n })\n}\n","import { ast } from '@kubb/core'\nimport { parserTs } from '@kubb/parser-ts'\nimport type ts from 'typescript'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX, OPTIONAL_ADDS_QUESTION_TOKEN, OPTIONAL_ADDS_UNDEFINED } from '../constants.ts'\nimport * as factory from '../factory.ts'\nimport type { PluginTs, ResolverTs } from '../types.ts'\nimport { buildPropertyJSDocComments } from '../utils.ts'\n\nfunction isNonNullable<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined\n}\n\n/**\n * Partial map of node-type overrides for the TypeScript printer.\n *\n * Each key is a `SchemaType` string (e.g. `'date'`, `'string'`). The function\n * replaces the built-in handler for that node type. Use `this.transform` to\n * recurse into nested schema nodes, and `this.options` to read printer options.\n *\n * @example Override the `date` handler\n * ```ts\n * pluginTs({\n * printer: {\n * nodes: {\n * date(node) {\n * return ts.factory.createTypeReferenceNode('Date', [])\n * },\n * },\n * },\n * })\n * ```\n */\nexport type PrinterTsNodes = ast.PrinterPartial<ts.TypeNode, PrinterTsOptions>\n\nexport type PrinterTsOptions = {\n /**\n * Mark parameters as optional with `?` or `| undefined`.\n * - `'questionToken'` adds `?` to properties\n * - `'undefined'` adds `| undefined` to types\n *\n * @default `'questionToken'`\n */\n optionalType: PluginTs['resolvedOptions']['optionalType']\n /**\n * Array representation style.\n * - `'array'` uses bracket notation (`T[]`)\n * - `'generic'` uses generic syntax (`Array<T>`)\n *\n * @default `'array'`\n */\n arrayType: PluginTs['resolvedOptions']['arrayType']\n /**\n * Enum output format.\n * - `'inlineLiteral'` embeds literal unions inline\n * - `'asPascalConst'` generates named const unions\n * - `'asConst'` generates as const declarations\n *\n * @default `'inlineLiteral'`\n */\n enumType: PluginTs['resolvedOptions']['enumType']\n /**\n * Suffix appended to enum key reference names.\n *\n * @example Enum key naming\n * `StatusKey` when `enumType` is `'asConst'`\n *\n * @default `'Key'`\n */\n enumTypeSuffix?: PluginTs['resolvedOptions']['enumTypeSuffix']\n /**\n * Syntax for generated declarations.\n * - `'type'` generates type aliases\n * - `'interface'` generates interface declarations\n *\n * @default `'type'`\n */\n syntaxType?: PluginTs['resolvedOptions']['syntaxType']\n /**\n * Exported name for the type declaration.\n * When omitted, returns only the raw type node.\n */\n name?: string\n\n /**\n * JSDoc comment to attach to the generated type.\n */\n description?: string\n /**\n * Properties to exclude using `Omit<Type, Keys>`.\n * Forces type alias syntax regardless of `syntaxType` setting.\n */\n keysToOmit?: Array<string> | null\n /**\n * Transforms raw schema names into valid TypeScript identifiers.\n */\n resolver: ResolverTs\n /**\n * Schema names that represent enums for suffixed key references.\n */\n enumSchemaNames?: Set<string>\n /**\n * Custom handler map for node type overrides.\n */\n nodes?: PrinterTsNodes\n}\n\n/**\n * TypeScript printer factory options: maps `SchemaNode` → `ts.TypeNode` (raw) or `ts.Node` (full declaration).\n */\nexport type PrinterTsFactory = ast.PrinterFactoryOptions<'typescript', PrinterTsOptions, ts.TypeNode, string>\n\ntype PrinterTs = PrinterTsFactory\n\n/**\n * TypeScript type printer built with `definePrinter`.\n *\n * Converts a `SchemaNode` AST node into a TypeScript AST node:\n * - **`printer.print(node)`** — when `options.typeName` is set, returns a full\n * `type Name = …` or `interface Name { … }` declaration (`ts.Node`).\n * Without `typeName`, returns the raw `ts.TypeNode` for the schema.\n *\n * Dispatches on `node.type` to the appropriate handler in `nodes`. Options are closed\n * over per printer instance, so each call to `printerTs(options)` produces an independent printer.\n *\n * @example Raw type node (no `typeName`)\n * ```ts\n * const printer = printerTs({ optionalType: 'questionToken', arrayType: 'array', enumType: 'inlineLiteral' })\n * const typeNode = printer.print(schemaNode) // ts.TypeNode\n * ```\n *\n * @example Full declaration (with `typeName`)\n * ```ts\n * const printer = printerTs({ optionalType: 'questionToken', arrayType: 'array', enumType: 'inlineLiteral', typeName: 'MyType' })\n * const declaration = printer.print(schemaNode) // ts.TypeAliasDeclaration | ts.InterfaceDeclaration\n * ```\n */\nexport const printerTs = ast.definePrinter<PrinterTs>((options) => {\n const addsUndefined = OPTIONAL_ADDS_UNDEFINED.has(options.optionalType)\n\n return {\n name: 'typescript',\n options,\n nodes: {\n any: () => factory.keywordTypeNodes.any,\n unknown: () => factory.keywordTypeNodes.unknown,\n void: () => factory.keywordTypeNodes.void,\n never: () => factory.keywordTypeNodes.never,\n boolean: () => factory.keywordTypeNodes.boolean,\n null: () => factory.keywordTypeNodes.null,\n blob: () => factory.createTypeReferenceNode('Blob', []),\n string: () => factory.keywordTypeNodes.string,\n uuid: () => factory.keywordTypeNodes.string,\n email: () => factory.keywordTypeNodes.string,\n url: (node) => {\n if (node.path) {\n return factory.createUrlTemplateType(node.path)\n }\n return factory.keywordTypeNodes.string\n },\n ipv4: () => factory.keywordTypeNodes.string,\n ipv6: () => factory.keywordTypeNodes.string,\n datetime: () => factory.keywordTypeNodes.string,\n number: () => factory.keywordTypeNodes.number,\n integer: () => factory.keywordTypeNodes.number,\n bigint: () => factory.keywordTypeNodes.bigint,\n date: factory.dateOrStringNode,\n time: factory.dateOrStringNode,\n ref(node) {\n if (!node.name) {\n return null\n }\n // Parser-generated refs (with $ref) carry raw schema names that need resolving.\n // Use the canonical name from the $ref path — node.name may have been overridden\n // (e.g. by single-member allOf flatten using the property-derived child name).\n // Inline refs (without $ref) from utils already carry resolved type names.\n const refName = node.ref ? (ast.extractRefName(node.ref) ?? node.name) : node.name\n\n // When a Key suffix is configured, enum refs must use the suffixed name (e.g. `StatusKey`)\n // so the reference matches what the enum file actually exports.\n const isEnumRef =\n node.ref && ENUM_TYPES_WITH_KEY_SUFFIX.has(this.options.enumType) && this.options.enumTypeSuffix && this.options.enumSchemaNames?.has(refName)\n\n const name = isEnumRef\n ? this.options.resolver.resolveEnumKeyName({ name: refName }, this.options.enumTypeSuffix!)\n : node.ref\n ? this.options.resolver.default(refName, 'type')\n : refName\n\n return factory.createTypeReferenceNode(name, undefined)\n },\n enum(node) {\n const values = node.namedEnumValues?.map((v) => v.value) ?? node.enumValues ?? []\n\n if (this.options.enumType === 'inlineLiteral' || !node.name) {\n const literalNodes = values\n .filter((v): v is string | number | boolean => v !== null && v !== undefined)\n .map((value) => factory.constToTypeNode(value, typeof value as 'string' | 'number' | 'boolean'))\n .filter(isNonNullable)\n\n return factory.createUnionDeclaration({ withParentheses: true, nodes: literalNodes }) ?? undefined\n }\n\n const resolvedName =\n ENUM_TYPES_WITH_KEY_SUFFIX.has(this.options.enumType) && this.options.enumTypeSuffix\n ? this.options.resolver.resolveEnumKeyName(node, this.options.enumTypeSuffix)\n : this.options.resolver.default(node.name, 'type')\n\n return factory.createTypeReferenceNode(resolvedName, undefined)\n },\n union(node) {\n const members = node.members ?? []\n\n const hasStringLiteral = members.some((m) => {\n const enumNode = ast.narrowSchema(m, ast.schemaTypes.enum)\n return enumNode?.primitive === 'string'\n })\n const hasPlainString = members.some((m) => ast.isStringType(m))\n\n if (hasStringLiteral && hasPlainString) {\n const memberNodes = members\n .map((m) => {\n if (ast.isStringType(m)) {\n return factory.createIntersectionDeclaration({\n nodes: [factory.keywordTypeNodes.string, factory.createTypeLiteralNode([])],\n withParentheses: true,\n })\n }\n\n return this.transform(m)\n })\n .filter(isNonNullable)\n\n return factory.createUnionDeclaration({ withParentheses: true, nodes: memberNodes }) ?? undefined\n }\n\n return factory.createUnionDeclaration({ withParentheses: true, nodes: factory.buildMemberNodes(members, this.transform) }) ?? undefined\n },\n intersection(node) {\n return factory.createIntersectionDeclaration({ withParentheses: true, nodes: factory.buildMemberNodes(node.members, this.transform) }) ?? null\n },\n array(node) {\n const itemNodes = (node.items ?? []).map((item) => this.transform(item)).filter(isNonNullable)\n\n return factory.createArrayDeclaration({ nodes: itemNodes, arrayType: this.options.arrayType }) ?? null\n },\n tuple(node) {\n return factory.buildTupleNode(node, this.transform) ?? null\n },\n object(node) {\n const { transform, options } = this\n\n const addsQuestionToken = OPTIONAL_ADDS_QUESTION_TOKEN.has(options.optionalType)\n\n const propertyNodes: Array<ts.TypeElement> = node.properties.map((prop) => {\n const baseType = transform(prop.schema) ?? factory.keywordTypeNodes.unknown\n const type = factory.buildPropertyType(prop.schema, baseType, options.optionalType)\n const propMeta = ast.syncSchemaRef(prop.schema)\n\n const propertyNode = factory.createPropertySignature({\n questionToken: prop.schema.optional || prop.schema.nullish ? addsQuestionToken : false,\n name: prop.name,\n type,\n readOnly: propMeta?.readOnly,\n })\n\n return factory.appendJSDocToNode({ node: propertyNode, comments: buildPropertyJSDocComments(prop.schema) })\n })\n\n const allElements = [...propertyNodes, ...factory.buildIndexSignatures(node, propertyNodes.length, transform)]\n\n if (!allElements.length) {\n return factory.keywordTypeNodes.object\n }\n\n return factory.createTypeLiteralNode(allElements)\n },\n ...options.nodes,\n },\n print(node) {\n const { name, syntaxType = 'type', description, keysToOmit } = this.options\n\n const transformed = this.transform(node)\n if (!transformed) return null\n\n // For ref nodes, structural metadata lives on node.schema rather than the ref node itself.\n const meta = ast.syncSchemaRef(node)\n\n // Without name, apply modifiers inline and return.\n if (!name) {\n const withNullable = meta.nullable ? factory.createUnionDeclaration({ nodes: [transformed, factory.keywordTypeNodes.null] }) : transformed\n const result =\n (meta.nullish || meta.optional) && addsUndefined\n ? factory.createUnionDeclaration({ nodes: [withNullable, factory.keywordTypeNodes.undefined] })\n : withNullable\n return parserTs.print(result)\n }\n\n // When keysToOmit is present, wrap with Omit first, then apply nullable/optional\n // modifiers so they are not swallowed by NonNullable inside createOmitDeclaration.\n const inner = (() => {\n const omitted: ts.TypeNode = keysToOmit?.length\n ? factory.createOmitDeclaration({ keys: keysToOmit, type: transformed, nonNullable: true })\n : transformed\n const withNullable = meta.nullable ? factory.createUnionDeclaration({ nodes: [omitted, factory.keywordTypeNodes.null] }) : omitted\n // For named type declarations (type aliases), optional/nullish always produces | undefined\n // regardless of optionalType — the questionToken ? modifier only applies to object properties.\n return meta.nullish || meta.optional ? factory.createUnionDeclaration({ nodes: [withNullable, factory.keywordTypeNodes.undefined] }) : withNullable\n })()\n\n const useTypeGeneration = syntaxType === 'type' || inner.kind === factory.syntaxKind.union || !!keysToOmit?.length\n\n const typeNode = factory.createTypeDeclaration({\n name,\n isExportable: true,\n type: inner,\n syntax: useTypeGeneration ? 'type' : 'interface',\n comments: buildPropertyJSDocComments({\n ...meta,\n description,\n }),\n })\n\n return parserTs.print(typeNode)\n },\n }\n})\n","import { resolveContentTypeVariants } from '@internals/shared'\nimport { ast, defineGenerator } from '@kubb/core'\nimport { File, jsxRendererSync } from '@kubb/renderer-jsx'\nimport { Type } from '../components/Type.tsx'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX } from '../constants.ts'\nimport { printerTs } from '../printers/printerTs.ts'\nimport type { PluginTs } from '../types'\nimport { buildData, buildResponses, buildResponseUnion } from '../utils.ts'\n\n/**\n * Built-in generator for `@kubb/plugin-ts`. Emits one TypeScript file per\n * schema in the spec plus per-operation request, response, and parameter\n * types. Drop-replace with a custom `Generator<PluginTs>` to change how\n * TypeScript output is produced.\n */\nexport const typeGenerator = defineGenerator<PluginTs>({\n name: 'typescript',\n renderer: jsxRendererSync,\n schema(node, ctx) {\n const { enumType, enumTypeSuffix, enumKeyCasing, syntaxType, optionalType, arrayType, output, group, printer } = ctx.options\n const { adapter, config, resolver, root } = ctx\n\n if (!node.name) {\n return\n }\n const mode = ctx.getMode(output)\n // Build a set of schema names that are enums so the ref handler and getImports\n // callback can use the suffixed type name (e.g. `StatusKey`) for those refs.\n const enumSchemaNames = new Set<string>(ctx.meta.enumNames)\n\n function resolveImportName(schemaName: string): string {\n if (ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && enumTypeSuffix && enumSchemaNames.has(schemaName)) {\n return resolver.resolveEnumKeyName({ name: schemaName }, enumTypeSuffix)\n }\n return resolver.resolveTypeName(schemaName)\n }\n\n const imports = adapter.getImports(node, (schemaName) => ({\n name: resolveImportName(schemaName),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group: group ?? undefined }).path,\n }))\n\n const isEnumSchema = !!ast.narrowSchema(node, ast.schemaTypes.enum)\n\n const meta = {\n name: ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema ? resolver.resolveEnumKeyName(node, enumTypeSuffix) : resolver.resolveTypeName(node.name),\n file: resolver.resolveFile({ name: node.name, extname: '.ts' }, { root, output, group: group ?? undefined }),\n } as const\n\n const schemaPrinter = printerTs({\n optionalType,\n arrayType,\n enumType,\n enumTypeSuffix,\n name: meta.name,\n syntaxType,\n description: node.description,\n resolver,\n enumSchemaNames,\n nodes: printer?.nodes,\n })\n\n return (\n <File\n baseName={meta.file.baseName}\n path={meta.file.path}\n meta={meta.file.meta}\n banner={resolver.resolveBanner(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n footer={resolver.resolveFooter(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n >\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[node.name, imp.path, imp.isTypeOnly].join('-')} root={meta.file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\n <Type\n name={meta.name}\n node={node}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n resolver={resolver}\n printer={schemaPrinter}\n />\n </File>\n )\n },\n operation(node, ctx) {\n const { enumType, enumTypeSuffix, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, output, printer } = ctx.options\n const { adapter, config, resolver, root } = ctx\n\n const mode = ctx.getMode(output)\n\n const params = ast.caseParams(node.parameters, paramsCasing)\n\n const meta = {\n file: resolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n { root, output, group: group ?? undefined },\n ),\n } as const\n\n // Build a set of schema names that are enums so the ref handler and getImports\n // callback can use the suffixed type name (e.g. `StatusKey`) for those refs.\n const enumSchemaNames = new Set<string>(ctx.meta.enumNames)\n\n function resolveImportName(schemaName: string): string {\n if (ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && enumTypeSuffix && enumSchemaNames.has(schemaName)) {\n return resolver.resolveEnumKeyName({ name: schemaName }, enumTypeSuffix)\n }\n return resolver.resolveTypeName(schemaName)\n }\n\n function renderSchemaType({ schema, name, keysToOmit }: { schema: ast.SchemaNode | null; name: string; keysToOmit?: Array<string> | null }) {\n if (!schema) return null\n\n const imports = adapter.getImports(schema, (schemaName) => ({\n name: resolveImportName(schemaName),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group: group ?? undefined }).path,\n }))\n\n const schemaPrinter = printerTs({\n optionalType,\n arrayType,\n enumType,\n enumTypeSuffix,\n name,\n syntaxType,\n description: schema.description,\n keysToOmit,\n resolver,\n enumSchemaNames,\n nodes: printer?.nodes,\n })\n\n return (\n <>\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[name, imp.path, imp.isTypeOnly].join('-')} root={meta.file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\n <Type\n name={name}\n node={schema}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n resolver={resolver}\n printer={schemaPrinter}\n />\n </>\n )\n }\n\n /**\n * Emits an individual type per content type plus a union alias under `baseName`.\n * Shared by the request body and multi-content-type responses.\n */\n function buildContentTypeVariants(\n entries: Array<{ contentType: string; schema?: ast.SchemaNode | null; keysToOmit?: Array<string> | null }>,\n baseName: string,\n decorate?: (schema: ast.SchemaNode) => ast.SchemaNode,\n ) {\n const variants = resolveContentTypeVariants(entries, baseName)\n const unionSchema = ast.createSchema({\n type: 'union',\n members: variants.map((variant) => ast.createSchema({ type: 'ref', name: variant.name })),\n })\n return (\n <>\n {variants.map((variant) =>\n renderSchemaType({\n schema: decorate ? decorate(variant.schema) : variant.schema,\n name: variant.name,\n keysToOmit: variant.keysToOmit,\n }),\n )}\n {renderSchemaType({ schema: unionSchema, name: baseName })}\n </>\n )\n }\n\n const paramTypes = params.map((param) =>\n renderSchemaType({\n schema: param.schema,\n name: resolver.resolveParamName(node, param),\n }),\n )\n\n const requestBodyContent = node.requestBody?.content ?? []\n\n function buildRequestType() {\n if (requestBodyContent.length === 0) return null\n if (requestBodyContent.length === 1) {\n const entry = requestBodyContent[0]!\n if (!entry.schema) return null\n return renderSchemaType({\n schema: {\n ...entry.schema,\n description: node.requestBody!.description ?? entry.schema.description,\n },\n name: resolver.resolveDataName(node),\n keysToOmit: entry.keysToOmit,\n })\n }\n // Multiple content types — generate individual types + union alias\n return buildContentTypeVariants(requestBodyContent, resolver.resolveDataName(node), (schema) => ({\n ...schema,\n description: node.requestBody!.description ?? schema.description,\n }))\n }\n\n const requestType = buildRequestType()\n\n const responseTypes = node.responses.map((res) => {\n const variants = (res.content ?? []).filter((entry) => entry.schema)\n // Multiple content types for a single status code — generate a union of the variants.\n if (variants.length > 1) {\n return buildContentTypeVariants(variants, resolver.resolveResponseStatusName(node, res.statusCode))\n }\n const primary = variants[0] ?? res.content?.[0]\n return renderSchemaType({\n schema: primary?.schema ?? null,\n name: resolver.resolveResponseStatusName(node, res.statusCode),\n keysToOmit: primary?.keysToOmit,\n })\n })\n\n const dataType = renderSchemaType({\n schema: buildData({ ...node, parameters: params }, { resolver }),\n name: resolver.resolveRequestConfigName(node),\n })\n\n const responsesType = renderSchemaType({\n schema: buildResponses(node, { resolver }),\n name: resolver.resolveResponsesName(node),\n })\n\n function buildResponseType() {\n const hasSchema = (res: ast.ResponseNode) => (res.content ?? []).some((entry) => entry.schema)\n if (!node.responses.some(hasSchema)) {\n return null\n }\n\n const responseName = resolver.resolveResponseName(node)\n\n const responsesWithSchema = node.responses.filter(hasSchema)\n const importedNames = new Set(\n responsesWithSchema.flatMap((res) =>\n (res.content ?? []).flatMap((entry) =>\n entry.schema\n ? adapter\n .getImports(entry.schema, (schemaName) => ({\n name: resolveImportName(schemaName),\n path: '',\n }))\n .flatMap((imp) => (Array.isArray(imp.name) ? imp.name : [imp.name]))\n : [],\n ),\n ),\n )\n\n if (importedNames.has(responseName)) {\n return null\n }\n\n return renderSchemaType({\n schema: {\n ...buildResponseUnion(node, { resolver })!,\n description: 'Union of all possible responses',\n },\n name: responseName,\n })\n }\n\n const responseType = buildResponseType()\n\n return (\n <File\n baseName={meta.file.baseName}\n path={meta.file.path}\n meta={meta.file.meta}\n banner={resolver.resolveBanner(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n footer={resolver.resolveFooter(ctx.meta, { output, config, file: { path: meta.file.path, baseName: meta.file.baseName } })}\n >\n {paramTypes}\n {responseTypes}\n {requestType}\n {dataType}\n {responsesType}\n {responseType}\n </File>\n )\n },\n})\n","import { ensureValidVarName, pascalCase } from '@internals/utils'\nimport { defineResolver } from '@kubb/core'\nimport type { PluginTs } from '../types.ts'\n\n/**\n * Default resolver used by `@kubb/plugin-ts`. Decides the names and file paths\n * for every generated TypeScript type. Import this in other plugins that need\n * to reference the exact names `plugin-ts` produces without duplicating the\n * casing/file-layout rules.\n *\n * The `default` method is supplied by `defineResolver`. It uses PascalCase for\n * type names and PascalCase-with-isFile for files.\n *\n * @example Resolve a type and file name\n * ```ts\n * import { resolverTs } from '@kubb/plugin-ts'\n *\n * resolverTs.default('list pets', 'type') // 'ListPets'\n * resolverTs.resolvePathName('list pets', 'file') // 'ListPets'\n * resolverTs.resolveResponseStatusName(node, 200) // 'ListPetsStatus200'\n * ```\n */\nexport const resolverTs = defineResolver<PluginTs>(() => {\n return {\n name: 'default',\n pluginName: 'plugin-ts',\n default(name, type) {\n const resolved = pascalCase(name, { isFile: type === 'file' })\n return type === 'file' ? resolved : ensureValidVarName(resolved)\n },\n resolveTypeName(name) {\n return ensureValidVarName(pascalCase(name))\n },\n resolvePathName(name, type) {\n const resolved = pascalCase(name, { isFile: type === 'file' })\n return type === 'file' ? resolved : ensureValidVarName(resolved)\n },\n resolveParamName(node, param) {\n return this.resolveTypeName(`${node.operationId} ${param.in} ${param.name}`)\n },\n resolveResponseStatusName(node, statusCode) {\n return this.resolveTypeName(`${node.operationId} Status ${statusCode}`)\n },\n resolveDataName(node) {\n return this.resolveTypeName(`${node.operationId} Data`)\n },\n resolveRequestConfigName(node) {\n return this.resolveTypeName(`${node.operationId} RequestConfig`)\n },\n resolveResponsesName(node) {\n return this.resolveTypeName(`${node.operationId} Responses`)\n },\n resolveResponseName(node) {\n return this.resolveTypeName(`${node.operationId} Response`)\n },\n resolveEnumKeyName(node, enumTypeSuffix = 'key') {\n return `${this.resolveTypeName(node.name ?? '')}${enumTypeSuffix}`\n },\n resolvePathParamsName(node, param) {\n return this.resolveParamName(node, param)\n },\n resolveQueryParamsName(node, param) {\n return this.resolveParamName(node, param)\n },\n resolveHeaderParamsName(node, param) {\n return this.resolveParamName(node, param)\n },\n }\n})\n","import { createGroupConfig } from '@internals/shared'\nimport { definePlugin } from '@kubb/core'\nimport { typeGenerator } from './generators/typeGenerator.tsx'\nimport { resolverTs } from './resolvers/resolverTs.ts'\nimport type { PluginTs } from './types.ts'\n\n/**\n * Canonical plugin name for `@kubb/plugin-ts`. Used for driver lookups and\n * cross-plugin dependency references.\n */\nexport const pluginTsName = 'plugin-ts' satisfies PluginTs['name']\n\n/**\n * Generates TypeScript `type` aliases and `interface` declarations from an\n * OpenAPI spec. The foundation that every other Kubb plugin builds on:\n * clients, query hooks, mocks, and validators all reference the names this\n * plugin produces.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'kubb'\n * import { pluginTs } from '@kubb/plugin-ts'\n *\n * export default defineConfig({\n * input: { path: './petStore.yaml' },\n * output: { path: './src/gen' },\n * plugins: [\n * pluginTs({\n * output: { path: './types' },\n * enumType: 'asConst',\n * optionalType: 'questionTokenAndUndefined',\n * }),\n * ],\n * })\n * ```\n */\nexport const pluginTs = definePlugin<PluginTs>((options) => {\n const {\n output = { path: 'types', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n enumType = 'asConst',\n enumTypeSuffix = 'Key',\n enumKeyCasing = 'none',\n optionalType = 'questionToken',\n arrayType = 'array',\n syntaxType = 'type',\n paramsCasing,\n printer,\n resolver: userResolver,\n transformer: userTransformer,\n generators: userGenerators = [],\n } = options\n\n const groupConfig = createGroupConfig(group, { suffix: 'Controller' })\n\n return {\n name: pluginTsName,\n options,\n hooks: {\n 'kubb:plugin:setup'(ctx) {\n ctx.setOptions({\n output,\n exclude,\n include,\n override,\n optionalType,\n group: groupConfig,\n arrayType,\n enumType,\n enumTypeSuffix,\n enumKeyCasing,\n syntaxType,\n paramsCasing,\n printer,\n })\n ctx.setResolver(userResolver ? { ...resolverTs, ...userResolver } : resolverTs)\n if (userTransformer) {\n ctx.setTransformer(userTransformer)\n }\n ctx.addGenerator(typeGenerator)\n for (const gen of userGenerators) {\n ctx.addGenerator(gen)\n }\n },\n },\n }\n})\n\nexport default pluginTs\n","import { ast } from '@kubb/core'\nimport { PARAM_RANK } from '../constants.ts'\n\n/**\n * Maps each function-printer handler key to its concrete node type.\n */\nexport type FunctionNodeByType = {\n functionParameter: ast.FunctionParameterNode\n parameterGroup: ast.ParameterGroupNode\n functionParameters: ast.FunctionParametersNode\n paramsType: ast.ParamsTypeNode\n}\n\nconst kindToHandlerKey = {\n FunctionParameter: 'functionParameter',\n ParameterGroup: 'parameterGroup',\n FunctionParameters: 'functionParameters',\n ParamsType: 'paramsType',\n} satisfies Record<string, ast.FunctionNodeType>\n\n/**\n * Creates a function-parameter printer factory.\n *\n * Uses `createPrinterFactory` and dispatches handlers by `node.kind`\n * (for function nodes) rather than by `node.type` (for schema nodes).\n */\nexport const defineFunctionPrinter = ast.createPrinterFactory<ast.FunctionParamNode, ast.FunctionNodeType, FunctionNodeByType>(\n (node) => kindToHandlerKey[node.kind],\n)\n\nexport type FunctionPrinterOptions = {\n /**\n * Rendering modes supported by `functionPrinter`.\n *\n * | Mode | Output example | Use case |\n * |---------------|---------------------------------------------|---------------------------------|\n * | `declaration` | `id: string, config: Config = {}` | Function parameter declaration |\n * | `call` | `id, { method, url }` | Function call arguments |\n * | `keys` | `{ id, config }` | Key names only (destructuring) |\n * | `values` | `{ id: id, config: config }` | Key/value object entries |\n */\n mode: 'declaration' | 'call' | 'keys' | 'values'\n /**\n * Optional transformation applied to every parameter name before printing.\n */\n transformName?: (name: string) => string\n /**\n * Optional transformation applied to every type string before printing.\n */\n transformType?: (type: string) => string\n}\n\ntype DefaultPrinter = ast.PrinterFactoryOptions<'functionParameters', FunctionPrinterOptions, string>\n\nfunction rank(param: ast.FunctionParameterNode | ast.ParameterGroupNode): number {\n if (param.kind === 'ParameterGroup') {\n if (param.default) return PARAM_RANK.withDefault\n const isOptional = param.optional ?? param.properties.every((p) => p.optional || p.default !== undefined)\n return isOptional ? PARAM_RANK.optional : PARAM_RANK.required\n }\n if (param.rest) return PARAM_RANK.rest\n if (param.default) return PARAM_RANK.withDefault\n return param.optional ? PARAM_RANK.optional : PARAM_RANK.required\n}\n\nfunction sortParams(params: ReadonlyArray<ast.FunctionParameterNode | ast.ParameterGroupNode>): Array<ast.FunctionParameterNode | ast.ParameterGroupNode> {\n return params.toSorted((a, b) => rank(a) - rank(b))\n}\n\nfunction sortChildParams(params: Array<ast.FunctionParameterNode>): Array<ast.FunctionParameterNode> {\n return params.toSorted((a, b) => rank(a) - rank(b))\n}\n\n/**\n * Default function-signature printer.\n * Covers the four standard output modes used across Kubb plugins.\n *\n * @example\n * ```ts\n * const printer = functionPrinter({ mode: 'declaration' })\n *\n * const sig = createFunctionParameters({\n * params: [\n * createFunctionParameter({ name: 'petId', type: 'string', optional: false }),\n * createFunctionParameter({ name: 'config', type: 'Config', optional: false, default: '{}' }),\n * ],\n * })\n *\n * printer.print(sig) // → \"petId: string, config: Config = {}\"\n * ```\n */\nexport const functionPrinter = defineFunctionPrinter<DefaultPrinter>((options) => ({\n name: 'functionParameters',\n options,\n nodes: {\n paramsType(node) {\n if (node.kind !== 'ParamsType') return null\n if (node.variant === 'member') {\n return `${node.base}['${node.key}']`\n }\n if (node.variant === 'struct') {\n const parts = node.properties.map((p) => {\n const typeStr = this.transform(p.type)\n const key = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(p.name) ? p.name : JSON.stringify(p.name)\n return p.optional ? `${key}?: ${typeStr}` : `${key}: ${typeStr}`\n })\n return `{ ${parts.join('; ')} }`\n }\n if (node.variant === 'reference') {\n return node.name\n }\n return null\n },\n functionParameter(node) {\n const { mode, transformName, transformType } = this.options\n const name = transformName ? transformName(node.name) : node.name\n\n const rawType = node.type ? this.transform(node.type) : undefined\n const type = rawType != null && transformType ? transformType(rawType) : rawType\n\n if (mode === 'keys' || mode === 'values') {\n return node.rest ? `...${name}` : name\n }\n\n if (mode === 'call') {\n return node.rest ? `...${name}` : name\n }\n\n if (node.rest) {\n return type ? `...${name}: ${type}` : `...${name}`\n }\n if (type) {\n if (node.optional) return `${name}?: ${type}`\n return node.default ? `${name}: ${type} = ${node.default}` : `${name}: ${type}`\n }\n return node.default ? `${name} = ${node.default}` : name\n },\n parameterGroup(node) {\n const { mode, transformName, transformType } = this.options\n const sorted = sortChildParams(node.properties)\n const isOptional = node.optional ?? sorted.every((p) => p.optional || p.default !== undefined)\n\n if (node.inline) {\n return sorted\n .map((p) => this.transform(p))\n .filter(Boolean)\n .join(', ')\n }\n\n if (mode === 'keys' || mode === 'values') {\n const keys = sorted.map((p) => p.name).join(', ')\n return `{ ${keys} }`\n }\n\n if (mode === 'call') {\n const keys = sorted.map((p) => p.name).join(', ')\n return `{ ${keys} }`\n }\n\n const names = sorted.map((p) => {\n const n = transformName ? transformName(p.name) : p.name\n\n return n\n })\n\n const nameStr = names.length ? `{ ${names.join(', ')} }` : undefined\n if (!nameStr) return null\n\n let typeAnnotation: string | undefined = node.type ? (this.transform(node.type) ?? undefined) : undefined\n if (!typeAnnotation) {\n const typeParts = sorted\n .filter((p) => p.type)\n .map((p) => {\n const rawT = p.type ? this.transform(p.type) : undefined\n const t = rawT != null && transformType ? transformType(rawT) : rawT\n return p.optional || p.default !== undefined ? `${p.name}?: ${t}` : `${p.name}: ${t}`\n })\n typeAnnotation = typeParts.length ? `{ ${typeParts.join('; ')} }` : undefined\n }\n\n if (typeAnnotation) {\n if (isOptional) return `${nameStr}: ${typeAnnotation} = ${node.default ?? '{}'}`\n return node.default ? `${nameStr}: ${typeAnnotation} = ${node.default}` : `${nameStr}: ${typeAnnotation}`\n }\n\n return node.default ? `${nameStr} = ${node.default}` : nameStr\n },\n functionParameters(node) {\n const sorted = sortParams(node.params)\n\n return sorted\n .map((p) => this.transform(p))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