@kubb/plugin-ts 5.0.0-alpha.24 → 5.0.0-alpha.26
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.
- package/dist/index.cjs +468 -473
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +9 -4
- package/dist/index.js +472 -477
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/Enum.tsx +1 -1
- package/src/constants.ts +10 -0
- package/src/factory.ts +122 -1
- package/src/generators/typeGenerator.tsx +107 -108
- package/src/generators/typeGeneratorLegacy.tsx +85 -80
- package/src/index.ts +0 -5
- package/src/plugin.ts +19 -49
- package/src/printers/functionPrinter.ts +6 -5
- package/src/printers/printerTs.ts +49 -181
- package/src/resolvers/resolverTs.ts +2 -2
- package/src/types.ts +6 -4
- package/src/utils.ts +41 -13
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["ts","factory.createEnumDeclaration","File","factory.createLiteralTypeNode","factory.createTrue","factory.createFalse","factory.createPrefixUnaryExpression","factory.createNumericLiteral","factory.createStringLiteral","factory.createTypeReferenceNode","factory.createIdentifier","factory.createOptionalTypeNode","factory.createRestTypeNode","factory.createArrayTypeNode","factory.createTupleTypeNode","factory.createUnionDeclaration","factory.createIndexSignature","factory.createUrlTemplateType","schemaTypes","factory.createIntersectionDeclaration","factory.createTypeLiteralNode","factory.createArrayDeclaration","factory.createPropertySignature","factory.appendJSDocToNode","factory.createTypeDeclaration","factory.createOmitDeclaration","schemaTypes","File","path","schemaTypes","File","path","File","schemaTypes","path"],"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/printers/printerTs.ts","../src/components/Type.tsx","../src/utils.ts","../src/generators/typeGenerator.tsx","../src/resolvers/resolverTs.ts","../src/resolvers/resolverTsLegacy.ts","../src/generators/typeGeneratorLegacy.tsx","../src/presets.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 * Returns a masked version of a string, showing only the first and last few characters.\n * Useful for logging sensitive values (tokens, keys) without exposing the full value.\n *\n * @example\n * maskString('KUBB_STUDIO-abc123-xyz789') // 'KUBB_STUDIO-…789'\n */\nexport function maskString(value: string, start = 8, end = 4): string {\n if (value.length <= start + end) return value\n return `${value.slice(0, start)}…${value.slice(-end)}`\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 * Strips functions, symbols, and `undefined` values from plugin options for safe JSON transport.\n *\n * @example\n * ```ts\n * serializePluginOptions({ output: './src', onWrite: () => {} })\n * // { output: './src' } (function stripped)\n * ```\n */\nexport function serializePluginOptions<TOptions extends object>(options: TOptions): TOptions {\n if (options === null || options === undefined) return {} as TOptions\n if (typeof options !== 'object') return options\n if (Array.isArray(options)) return options.map(serializePluginOptions) as unknown as TOptions\n\n const serialized: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(options)) {\n if (typeof value === 'function' || typeof value === 'symbol' || value === undefined) continue\n serialized[key] = value !== null && typeof value === 'object' ? serializePluginOptions(value as object) : value\n }\n return serialized as TOptions\n}\n\n/**\n * Strips all `undefined` values from an object recursively by round-tripping through JSON.\n * Useful for clean inline snapshot assertions that only show fields with actual values.\n *\n * @example\n * toSnapshot({ kind: 'Schema', name: undefined, type: 'string' })\n * // { kind: 'Schema', type: 'string' }\n */\nexport function toSnapshot<T>(value: T): T {\n return JSON.parse(JSON.stringify(value))\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","import { camelCase, pascalCase, screamingSnakeCase, snakeCase } from '@internals/utils'\nimport { isNumber, sortBy } from 'remeda'\nimport ts from 'typescript'\n\nconst { SyntaxKind, factory } = ts\n\n// https://ts-ast-viewer.com/\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\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\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\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\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 `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\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\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\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 * @link 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\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\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\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\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.members as Array<ts.TypeElement>,\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\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 * In { propertyName: string; name?: string } is `name` being used to make the type more unique when multiple same names are used.\n * @example `import { Pet as Cat } 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\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\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\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\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\nexport const createTypeLiteralNode = factory.createTypeLiteralNode\n\nexport const createTypeReferenceNode = factory.createTypeReferenceNode\nexport const createNumericLiteral = factory.createNumericLiteral\nexport const createStringLiteral = factory.createStringLiteral\n\nexport const createArrayTypeNode = factory.createArrayTypeNode\nexport const createParenthesizedType = factory.createParenthesizedType\n\nexport const createLiteralTypeNode = factory.createLiteralTypeNode\nexport const createNull = factory.createNull\nexport const createIdentifier = factory.createIdentifier\n\nexport const createOptionalTypeNode = factory.createOptionalTypeNode\nexport const createTupleTypeNode = factory.createTupleTypeNode\nexport const createRestTypeNode = factory.createRestTypeNode\nexport const createTrue = factory.createTrue\nexport const createFalse = factory.createFalse\nexport const createIndexedAccessTypeNode = factory.createIndexedAccessTypeNode\nexport const createTypeOperatorNode = factory.createTypeOperatorNode\nexport const createPrefixUnaryExpression = factory.createPrefixUnaryExpression\n\nexport { SyntaxKind }\n","import { camelCase, trimQuotes } from '@internals/utils'\nimport type { EnumSchemaNode } from '@kubb/ast/types'\nimport { safePrint } from '@kubb/fabric-core/parsers/typescript'\nimport { File } from '@kubb/react-fabric'\nimport type { FabricReactNode } from '@kubb/react-fabric/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: EnumSchemaNode\n enumType: PluginTs['resolvedOptions']['enumType']\n enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix']\n enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing']\n resolver: ResolverTs\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: 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): FabricReactNode {\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 unknown as Array<[string, string]>,\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 { jsStringEscape, stringify } from '@internals/utils'\nimport { isStringType, narrowSchema, schemaTypes } from '@kubb/ast'\nimport type { ArraySchemaNode, SchemaNode } from '@kubb/ast/types'\nimport type { PrinterFactoryOptions } from '@kubb/core'\nimport { definePrinter } from '@kubb/core'\nimport { safePrint } from '@kubb/fabric-core/parsers/typescript'\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'\n\ntype TsOptions = {\n /**\n * @default `'questionToken'`\n */\n optionalType: PluginTs['resolvedOptions']['optionalType']\n /**\n * @default `'array'`\n */\n arrayType: PluginTs['resolvedOptions']['arrayType']\n /**\n * @default `'inlineLiteral'`\n */\n enumType: PluginTs['resolvedOptions']['enumType']\n /**\n * Suffix appended to the generated type alias name when `enumType` is `asConst` or `asPascalConst`.\n *\n * @default `'Key'`\n */\n enumTypeSuffix?: PluginTs['resolvedOptions']['enumTypeSuffix']\n /**\n * Controls whether a `type` alias or `interface` declaration is emitted.\n * @default `'type'`\n */\n syntaxType?: PluginTs['resolvedOptions']['syntaxType']\n /**\n * When set, `printer.print(node)` produces a full `type Name = …` declaration.\n * When omitted, `printer.print(node)` returns the raw type node.\n */\n name?: string\n\n /**\n * JSDoc `@description` comment added to the generated type or interface declaration.\n */\n description?: string\n /**\n * Property keys to exclude from the generated type via `Omit<Type, Keys>`.\n * Forces type-alias syntax even when `syntaxType` is `'interface'`.\n */\n keysToOmit?: Array<string>\n /**\n * Resolver used to transform raw schema names into valid TypeScript identifiers.\n */\n resolver: ResolverTs\n /**\n * Names of top-level schemas that are enums.\n * When set, the `ref` handler uses the suffixed type name (e.g. `StatusKey`) for enum refs\n * instead of the plain PascalCase name, so imports align with what the enum file actually exports.\n */\n enumSchemaNames?: Set<string>\n}\n\n/**\n * TypeScript printer factory options: maps `SchemaNode` → `ts.TypeNode` (raw) or `ts.Node` (full declaration).\n */\ntype TsPrinter = PrinterFactoryOptions<'typescript', TsOptions, ts.TypeNode, string>\n\n/**\n * Converts a primitive const value to a TypeScript literal type node.\n * Handles negative numbers via a prefix unary expression.\n */\nfunction constToTypeNode(value: string | number | boolean, format: 'string' | 'number' | 'boolean'): ts.TypeNode | undefined {\n if (format === 'boolean') {\n return factory.createLiteralTypeNode(value === true ? factory.createTrue() : factory.createFalse())\n }\n if (format === 'number' && typeof value === 'number') {\n if (value < 0) {\n return factory.createLiteralTypeNode(factory.createPrefixUnaryExpression(factory.SyntaxKind.MinusToken, factory.createNumericLiteral(Math.abs(value))))\n }\n return factory.createLiteralTypeNode(factory.createNumericLiteral(value))\n }\n return factory.createLiteralTypeNode(factory.createStringLiteral(String(value)))\n}\n\n/**\n * Returns a `Date` reference type node when `representation` is `'date'`, otherwise falls back to `string`.\n */\nfunction dateOrStringNode(node: { representation?: string }): ts.TypeNode {\n return node.representation === 'date' ? factory.createTypeReferenceNode(factory.createIdentifier('Date')) : factory.keywordTypeNodes.string\n}\n\n/**\n * Maps an array of `SchemaNode`s through the printer, filtering out `null` and `undefined` results.\n */\nfunction buildMemberNodes(members: Array<SchemaNode> | undefined, print: (node: SchemaNode) => ts.TypeNode | null | undefined): 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 */\nfunction buildTupleNode(node: ArraySchemaNode, print: (node: 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 ? factory.createOptionalTypeNode(item) : item))\n }\n\n if (max === undefined && restNode) {\n items.push(factory.createRestTypeNode(factory.createArrayTypeNode(restNode)))\n }\n\n return factory.createTupleTypeNode(items)\n}\n\n/**\n * Applies `nullable` and optional/nullish `| undefined` union modifiers to a property's resolved base type.\n */\nfunction buildPropertyType(schema: SchemaNode, baseType: ts.TypeNode, optionalType: TsOptions['optionalType']): ts.TypeNode {\n const addsUndefined = OPTIONAL_ADDS_UNDEFINED.has(optionalType)\n\n let type = baseType\n\n if (schema.nullable) {\n type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.null] })\n }\n\n if ((schema.nullish || schema.optional) && addsUndefined) {\n type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.undefined] })\n }\n\n return type\n}\n\n/**\n * Collects JSDoc annotation strings (description, deprecated, min/max, pattern, default, example, type) for a schema node.\n */\nfunction buildPropertyJSDocComments(schema: SchemaNode): Array<string | undefined> {\n const isArray = schema.type === 'array'\n\n return [\n 'description' in schema && schema.description ? `@description ${jsStringEscape(schema.description)}` : undefined,\n 'deprecated' in schema && schema.deprecated ? '@deprecated' : undefined,\n // minItems/maxItems on arrays should not be emitted as @minLength/@maxLength\n !isArray && 'min' in schema && schema.min !== undefined ? `@minLength ${schema.min}` : undefined,\n !isArray && 'max' in schema && schema.max !== undefined ? `@maxLength ${schema.max}` : undefined,\n 'pattern' in schema && schema.pattern ? `@pattern ${schema.pattern}` : undefined,\n 'default' in schema && schema.default !== undefined\n ? `@default ${'primitive' in schema && schema.primitive === 'string' ? stringify(schema.default as string) : schema.default}`\n : undefined,\n 'example' in schema && schema.example !== undefined ? `@example ${schema.example}` : undefined,\n 'primitive' in schema && schema.primitive\n ? [`@type ${schema.primitive || 'unknown'}`, 'optional' in schema && schema.optional ? ' | undefined' : undefined].filter(Boolean).join('')\n : undefined,\n ]\n}\n\n/**\n * Creates TypeScript index signatures for `additionalProperties` and `patternProperties` on an object schema node.\n */\nfunction buildIndexSignatures(\n node: { additionalProperties?: SchemaNode | boolean; patternProperties?: Record<string, SchemaNode> },\n propertyCount: number,\n print: (node: 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) ?? factory.keywordTypeNodes.unknown\n\n elements.push(factory.createIndexSignature(propertyCount > 0 ? factory.keywordTypeNodes.unknown : additionalType))\n } else if (node.additionalProperties === true) {\n elements.push(factory.createIndexSignature(factory.keywordTypeNodes.unknown))\n }\n\n if (node.patternProperties) {\n const first = Object.values(node.patternProperties)[0]\n if (first) {\n let patternType = print(first) ?? factory.keywordTypeNodes.unknown\n\n if (first.nullable) {\n patternType = factory.createUnionDeclaration({ nodes: [patternType, factory.keywordTypeNodes.null] })\n }\n elements.push(factory.createIndexSignature(patternType))\n }\n }\n\n return elements\n}\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 = definePrinter<TsPrinter>((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 datetime: () => factory.keywordTypeNodes.string,\n number: () => factory.keywordTypeNodes.number,\n integer: () => factory.keywordTypeNodes.number,\n bigint: () => factory.keywordTypeNodes.bigint,\n date: dateOrStringNode,\n time: 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 ? (node.ref.split('/').at(-1) ?? 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 } as SchemaNode, 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)\n .map((value) => 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 as unknown as SchemaNode, 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 = narrowSchema(m, schemaTypes.enum)\n return enumNode?.primitive === 'string'\n })\n const hasPlainString = members.some((m) => isStringType(m))\n\n if (hasStringLiteral && hasPlainString) {\n const memberNodes = members\n .map((m) => {\n if (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: buildMemberNodes(members, this.transform) }) ?? undefined\n },\n intersection(node) {\n return factory.createIntersectionDeclaration({ withParentheses: true, nodes: 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 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 = buildPropertyType(prop.schema, baseType, options.optionalType)\n\n const propertyNode = factory.createPropertySignature({\n questionToken: prop.schema.optional || prop.schema.nullish ? addsQuestionToken : false,\n name: prop.name,\n type,\n readOnly: prop.schema.readOnly,\n })\n\n return factory.appendJSDocToNode({ node: propertyNode, comments: buildPropertyJSDocComments(prop.schema) })\n })\n\n const allElements = [...propertyNodes, ...buildIndexSignatures(node, propertyNodes.length, transform)]\n\n if (!allElements.length) {\n return factory.keywordTypeNodes.object\n }\n\n return factory.createTypeLiteralNode(allElements)\n },\n },\n print(node) {\n let type = this.transform(node)\n\n if (!type) {\n return null\n }\n\n // Apply top-level nullable / optional union modifiers.\n if (node.nullable) {\n type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.null] })\n }\n\n if ((node.nullish || node.optional) && addsUndefined) {\n type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.undefined] })\n }\n\n // Without name, return the type node as-is (no declaration wrapping).\n const { name, syntaxType = 'type', description, keysToOmit } = this.options\n if (!name) {\n return safePrint(type)\n }\n\n const useTypeGeneration = syntaxType === 'type' || type.kind === factory.syntaxKind.union || !!keysToOmit?.length\n\n const typeNode = factory.createTypeDeclaration({\n name,\n isExportable: true,\n type: keysToOmit?.length\n ? factory.createOmitDeclaration({\n keys: keysToOmit,\n type,\n nonNullable: true,\n })\n : type,\n syntax: useTypeGeneration ? 'type' : 'interface',\n comments: [\n node?.title ? jsStringEscape(node.title) : undefined,\n description ? `@description ${jsStringEscape(description)}` : undefined,\n node?.deprecated ? '@deprecated' : undefined,\n node && 'min' in node && node.min !== undefined ? `@minLength ${node.min}` : undefined,\n node && 'max' in node && node.max !== undefined ? `@maxLength ${node.max}` : undefined,\n node && 'pattern' in node && node.pattern ? `@pattern ${node.pattern}` : undefined,\n node?.default ? `@default ${node.default}` : undefined,\n node?.example ? `@example ${node.example}` : undefined,\n ],\n })\n\n return safePrint(typeNode)\n },\n }\n})\n","import { collect, narrowSchema, schemaTypes } from '@kubb/ast'\nimport type { EnumSchemaNode, SchemaNode } from '@kubb/ast/types'\nimport { File } from '@kubb/react-fabric'\nimport type { FabricReactNode } from '@kubb/react-fabric/types'\nimport { printerTs } from '../printers/printerTs.ts'\nimport type { PluginTs } from '../types.ts'\nimport { Enum, getEnumNames } from './Enum.tsx'\n\ntype Props = {\n name: string\n node: SchemaNode\n optionalType: PluginTs['resolvedOptions']['optionalType']\n arrayType: PluginTs['resolvedOptions']['arrayType']\n enumType: PluginTs['resolvedOptions']['enumType']\n enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix']\n enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing']\n syntaxType: PluginTs['resolvedOptions']['syntaxType']\n resolver: PluginTs['resolver']\n description?: string\n keysToOmit?: string[]\n /**\n * Names of top-level schemas that are enums.\n * Used so the printer's `ref` handler can use the suffixed type name (e.g. `StatusKey`)\n * instead of the plain PascalCase name (e.g. `Status`) when resolving `$ref` enum targets.\n */\n enumSchemaNames?: Set<string>\n}\n\nexport function Type({\n name,\n node,\n keysToOmit,\n optionalType,\n arrayType,\n syntaxType,\n enumType,\n enumTypeSuffix,\n enumKeyCasing,\n description,\n resolver,\n enumSchemaNames,\n}: Props): FabricReactNode {\n const resolvedDescription = description || node?.description\n const enumSchemaNodes = collect<EnumSchemaNode>(node, {\n schema(n): EnumSchemaNode | undefined {\n const enumNode = narrowSchema(n, schemaTypes.enum)\n if (enumNode?.name) return enumNode\n },\n })\n\n const printer = printerTs({\n optionalType,\n arrayType,\n enumType,\n enumTypeSuffix,\n name,\n syntaxType,\n description: resolvedDescription,\n keysToOmit,\n resolver,\n enumSchemaNames,\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 }) => <Enum node={node} enumType={enumType} enumTypeSuffix={enumTypeSuffix} enumKeyCasing={enumKeyCasing} resolver={resolver} />)}\n {shouldExportType && (\n <File.Source name={name} isTypeOnly isExportable isIndexable>\n {output}\n </File.Source>\n )}\n </>\n )\n}\n","import { createProperty, createSchema } from '@kubb/ast'\nimport type { OperationNode, ParameterNode, SchemaNode } from '@kubb/ast/types'\nimport type { ResolverTs } from './types.ts'\n\ntype BuildParamsSchemaOptions = {\n params: Array<ParameterNode>\n node: OperationNode\n resolver: ResolverTs\n}\n\ntype BuildOperationSchemaOptions = {\n node: OperationNode\n resolver: ResolverTs\n}\n\nexport function buildParams({ params, node, resolver }: BuildParamsSchemaOptions): SchemaNode {\n return createSchema({\n type: 'object',\n properties: params.map((param) =>\n createProperty({\n name: param.name,\n required: param.required,\n schema: createSchema({\n type: 'ref',\n name: resolver.resolveParamName(node, param),\n }),\n }),\n ),\n })\n}\n\nexport function buildData({ node, resolver }: BuildOperationSchemaOptions): 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 createSchema({\n type: 'object',\n deprecated: node.deprecated,\n properties: [\n createProperty({\n name: 'data',\n schema: node.requestBody?.schema\n ? createSchema({ type: 'ref', name: resolver.resolveDataName(node), optional: true })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'pathParams',\n required: pathParams.length > 0,\n schema: pathParams.length > 0 ? buildParams({ params: pathParams, node, resolver }) : createSchema({ type: 'never' }),\n }),\n createProperty({\n name: 'queryParams',\n schema:\n queryParams.length > 0\n ? createSchema({ ...buildParams({ params: queryParams, node, resolver }), optional: true })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'headerParams',\n schema:\n headerParams.length > 0\n ? createSchema({ ...buildParams({ params: headerParams, node, resolver }), optional: true })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'url',\n required: true,\n schema: createSchema({ type: 'url', path: node.path }),\n }),\n ],\n })\n}\n\nexport function buildResponses({ node, resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n if (node.responses.length === 0) {\n return null\n }\n\n return createSchema({\n type: 'object',\n properties: node.responses.map((res) =>\n createProperty({\n name: String(res.statusCode),\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) }),\n }),\n ),\n })\n}\n\nexport function buildResponseUnion({ node, resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n const responsesWithSchema = node.responses.filter((res) => res.schema)\n\n if (responsesWithSchema.length === 0) {\n return null\n }\n\n return createSchema({\n type: 'union',\n members: responsesWithSchema.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) })),\n })\n}\n","import path from 'node:path'\nimport { caseParams, composeTransformers, narrowSchema, schemaTypes, transform } from '@kubb/ast'\nimport type { SchemaNode } from '@kubb/ast/types'\nimport { defineGenerator, getMode } from '@kubb/core'\nimport { File } from '@kubb/react-fabric'\nimport { Type } from '../components/Type.tsx'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX } from '../constants.ts'\nimport type { PluginTs } from '../types'\nimport { buildData, buildResponses, buildResponseUnion } from '../utils.ts'\n\nexport const typeGenerator = defineGenerator<PluginTs>({\n name: 'typescript',\n type: 'react',\n Operation({ node, adapter, options, config, resolver }) {\n const { enumType, enumTypeSuffix, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, output, transformers = [] } = options\n\n const root = path.resolve(config.root, config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n\n const file = resolver.resolveFile({ name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group })\n\n const params = caseParams(node.parameters, paramsCasing)\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.rootNode?.schemas ?? []).filter((s) => narrowSchema(s, 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 } as SchemaNode, enumTypeSuffix)\n }\n return resolver.default(schemaName, 'type')\n }\n\n function renderSchemaType({\n node: schemaNode,\n name,\n description,\n keysToOmit,\n }: {\n node: SchemaNode | null\n name: string\n description?: string\n keysToOmit?: Array<string>\n }) {\n if (!schemaNode) {\n return null\n }\n\n const transformedNode = transform(schemaNode, composeTransformers(...transformers))\n\n const imports = adapter.getImports(transformedNode, (schemaName) => ({\n name: resolveImportName(schemaName),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group }).path,\n }))\n\n return (\n <>\n {mode === 'split' &&\n imports.map((imp) => <File.Import key={[name, imp.path, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} isTypeOnly />)}\n <Type\n name={name}\n node={transformedNode}\n description={description}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n keysToOmit={keysToOmit}\n enumSchemaNames={enumSchemaNames}\n />\n </>\n )\n }\n\n const paramTypes = params.map((param) =>\n renderSchemaType({\n node: param.schema,\n name: resolver.resolveParamName(node, param),\n }),\n )\n\n const requestType = node.requestBody?.schema\n ? renderSchemaType({\n node: node.requestBody.schema,\n name: resolver.resolveDataName(node),\n description: node.requestBody.description ?? node.requestBody.schema.description,\n keysToOmit: node.requestBody.keysToOmit,\n })\n : null\n\n const responseTypes = node.responses.map((res) =>\n renderSchemaType({\n node: res.schema,\n name: resolver.resolveResponseStatusName(node, res.statusCode),\n description: res.description,\n keysToOmit: res.keysToOmit,\n }),\n )\n\n const dataType = renderSchemaType({\n node: buildData({ node: { ...node, parameters: params }, resolver }),\n name: resolver.resolveRequestConfigName(node),\n })\n\n const responsesType = renderSchemaType({\n node: buildResponses({ node, resolver }),\n name: resolver.resolveResponsesName(node),\n })\n\n const responseType = renderSchemaType({\n node: buildResponseUnion({ node, resolver }),\n name: resolver.resolveResponseName(node),\n description: 'Union of all possible responses',\n })\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={resolver.resolveBanner(adapter.rootNode, { output, config })}\n footer={resolver.resolveFooter(adapter.rootNode, { output, config })}\n >\n {paramTypes}\n {responseTypes}\n {requestType}\n {dataType}\n {responsesType}\n {responseType}\n </File>\n )\n },\n Schema({ node, adapter, options, config, resolver }) {\n const { enumType, enumTypeSuffix, enumKeyCasing, syntaxType, optionalType, arrayType, output, group, transformers = [] } = options\n\n const root = path.resolve(config.root, config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n\n if (!node.name) {\n return\n }\n\n const transformedNode = transform(node, composeTransformers(...transformers))\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.rootNode?.schemas ?? []).filter((s) => narrowSchema(s, 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 } as SchemaNode, enumTypeSuffix)\n }\n return resolver.default(schemaName, 'type')\n }\n\n const imports = adapter.getImports(transformedNode, (schemaName) => ({\n name: resolveImportName(schemaName),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group }).path,\n }))\n\n const isEnumSchema = !!narrowSchema(node, schemaTypes.enum)\n\n const name = ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema ? resolver.resolveEnumKeyName(node, enumTypeSuffix) : resolver.resolveName(node.name)\n\n const type = {\n name,\n file: resolver.resolveFile({ name: node.name, extname: '.ts' }, { root, output, group }),\n } as const\n\n return (\n <File\n baseName={type.file.baseName}\n path={type.file.path}\n meta={type.file.meta}\n banner={resolver.resolveBanner(adapter.rootNode, { output, config })}\n footer={resolver.resolveFooter(adapter.rootNode, { output, config })}\n >\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[node.name, imp.path, imp.isTypeOnly].join('-')} root={type.file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\n <Type\n name={type.name}\n node={transformedNode}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n enumSchemaNames={enumSchemaNames}\n />\n </File>\n )\n },\n})\n","import { pascalCase } from '@internals/utils'\nimport { defineResolver } from '@kubb/core'\nimport type { PluginTs } from '../types.ts'\n\nfunction resolveName(name: string, type?: 'file' | 'function' | 'type' | 'const'): string {\n return pascalCase(name, { isFile: type === 'file' })\n}\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>(() => {\n return {\n name: 'default',\n pluginName: 'plugin-ts',\n default(name, type) {\n return resolveName(name, type)\n },\n resolveName(name) {\n return this.default(name, 'function')\n },\n resolvePathName(name, type) {\n return this.default(name, type)\n },\n resolveParamName(node, param) {\n return this.resolveName(`${node.operationId} ${param.in} ${param.name}`)\n },\n resolveResponseStatusName(node, statusCode) {\n return this.resolveName(`${node.operationId} Status ${statusCode}`)\n },\n resolveDataName(node) {\n return this.resolveName(`${node.operationId} Data`)\n },\n resolveRequestConfigName(node) {\n return this.resolveName(`${node.operationId} RequestConfig`)\n },\n resolveResponsesName(node) {\n return this.resolveName(`${node.operationId} Responses`)\n },\n resolveResponseName(node) {\n return this.resolveName(`${node.operationId} Response`)\n },\n resolveEnumKeyName(node, enumTypeSuffix = 'key') {\n return `${this.resolveName(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 { defineResolver } from '@kubb/core'\nimport type { PluginTs } from '../types.ts'\nimport { resolverTs } from './resolverTs.ts'\n\n/**\n * Legacy resolver for `@kubb/plugin-ts` that reproduces the naming conventions\n * used before the v2 resolver refactor. Enable via `compatibilityPreset: 'kubbV4'`\n * (or by composing this resolver manually).\n *\n * Key differences from the default resolver:\n * - Response status types: `<OperationId><StatusCode>` (e.g. `CreatePets201`) instead of `<OperationId>Status201`\n * - Default/error responses: `<OperationId>Error` instead of `<OperationId>StatusDefault`\n * - Request body: `<OperationId>MutationRequest` (non-GET) / `<OperationId>QueryRequest` (GET)\n * - Combined responses type: `<OperationId>Mutation` / `<OperationId>Query`\n * - Response union: `<OperationId>MutationResponse` / `<OperationId>QueryResponse`\n *\n * @example\n * ```ts\n * import { resolverTsLegacy } from '@kubb/plugin-ts'\n *\n * resolverTsLegacy.resolveResponseStatusTypedName(node, 201) // → 'CreatePets201'\n * resolverTsLegacy.resolveResponseStatusTypedName(node, 'default') // → 'CreatePetsError'\n * resolverTsLegacy.resolveDataTypedName(node) // → 'CreatePetsMutationRequest' (POST)\n * resolverTsLegacy.resolveResponsesTypedName(node) // → 'CreatePetsMutation' (POST)\n * resolverTsLegacy.resolveResponseTypedName(node) // → 'CreatePetsMutationResponse' (POST)\n * ```\n */\nexport const resolverTsLegacy = defineResolver<PluginTs>(() => {\n return {\n ...resolverTs,\n pluginName: 'plugin-ts',\n resolveResponseStatusName(node, statusCode) {\n if (statusCode === 'default') {\n return this.resolveName(`${node.operationId} Error`)\n }\n return this.resolveName(`${node.operationId} ${statusCode}`)\n },\n resolveDataName(node) {\n const suffix = node.method === 'GET' ? 'QueryRequest' : 'MutationRequest'\n return this.resolveName(`${node.operationId} ${suffix}`)\n },\n resolveResponsesName(node) {\n const suffix = node.method === 'GET' ? 'Query' : 'Mutation'\n return this.resolveName(`${node.operationId} ${suffix}`)\n },\n resolveResponseName(node) {\n const suffix = node.method === 'GET' ? 'QueryResponse' : 'MutationResponse'\n return this.resolveName(`${node.operationId} ${suffix}`)\n },\n resolvePathParamsName(node, _param) {\n return this.resolveName(`${node.operationId} PathParams`)\n },\n resolveQueryParamsName(node, _param) {\n return this.resolveName(`${node.operationId} QueryParams`)\n },\n resolveHeaderParamsName(node, _param) {\n return this.resolveName(`${node.operationId} HeaderParams`)\n },\n }\n})\n","import path from 'node:path'\nimport { pascalCase } from '@internals/utils'\nimport { caseParams, composeTransformers, createProperty, createSchema, narrowSchema, schemaTypes, transform } from '@kubb/ast'\nimport type { OperationNode, ParameterNode, SchemaNode } from '@kubb/ast/types'\nimport { defineGenerator, getMode } from '@kubb/core'\nimport { File } from '@kubb/react-fabric'\nimport { Type } from '../components/Type.tsx'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX } from '../constants.ts'\nimport { resolverTsLegacy } from '../resolvers/resolverTsLegacy.ts'\nimport type { PluginTs, ResolverTs } from '../types'\n\ntype BuildGroupedParamsSchemaOptions = {\n params: Array<ParameterNode>\n parentName?: string\n}\n\nfunction buildGroupedParamsSchema({ params, parentName }: BuildGroupedParamsSchemaOptions): SchemaNode {\n return createSchema({\n type: 'object',\n properties: params.map((param) => {\n let schema = param.schema\n if (narrowSchema(schema, 'enum') && !schema.name && parentName) {\n schema = { ...schema, name: pascalCase([parentName, param.name, 'enum'].join(' ')) }\n }\n return createProperty({\n name: param.name,\n required: param.required,\n schema,\n })\n }),\n })\n}\n\ntype BuildOperationSchemaOptions = {\n node: OperationNode\n resolver: ResolverTs\n}\n\nfunction buildLegacyResponsesSchemaNode({ node, resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n const isGet = node.method.toLowerCase() === 'get'\n const successResponses = node.responses.filter((res) => {\n const code = Number(res.statusCode)\n return !Number.isNaN(code) && code >= 200 && code < 300\n })\n const errorResponses = node.responses.filter((res) => res.statusCode === 'default' || Number(res.statusCode) >= 400)\n\n const responseSchema =\n successResponses.length > 0\n ? successResponses.length === 1\n ? createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, successResponses[0]!.statusCode) })\n : createSchema({\n type: 'union',\n members: successResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) })),\n })\n : createSchema({ type: 'any' })\n\n const errorsSchema =\n errorResponses.length > 0\n ? errorResponses.length === 1\n ? createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, errorResponses[0]!.statusCode) })\n : createSchema({\n type: 'union',\n members: errorResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) })),\n })\n : createSchema({ type: 'any' })\n\n const properties = [createProperty({ name: 'Response', required: true, schema: responseSchema })]\n\n if (!isGet && node.requestBody?.schema) {\n properties.push(\n createProperty({\n name: 'Request',\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolveDataName(node) }),\n }),\n )\n }\n\n const queryParam = node.parameters.find((p) => p.in === 'query')\n if (queryParam) {\n properties.push(\n createProperty({\n name: 'QueryParams',\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolveQueryParamsName(node, queryParam) }),\n }),\n )\n }\n\n const pathParam = node.parameters.find((p) => p.in === 'path')\n if (pathParam) {\n properties.push(\n createProperty({\n name: 'PathParams',\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolvePathParamsName(node, pathParam) }),\n }),\n )\n }\n\n const headerParam = node.parameters.find((p) => p.in === 'header')\n if (headerParam) {\n properties.push(\n createProperty({\n name: 'HeaderParams',\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolveHeaderParamsName(node, headerParam) }),\n }),\n )\n }\n\n properties.push(createProperty({ name: 'Errors', required: true, schema: errorsSchema }))\n\n return createSchema({ type: 'object', properties })\n}\n\nfunction buildLegacyResponseUnionSchemaNode({ node, resolver }: BuildOperationSchemaOptions): SchemaNode {\n const successResponses = node.responses.filter((res) => {\n const code = Number(res.statusCode)\n return !Number.isNaN(code) && code >= 200 && code < 300\n })\n\n if (successResponses.length === 0) {\n return createSchema({ type: 'any' })\n }\n\n if (successResponses.length === 1) {\n return createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, successResponses[0]!.statusCode) })\n }\n\n return createSchema({\n type: 'union',\n members: successResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) })),\n })\n}\n\nfunction nameUnnamedEnums(node: SchemaNode, parentName: string): SchemaNode {\n return transform(node, {\n schema(n) {\n const enumNode = narrowSchema(n, 'enum')\n if (enumNode && !enumNode.name) {\n return { ...enumNode, name: pascalCase([parentName, 'enum'].join(' ')) }\n }\n return undefined\n },\n property(p) {\n const enumNode = narrowSchema(p.schema, 'enum')\n if (enumNode && !enumNode.name) {\n return {\n ...p,\n schema: { ...enumNode, name: pascalCase([parentName, p.name, 'enum'].join(' ')) },\n }\n }\n return undefined\n },\n })\n}\n\nexport const typeGeneratorLegacy = defineGenerator<PluginTs>({\n name: 'typescript-legacy',\n type: 'react',\n Operation({ node, adapter, options, config, resolver }) {\n const { enumType, enumTypeSuffix, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, output, transformers = [] } = options\n\n const root = path.resolve(config.root, config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n\n const file = resolver.resolveFile({ name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group })\n const params = caseParams(node.parameters, paramsCasing)\n\n function renderSchemaType({\n node: schemaNode,\n name,\n description,\n keysToOmit,\n }: {\n node: SchemaNode | null\n name: string\n description?: string\n keysToOmit?: Array<string>\n }) {\n if (!schemaNode) {\n return null\n }\n\n const transformedNode = transform(schemaNode, composeTransformers(...transformers))\n\n const imports = adapter.getImports(transformedNode, (schemaName) => ({\n name: resolver.default(schemaName, 'type'),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group }).path,\n }))\n\n return (\n <>\n {mode === 'split' &&\n imports.map((imp) => <File.Import key={[name, imp.path, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} isTypeOnly />)}\n <Type\n name={name}\n node={transformedNode}\n description={description}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n keysToOmit={keysToOmit}\n />\n </>\n )\n }\n\n const pathParams = params.filter((p) => p.in === 'path')\n const queryParams = params.filter((p) => p.in === 'query')\n const headerParams = params.filter((p) => p.in === 'header')\n\n const responseTypes = node.responses.map((res) => {\n const responseName = resolver.resolveResponseStatusName(node, res.statusCode)\n const baseResponseName = resolverTsLegacy.resolveResponseStatusName(node, res.statusCode)\n\n return renderSchemaType({\n node: res.schema ? nameUnnamedEnums(res.schema, baseResponseName) : res.schema,\n name: responseName,\n description: res.description,\n keysToOmit: res.keysToOmit,\n })\n })\n\n const requestType = node.requestBody?.schema\n ? renderSchemaType({\n node: nameUnnamedEnums(node.requestBody.schema, resolverTsLegacy.resolveDataName(node)),\n name: resolver.resolveDataName(node),\n description: node.requestBody.description ?? node.requestBody.schema.description,\n keysToOmit: node.requestBody.keysToOmit,\n })\n : null\n\n const legacyParamTypes = [\n pathParams.length > 0\n ? renderSchemaType({\n node: buildGroupedParamsSchema({ params: pathParams, parentName: resolverTsLegacy.resolvePathParamsName(node, pathParams[0]!) }),\n name: resolver.resolvePathParamsName(node, pathParams[0]!),\n })\n : null,\n queryParams.length > 0\n ? renderSchemaType({\n node: buildGroupedParamsSchema({ params: queryParams, parentName: resolverTsLegacy.resolveQueryParamsName(node, queryParams[0]!) }),\n name: resolver.resolveQueryParamsName(node, queryParams[0]!),\n })\n : null,\n headerParams.length > 0\n ? renderSchemaType({\n node: buildGroupedParamsSchema({ params: headerParams, parentName: resolverTsLegacy.resolveHeaderParamsName(node, headerParams[0]!) }),\n name: resolver.resolveHeaderParamsName(node, headerParams[0]!),\n })\n : null,\n ]\n\n const legacyResponsesType = renderSchemaType({\n node: buildLegacyResponsesSchemaNode({ node, resolver }),\n name: resolver.resolveResponsesName(node),\n })\n\n const legacyResponseType = renderSchemaType({\n node: buildLegacyResponseUnionSchemaNode({ node, resolver }),\n name: resolver.resolveResponseName(node),\n })\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={resolver.resolveBanner(adapter.rootNode, { output, config })}\n footer={resolver.resolveFooter(adapter.rootNode, { output, config })}\n >\n {legacyParamTypes}\n {responseTypes}\n {requestType}\n {legacyResponseType}\n {legacyResponsesType}\n </File>\n )\n },\n Schema({ node, adapter, options, config, resolver }) {\n const { enumType, enumTypeSuffix, enumKeyCasing, syntaxType, optionalType, arrayType, output, group, transformers = [] } = options\n\n const root = path.resolve(config.root, config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n\n if (!node.name) {\n return\n }\n\n const transformedNode = transform(node, composeTransformers(...transformers))\n\n const imports = adapter.getImports(transformedNode, (schemaName) => ({\n name: resolver.default(schemaName, 'type'),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group }).path,\n }))\n\n const isEnumSchema = !!narrowSchema(node, schemaTypes.enum)\n\n const name = ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema ? resolver.resolveEnumKeyName(node, enumTypeSuffix) : resolver.resolveName(node.name)\n\n const type = {\n name,\n file: resolver.resolveFile({ name: node.name, extname: '.ts' }, { root, output, group }),\n } as const\n\n return (\n <File\n baseName={type.file.baseName}\n path={type.file.path}\n meta={type.file.meta}\n banner={resolver.resolveBanner(adapter.rootNode, { output, config })}\n footer={resolver.resolveFooter(adapter.rootNode, { output, config })}\n >\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[node.name, imp.path, imp.isTypeOnly].join('-')} root={type.file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\n <Type\n name={type.name}\n node={transformedNode}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n />\n </File>\n )\n },\n})\n","import { definePresets } from '@kubb/core'\nimport { typeGenerator } from './generators/typeGenerator.tsx'\nimport { typeGeneratorLegacy } from './generators/typeGeneratorLegacy.tsx'\nimport { resolverTs } from './resolvers/resolverTs.ts'\nimport { resolverTsLegacy } from './resolvers/resolverTsLegacy.ts'\nimport type { ResolverTs } from './types.ts'\n\n/**\n * Built-in preset registry for `@kubb/plugin-ts`.\n *\n * - `default` — uses `resolverTs` and `typeGenerator` (current naming conventions).\n * - `kubbV4` — uses `resolverTsLegacy` and `typeGeneratorLegacy` (Kubb v4 naming conventions).\n */\nexport const presets = definePresets<ResolverTs>({\n default: {\n name: 'default',\n resolvers: [resolverTs],\n generators: [typeGenerator],\n },\n kubbV4: {\n name: 'kubbV4',\n resolvers: [resolverTsLegacy],\n generators: [typeGeneratorLegacy],\n },\n})\n","import path from 'node:path'\nimport { camelCase } from '@internals/utils'\nimport { walk } from '@kubb/ast'\nimport { createPlugin, type Group, getBarrelFiles, getPreset, renderOperation, renderSchema } from '@kubb/core'\nimport { presets } from './presets.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 = createPlugin<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 compatibilityPreset = 'default',\n resolvers: userResolvers = [],\n transformers: userTransformers = [],\n generators: userGenerators = [],\n } = options\n\n const preset = getPreset({\n preset: compatibilityPreset,\n presets: presets,\n resolvers: userResolvers,\n transformers: userTransformers,\n generators: userGenerators,\n })\n\n let resolveNameWarning = false\n let resolvePathWarning = false\n\n return {\n name: pluginTsName,\n get resolver() {\n return preset.resolver\n },\n get options() {\n return {\n output,\n optionalType,\n group: group\n ? ({\n ...options.group,\n name: (ctx) => {\n if (options.group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n },\n } as Group)\n : undefined,\n arrayType,\n enumType,\n enumTypeSuffix,\n enumKeyCasing,\n syntaxType,\n paramsCasing,\n transformers: preset.transformers,\n }\n },\n resolvePath(baseName, pathMode, options) {\n if (!resolvePathWarning) {\n this.events.emit('warn', 'Do not use resolvePath for pluginTs, use resolverTs.resolvePath instead')\n resolvePathWarning = true\n }\n\n return this.plugin.resolver.resolvePath(\n { baseName, pathMode, tag: options?.group?.tag, path: options?.group?.path },\n { root: path.resolve(this.config.root, this.config.output.path), output, group: this.plugin.options.group },\n )\n },\n resolveName(name, type) {\n if (!resolveNameWarning) {\n this.events.emit('warn', 'Do not use resolveName for pluginTs, use resolverTs.default instead')\n resolveNameWarning = true\n }\n\n return this.plugin.resolver.default(name, type)\n },\n async install() {\n const { config, fabric, plugin, adapter, rootNode, driver, openInStudio, resolver } = this\n\n const root = path.resolve(config.root, config.output.path)\n\n if (!adapter) {\n throw new Error('Plugin cannot work without adapter being set')\n }\n\n await openInStudio({ ast: true })\n\n await walk(rootNode, {\n depth: 'shallow',\n async schema(schemaNode) {\n const writeTasks = preset.generators.map(async (generator) => {\n if (generator.type === 'react' && generator.version === '2') {\n const options = resolver.resolveOptions(schemaNode, { options: plugin.options, exclude, include, override })\n\n if (options === null) {\n return\n }\n\n await renderSchema(schemaNode, {\n options,\n resolver,\n adapter,\n config,\n fabric,\n Component: generator.Schema,\n plugin,\n driver,\n })\n }\n })\n\n await Promise.all(writeTasks)\n },\n async operation(operationNode) {\n const writeTasks = preset.generators.map(async (generator) => {\n if (generator.type === 'react' && generator.version === '2') {\n const options = resolver.resolveOptions(operationNode, { options: plugin.options, exclude, include, override })\n\n if (options === null) {\n return\n }\n\n await renderOperation(operationNode, {\n options,\n resolver,\n adapter,\n config,\n fabric,\n Component: generator.Operation,\n plugin,\n driver,\n })\n }\n })\n\n await Promise.all(writeTasks)\n },\n })\n\n const barrelFiles = await getBarrelFiles(this.fabric.files, {\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginName: this.plugin.name,\n },\n })\n\n await this.upsertFile(...barrelFiles)\n },\n }\n})\n","import type { PrinterFactoryOptions } from '@kubb/ast'\nimport { createPrinterFactory } from '@kubb/ast'\nimport type { FunctionNode, FunctionNodeType, FunctionParameterNode, FunctionParametersNode, ParameterGroupNode, TypeNode } from '@kubb/ast/types'\n\n/**\n * Maps each function-printer handler key to its concrete node type.\n */\nexport type FunctionNodeByType = {\n functionParameter: FunctionParameterNode\n parameterGroup: ParameterGroupNode\n functionParameters: FunctionParametersNode\n type: TypeNode\n}\n\nconst kindToHandlerKey = {\n FunctionParameter: 'functionParameter',\n ParameterGroup: 'parameterGroup',\n FunctionParameters: 'functionParameters',\n Type: 'type',\n} satisfies Record<string, 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 = createPrinterFactory<FunctionNode, FunctionNodeType, FunctionNodeByType>((node) => kindToHandlerKey[node.kind])\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 = PrinterFactoryOptions<'functionParameters', FunctionPrinterOptions, string>\n\nfunction rank(param: FunctionParameterNode | ParameterGroupNode): number {\n if (param.kind === 'ParameterGroup') {\n if (param.default) return 2\n const isOptional = param.optional ?? param.properties.every((p) => p.optional || p.default !== undefined)\n return isOptional ? 1 : 0\n }\n if (param.rest) return 3\n if (param.default) return 2\n return param.optional ? 1 : 0\n}\n\nfunction sortParams(params: ReadonlyArray<FunctionParameterNode | ParameterGroupNode>): Array<FunctionParameterNode | ParameterGroupNode> {\n return [...params].sort((a, b) => rank(a) - rank(b))\n}\n\nfunction sortChildParams(params: Array<FunctionParameterNode>): Array<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 type(node) {\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 return p.optional ? `${p.name}?: ${typeStr}` : `${p.name}: ${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,QAAQ,CAEV,MAAM,gBAAgB,CAAC,OAAO,QAAQ,CAG5D,KAAK,MAAM,MAAM;AAEhB,MADiB,KAAK,SAAS,KA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Y,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,OAAO,CAGnC,KAAK,MAAM,KAAK,UAAU,EAAE,CAAC,CAC7B,OAAO,QAAQ,CACf,KAAK,KAAK;;EAEhB;CACF,EAAE"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["ts","factory.createEnumDeclaration","File","factory.createTypeReferenceNode","factory.createUrlTemplateType","factory.dateOrStringNode","factory.constToTypeNode","factory.createUnionDeclaration","schemaTypes","factory.createIntersectionDeclaration","factory.createTypeLiteralNode","factory.buildMemberNodes","factory.createArrayDeclaration","factory.buildTupleNode","factory.buildPropertyType","factory.createPropertySignature","factory.appendJSDocToNode","factory.buildIndexSignatures","factory.createOmitDeclaration","factory.createTypeDeclaration","schemaTypes","File","path","schemaTypes","File","path","schemaTypes","File","path"],"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/utils.ts","../src/printers/printerTs.ts","../src/components/Type.tsx","../src/generators/typeGenerator.tsx","../src/resolvers/resolverTs.ts","../src/resolvers/resolverTsLegacy.ts","../src/generators/typeGeneratorLegacy.tsx","../src/presets.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 * Returns a masked version of a string, showing only the first and last few characters.\n * Useful for logging sensitive values (tokens, keys) without exposing the full value.\n *\n * @example\n * maskString('KUBB_STUDIO-abc123-xyz789') // 'KUBB_STUDIO-…789'\n */\nexport function maskString(value: string, start = 8, end = 4): string {\n if (value.length <= start + end) return value\n return `${value.slice(0, start)}…${value.slice(-end)}`\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 * Strips functions, symbols, and `undefined` values from plugin options for safe JSON transport.\n *\n * @example\n * ```ts\n * serializePluginOptions({ output: './src', onWrite: () => {} })\n * // { output: './src' } (function stripped)\n * ```\n */\nexport function serializePluginOptions<TOptions extends object>(options: TOptions): TOptions {\n if (options === null || options === undefined) return {} as TOptions\n if (typeof options !== 'object') return options\n if (Array.isArray(options)) return options.map(serializePluginOptions) as unknown as TOptions\n\n const serialized: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(options)) {\n if (typeof value === 'function' || typeof value === 'symbol' || value === undefined) continue\n serialized[key] = value !== null && typeof value === 'object' ? serializePluginOptions(value as object) : value\n }\n return serialized as TOptions\n}\n\n/**\n * Strips all `undefined` values from an object recursively by round-tripping through JSON.\n * Useful for clean inline snapshot assertions that only show fields with actual values.\n *\n * @example\n * toSnapshot({ kind: 'Schema', name: undefined, type: 'string' })\n * // { kind: 'Schema', type: 'string' }\n */\nexport function toSnapshot<T>(value: T): T {\n return JSON.parse(JSON.stringify(value))\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 { syncSchemaRef } from '@kubb/ast'\nimport type { ArraySchemaNode, SchemaNode } from '@kubb/ast/types'\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\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\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\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\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\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 `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\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\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\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 * @link 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\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\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\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\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\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 * In { propertyName: string; name?: string } is `name` being used to make the type more unique when multiple same names are used.\n * @example `import { Pet as Cat } 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\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\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\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\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\nexport const createTypeLiteralNode = factory.createTypeLiteralNode\n\nexport const createTypeReferenceNode = factory.createTypeReferenceNode\nexport const createNumericLiteral = factory.createNumericLiteral\nexport const createStringLiteral = factory.createStringLiteral\n\nexport const createArrayTypeNode = factory.createArrayTypeNode\nexport const createParenthesizedType = factory.createParenthesizedType\n\nexport const createLiteralTypeNode = factory.createLiteralTypeNode\nexport const createNull = factory.createNull\nexport const createIdentifier = factory.createIdentifier\n\nexport const createOptionalTypeNode = factory.createOptionalTypeNode\nexport const createTupleTypeNode = factory.createTupleTypeNode\nexport const createRestTypeNode = factory.createRestTypeNode\nexport const createTrue = factory.createTrue\nexport const createFalse = factory.createFalse\nexport const createIndexedAccessTypeNode = factory.createIndexedAccessTypeNode\nexport const createTypeOperatorNode = factory.createTypeOperatorNode\nexport const createPrefixUnaryExpression = factory.createPrefixUnaryExpression\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(members: Array<SchemaNode> | undefined, print: (node: SchemaNode) => ts.TypeNode | null | undefined): 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: ArraySchemaNode, print: (node: 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: SchemaNode,\n baseType: ts.TypeNode,\n optionalType: 'questionToken' | 'undefined' | 'questionTokenAndUndefined',\n): ts.TypeNode {\n const addsUndefined = OPTIONAL_ADDS_UNDEFINED.has(optionalType)\n const meta = 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?: SchemaNode | boolean; patternProperties?: Record<string, SchemaNode> },\n propertyCount: number,\n print: (node: 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 { EnumSchemaNode } from '@kubb/ast/types'\nimport { safePrint } from '@kubb/fabric-core/parsers/typescript'\nimport { File } from '@kubb/react-fabric'\nimport type { FabricReactNode } from '@kubb/react-fabric/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: EnumSchemaNode\n enumType: PluginTs['resolvedOptions']['enumType']\n enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix']\n enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing']\n resolver: ResolverTs\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: 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): FabricReactNode {\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 { jsStringEscape, stringify } from '@internals/utils'\nimport { createProperty, createSchema, syncSchemaRef } from '@kubb/ast'\nimport type { OperationNode, ParameterNode, SchemaNode } from '@kubb/ast/types'\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: SchemaNode): Array<string | undefined> {\n const meta = 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<ParameterNode>\n resolver: ResolverTs\n}\n\ntype BuildOperationSchemaOptions = {\n resolver: ResolverTs\n}\n\nexport function buildParams(node: OperationNode, { params, resolver }: BuildParamsSchemaOptions): SchemaNode {\n return createSchema({\n type: 'object',\n properties: params.map((param) =>\n createProperty({\n name: param.name,\n required: param.required,\n schema: createSchema({\n type: 'ref',\n name: resolver.resolveParamName(node, param),\n }),\n }),\n ),\n })\n}\n\nexport function buildData(node: OperationNode, { resolver }: BuildOperationSchemaOptions): 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 createSchema({\n type: 'object',\n deprecated: node.deprecated,\n properties: [\n createProperty({\n name: 'data',\n schema: node.requestBody?.schema\n ? createSchema({ type: 'ref', name: resolver.resolveDataName(node), optional: true })\n : createSchema({ type: 'never', primitive: undefined, optional: true }),\n }),\n createProperty({\n name: 'pathParams',\n required: pathParams.length > 0,\n schema: pathParams.length > 0 ? buildParams(node, { params: pathParams, resolver }) : createSchema({ type: 'never', primitive: undefined }),\n }),\n createProperty({\n name: 'queryParams',\n schema:\n queryParams.length > 0\n ? createSchema({ ...buildParams(node, { params: queryParams, resolver }), optional: true })\n : createSchema({ type: 'never', primitive: undefined, optional: true }),\n }),\n createProperty({\n name: 'headerParams',\n schema:\n headerParams.length > 0\n ? createSchema({ ...buildParams(node, { params: headerParams, resolver }), optional: true })\n : createSchema({ type: 'never', primitive: undefined, optional: true }),\n }),\n createProperty({\n name: 'url',\n required: true,\n schema: createSchema({ type: 'url', path: node.path }),\n }),\n ],\n })\n}\n\nexport function buildResponses(node: OperationNode, { resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n if (node.responses.length === 0) {\n return null\n }\n\n return createSchema({\n type: 'object',\n properties: node.responses.map((res) =>\n createProperty({\n name: String(res.statusCode),\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) }),\n }),\n ),\n })\n}\n\nexport function buildResponseUnion(node: OperationNode, { resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n const responsesWithSchema = node.responses.filter((res) => res.schema)\n\n if (responsesWithSchema.length === 0) {\n return null\n }\n\n return createSchema({\n type: 'union',\n members: responsesWithSchema.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) })),\n })\n}\n","import { extractRefName, isStringType, narrowSchema, schemaTypes, syncSchemaRef } from '@kubb/ast'\nimport type { PrinterFactoryOptions } from '@kubb/core'\nimport { definePrinter } from '@kubb/core'\nimport { safePrint } from '@kubb/fabric-core/parsers/typescript'\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\ntype TsOptions = {\n /**\n * @default `'questionToken'`\n */\n optionalType: PluginTs['resolvedOptions']['optionalType']\n /**\n * @default `'array'`\n */\n arrayType: PluginTs['resolvedOptions']['arrayType']\n /**\n * @default `'inlineLiteral'`\n */\n enumType: PluginTs['resolvedOptions']['enumType']\n /**\n * Suffix appended to the generated type alias name when `enumType` is `asConst` or `asPascalConst`.\n *\n * @default `'Key'`\n */\n enumTypeSuffix?: PluginTs['resolvedOptions']['enumTypeSuffix']\n /**\n * Controls whether a `type` alias or `interface` declaration is emitted.\n * @default `'type'`\n */\n syntaxType?: PluginTs['resolvedOptions']['syntaxType']\n /**\n * When set, `printer.print(node)` produces a full `type Name = …` declaration.\n * When omitted, `printer.print(node)` returns the raw type node.\n */\n name?: string\n\n /**\n * JSDoc `@description` comment added to the generated type or interface declaration.\n */\n description?: string\n /**\n * Property keys to exclude from the generated type via `Omit<Type, Keys>`.\n * Forces type-alias syntax even when `syntaxType` is `'interface'`.\n */\n keysToOmit?: Array<string>\n /**\n * Resolver used to transform raw schema names into valid TypeScript identifiers.\n */\n resolver: ResolverTs\n /**\n * Names of top-level schemas that are enums.\n * When set, the `ref` handler uses the suffixed type name (e.g. `StatusKey`) for enum refs\n * instead of the plain PascalCase name, so imports align with what the enum file actually exports.\n */\n enumSchemaNames?: Set<string>\n}\n\n/**\n * TypeScript printer factory options: maps `SchemaNode` → `ts.TypeNode` (raw) or `ts.Node` (full declaration).\n */\ntype TsPrinter = PrinterFactoryOptions<'typescript', TsOptions, ts.TypeNode, string>\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 = definePrinter<TsPrinter>((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 ? (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 = narrowSchema(m, schemaTypes.enum)\n return enumNode?.primitive === 'string'\n })\n const hasPlainString = members.some((m) => isStringType(m))\n\n if (hasStringLiteral && hasPlainString) {\n const memberNodes = members\n .map((m) => {\n if (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 = 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 },\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 = 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 { collect, narrowSchema, schemaTypes } from '@kubb/ast'\nimport type { EnumSchemaNode, SchemaNode } from '@kubb/ast/types'\nimport { File } from '@kubb/react-fabric'\nimport type { FabricReactNode } from '@kubb/react-fabric/types'\nimport { printerTs } from '../printers/printerTs.ts'\nimport type { PluginTs } from '../types.ts'\nimport { Enum, getEnumNames } from './Enum.tsx'\n\ntype Props = {\n name: string\n node: SchemaNode\n optionalType: PluginTs['resolvedOptions']['optionalType']\n arrayType: PluginTs['resolvedOptions']['arrayType']\n enumType: PluginTs['resolvedOptions']['enumType']\n enumTypeSuffix: PluginTs['resolvedOptions']['enumTypeSuffix']\n enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing']\n syntaxType: PluginTs['resolvedOptions']['syntaxType']\n resolver: PluginTs['resolver']\n description?: string\n keysToOmit?: string[]\n /**\n * Names of top-level schemas that are enums.\n * Used so the printer's `ref` handler can use the suffixed type name (e.g. `StatusKey`)\n * instead of the plain PascalCase name (e.g. `Status`) when resolving `$ref` enum targets.\n */\n enumSchemaNames?: Set<string>\n}\n\nexport function Type({\n name,\n node,\n keysToOmit,\n optionalType,\n arrayType,\n syntaxType,\n enumType,\n enumTypeSuffix,\n enumKeyCasing,\n description,\n resolver,\n enumSchemaNames,\n}: Props): FabricReactNode {\n const resolvedDescription = description || node?.description\n const enumSchemaNodes = collect<EnumSchemaNode>(node, {\n schema(n): EnumSchemaNode | undefined {\n const enumNode = narrowSchema(n, schemaTypes.enum)\n if (enumNode?.name) return enumNode\n },\n })\n\n const printer = printerTs({\n optionalType,\n arrayType,\n enumType,\n enumTypeSuffix,\n name,\n syntaxType,\n description: resolvedDescription,\n keysToOmit,\n resolver,\n enumSchemaNames,\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 }) => <Enum node={node} enumType={enumType} enumTypeSuffix={enumTypeSuffix} enumKeyCasing={enumKeyCasing} resolver={resolver} />)}\n {shouldExportType && (\n <File.Source name={name} isTypeOnly isExportable isIndexable>\n {output}\n </File.Source>\n )}\n </>\n )\n}\n","import path from 'node:path'\nimport { caseParams, composeTransformers, narrowSchema, schemaTypes, transform } from '@kubb/ast'\nimport type { SchemaNode } from '@kubb/ast/types'\nimport { defineGenerator, getMode } from '@kubb/core'\nimport { File } from '@kubb/react-fabric'\nimport { Type } from '../components/Type.tsx'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX } from '../constants.ts'\nimport type { PluginTs } from '../types'\nimport { buildData, buildResponses, buildResponseUnion } from '../utils.ts'\n\nexport const typeGenerator = defineGenerator<PluginTs>({\n name: 'typescript',\n type: 'react',\n Schema({ node, adapter, options, config, resolver }) {\n const { enumType, enumTypeSuffix, enumKeyCasing, syntaxType, optionalType, arrayType, output, group, transformers = [] } = options\n\n const transformedNode = transform(node, composeTransformers(...transformers))\n\n if (!transformedNode.name) {\n return\n }\n\n const root = path.resolve(config.root, config.output.path)\n const mode = getMode(path.resolve(root, output.path))\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.rootNode?.schemas ?? []).filter((s) => narrowSchema(s, 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.default(schemaName, 'type')\n }\n\n const imports = adapter.getImports(transformedNode, (schemaName) => ({\n name: resolveImportName(schemaName),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group }).path,\n }))\n\n const isEnumSchema = !!narrowSchema(transformedNode, schemaTypes.enum)\n\n const meta = {\n name:\n ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema\n ? resolver.resolveEnumKeyName(transformedNode, enumTypeSuffix)\n : resolver.resolveName(transformedNode.name),\n file: resolver.resolveFile({ name: transformedNode.name, extname: '.ts' }, { root, output, group }),\n } as const\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.rootNode, { output, config })}\n footer={resolver.resolveFooter(adapter.rootNode, { output, config })}\n >\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[transformedNode.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={transformedNode}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n enumSchemaNames={enumSchemaNames}\n />\n </File>\n )\n },\n Operation({ node, adapter, options, config, resolver }) {\n const { enumType, enumTypeSuffix, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, output, transformers = [] } = options\n\n const transformedNode = transform(node, composeTransformers(...transformers))\n\n const root = path.resolve(config.root, config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n\n const params = caseParams(transformedNode.parameters, paramsCasing)\n\n const meta = {\n file: resolver.resolveFile(\n { name: transformedNode.operationId, extname: '.ts', tag: transformedNode.tags[0] ?? 'default', path: transformedNode.path },\n { root, output, group },\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((adapter.rootNode?.schemas ?? []).filter((s) => narrowSchema(s, 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.default(schemaName, 'type')\n }\n\n function renderSchemaType({ schema, name, keysToOmit }: { schema: 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 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 optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n keysToOmit={keysToOmit}\n enumSchemaNames={enumSchemaNames}\n />\n </>\n )\n }\n\n const paramTypes = params.map((param) =>\n renderSchemaType({\n schema: param.schema,\n name: resolver.resolveParamName(transformedNode, param),\n }),\n )\n\n const requestType = transformedNode.requestBody?.schema\n ? renderSchemaType({\n schema: {\n ...transformedNode.requestBody.schema,\n description: transformedNode.requestBody.description ?? transformedNode.requestBody.schema.description,\n },\n name: resolver.resolveDataName(transformedNode),\n keysToOmit: transformedNode.requestBody.keysToOmit,\n })\n : null\n\n const responseTypes = transformedNode.responses.map((res) =>\n renderSchemaType({\n schema: res.schema,\n name: resolver.resolveResponseStatusName(transformedNode, res.statusCode),\n keysToOmit: res.keysToOmit,\n }),\n )\n\n const dataType = renderSchemaType({\n schema: buildData({ ...transformedNode, parameters: params }, { resolver }),\n name: resolver.resolveRequestConfigName(transformedNode),\n })\n\n const responsesType = renderSchemaType({\n schema: buildResponses(transformedNode, { resolver }),\n name: resolver.resolveResponsesName(transformedNode),\n })\n\n const responseType = renderSchemaType({\n schema: transformedNode.responses.some((res) => res.schema)\n ? {\n ...buildResponseUnion(transformedNode, { resolver })!,\n description: 'Union of all possible responses',\n }\n : null,\n name: resolver.resolveResponseName(transformedNode),\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.rootNode, { output, config })}\n footer={resolver.resolveFooter(adapter.rootNode, { 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\nfunction toTypeName(name: string, type?: 'file' | 'function' | 'type' | 'const'): string {\n return pascalCase(name, { isFile: type === 'file' })\n}\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>(() => {\n return {\n name: 'default',\n pluginName: 'plugin-ts',\n default(name, type) {\n return toTypeName(name, type)\n },\n resolveName(name) {\n return this.default(name, 'function')\n },\n resolvePathName(name, type) {\n return this.default(name, type)\n },\n resolveParamName(node, param) {\n return this.resolveName(`${node.operationId} ${param.in} ${param.name}`)\n },\n resolveResponseStatusName(node, statusCode) {\n return this.resolveName(`${node.operationId} Status ${statusCode}`)\n },\n resolveDataName(node) {\n return this.resolveName(`${node.operationId} Data`)\n },\n resolveRequestConfigName(node) {\n return this.resolveName(`${node.operationId} RequestConfig`)\n },\n resolveResponsesName(node) {\n return this.resolveName(`${node.operationId} Responses`)\n },\n resolveResponseName(node) {\n return this.resolveName(`${node.operationId} Response`)\n },\n resolveEnumKeyName(node, enumTypeSuffix = 'key') {\n return `${this.resolveName(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 { defineResolver } from '@kubb/core'\nimport type { PluginTs } from '../types.ts'\nimport { resolverTs } from './resolverTs.ts'\n\n/**\n * Legacy resolver for `@kubb/plugin-ts` that reproduces the naming conventions\n * used before the v2 resolver refactor. Enable via `compatibilityPreset: 'kubbV4'`\n * (or by composing this resolver manually).\n *\n * Key differences from the default resolver:\n * - Response status types: `<OperationId><StatusCode>` (e.g. `CreatePets201`) instead of `<OperationId>Status201`\n * - Default/error responses: `<OperationId>Error` instead of `<OperationId>StatusDefault`\n * - Request body: `<OperationId>MutationRequest` (non-GET) / `<OperationId>QueryRequest` (GET)\n * - Combined responses type: `<OperationId>Mutation` / `<OperationId>Query`\n * - Response union: `<OperationId>MutationResponse` / `<OperationId>QueryResponse`\n *\n * @example\n * ```ts\n * import { resolverTsLegacy } from '@kubb/plugin-ts'\n *\n * resolverTsLegacy.resolveResponseStatusTypedName(node, 201) // → 'CreatePets201'\n * resolverTsLegacy.resolveResponseStatusTypedName(node, 'default') // → 'CreatePetsError'\n * resolverTsLegacy.resolveDataTypedName(node) // → 'CreatePetsMutationRequest' (POST)\n * resolverTsLegacy.resolveResponsesTypedName(node) // → 'CreatePetsMutation' (POST)\n * resolverTsLegacy.resolveResponseTypedName(node) // → 'CreatePetsMutationResponse' (POST)\n * ```\n */\nexport const resolverTsLegacy = defineResolver<PluginTs>(() => {\n return {\n ...resolverTs,\n pluginName: 'plugin-ts',\n resolveResponseStatusName(node, statusCode) {\n if (statusCode === 'default') {\n return this.resolveName(`${node.operationId} Error`)\n }\n return this.resolveName(`${node.operationId} ${statusCode}`)\n },\n resolveDataName(node) {\n const suffix = node.method === 'GET' ? 'QueryRequest' : 'MutationRequest'\n return this.resolveName(`${node.operationId} ${suffix}`)\n },\n resolveResponsesName(node) {\n const suffix = node.method === 'GET' ? 'Query' : 'Mutation'\n return this.resolveName(`${node.operationId} ${suffix}`)\n },\n resolveResponseName(node) {\n const suffix = node.method === 'GET' ? 'QueryResponse' : 'MutationResponse'\n return this.resolveName(`${node.operationId} ${suffix}`)\n },\n resolvePathParamsName(node, _param) {\n return this.resolveName(`${node.operationId} PathParams`)\n },\n resolveQueryParamsName(node, _param) {\n return this.resolveName(`${node.operationId} QueryParams`)\n },\n resolveHeaderParamsName(node, _param) {\n return this.resolveName(`${node.operationId} HeaderParams`)\n },\n }\n})\n","import path from 'node:path'\nimport { pascalCase } from '@internals/utils'\nimport { caseParams, composeTransformers, createProperty, createSchema, narrowSchema, schemaTypes, transform } from '@kubb/ast'\nimport type { OperationNode, ParameterNode, SchemaNode } from '@kubb/ast/types'\nimport { defineGenerator, getMode } from '@kubb/core'\nimport { File } from '@kubb/react-fabric'\nimport { Type } from '../components/Type.tsx'\nimport { ENUM_TYPES_WITH_KEY_SUFFIX } from '../constants.ts'\nimport { resolverTsLegacy } from '../resolvers/resolverTsLegacy.ts'\nimport type { PluginTs, ResolverTs } from '../types'\n\ntype BuildGroupedParamsSchemaOptions = {\n params: Array<ParameterNode>\n parentName?: string\n}\n\nfunction buildGroupedParamsSchema({ params, parentName }: BuildGroupedParamsSchemaOptions): SchemaNode {\n return createSchema({\n type: 'object',\n properties: params.map((param) => {\n let schema = param.schema\n if (narrowSchema(schema, 'enum') && !schema.name && parentName) {\n schema = { ...schema, name: pascalCase([parentName, param.name, 'enum'].join(' ')) }\n }\n return createProperty({\n name: param.name,\n required: param.required,\n schema,\n })\n }),\n })\n}\n\ntype BuildOperationSchemaOptions = {\n resolver: ResolverTs\n}\n\nfunction buildLegacyResponsesSchemaNode(node: OperationNode, { resolver }: BuildOperationSchemaOptions): SchemaNode | null {\n const isGet = node.method.toLowerCase() === 'get'\n const successResponses = node.responses.filter((res) => {\n const code = Number(res.statusCode)\n return !Number.isNaN(code) && code >= 200 && code < 300\n })\n const errorResponses = node.responses.filter((res) => res.statusCode === 'default' || Number(res.statusCode) >= 400)\n\n const responseSchema =\n successResponses.length > 0\n ? successResponses.length === 1\n ? createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, successResponses[0]!.statusCode) })\n : createSchema({\n type: 'union',\n members: successResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) })),\n })\n : createSchema({ type: 'any', primitive: undefined })\n\n const errorsSchema =\n errorResponses.length > 0\n ? errorResponses.length === 1\n ? createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, errorResponses[0]!.statusCode) })\n : createSchema({\n type: 'union',\n members: errorResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) })),\n })\n : createSchema({ type: 'any', primitive: undefined })\n\n const properties = [createProperty({ name: 'Response', required: true, schema: responseSchema })]\n\n if (!isGet && node.requestBody?.schema) {\n properties.push(\n createProperty({\n name: 'Request',\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolveDataName(node) }),\n }),\n )\n }\n\n const queryParam = node.parameters.find((p) => p.in === 'query')\n if (queryParam) {\n properties.push(\n createProperty({\n name: 'QueryParams',\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolveQueryParamsName(node, queryParam) }),\n }),\n )\n }\n\n const pathParam = node.parameters.find((p) => p.in === 'path')\n if (pathParam) {\n properties.push(\n createProperty({\n name: 'PathParams',\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolvePathParamsName(node, pathParam) }),\n }),\n )\n }\n\n const headerParam = node.parameters.find((p) => p.in === 'header')\n if (headerParam) {\n properties.push(\n createProperty({\n name: 'HeaderParams',\n required: true,\n schema: createSchema({ type: 'ref', name: resolver.resolveHeaderParamsName(node, headerParam) }),\n }),\n )\n }\n\n properties.push(createProperty({ name: 'Errors', required: true, schema: errorsSchema }))\n\n return createSchema({ type: 'object', properties })\n}\n\nfunction buildLegacyResponseUnionSchemaNode(node: OperationNode, { resolver }: BuildOperationSchemaOptions): SchemaNode {\n const successResponses = node.responses.filter((res) => {\n const code = Number(res.statusCode)\n return !Number.isNaN(code) && code >= 200 && code < 300\n })\n\n if (successResponses.length === 0) {\n return createSchema({ type: 'any', primitive: undefined })\n }\n\n if (successResponses.length === 1) {\n return createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, successResponses[0]!.statusCode) })\n }\n\n return createSchema({\n type: 'union',\n members: successResponses.map((res) => createSchema({ type: 'ref', name: resolver.resolveResponseStatusName(node, res.statusCode) })),\n })\n}\n\nfunction nameUnnamedEnums(node: SchemaNode, parentName: string): SchemaNode {\n return transform(node, {\n schema(n) {\n const enumNode = narrowSchema(n, 'enum')\n if (enumNode && !enumNode.name) {\n return { ...enumNode, name: pascalCase([parentName, 'enum'].join(' ')) }\n }\n return undefined\n },\n property(p) {\n const enumNode = narrowSchema(p.schema, 'enum')\n if (enumNode && !enumNode.name) {\n return {\n ...p,\n schema: { ...enumNode, name: pascalCase([parentName, p.name, 'enum'].join(' ')) },\n }\n }\n return undefined\n },\n })\n}\n\nexport const typeGeneratorLegacy = defineGenerator<PluginTs>({\n name: 'typescript-legacy',\n type: 'react',\n Schema({ node, adapter, options, config, resolver }) {\n const { enumType, enumTypeSuffix, enumKeyCasing, syntaxType, optionalType, arrayType, output, group, transformers = [] } = options\n\n const transformedNode = transform(node, composeTransformers(...transformers))\n\n if (!transformedNode.name) {\n return\n }\n\n const root = path.resolve(config.root, config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n\n const imports = adapter.getImports(transformedNode, (schemaName) => ({\n name: resolver.default(schemaName, 'type'),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group }).path,\n }))\n\n const isEnumSchema = !!narrowSchema(transformedNode, schemaTypes.enum)\n\n const meta = {\n name:\n ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema\n ? resolver.resolveEnumKeyName(transformedNode, enumTypeSuffix)\n : resolver.resolveName(transformedNode.name),\n file: resolver.resolveFile({ name: transformedNode.name, extname: '.ts' }, { root, output, group }),\n } as const\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.rootNode, { output, config })}\n footer={resolver.resolveFooter(adapter.rootNode, { output, config })}\n >\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[transformedNode.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={transformedNode}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n />\n </File>\n )\n },\n Operation({ node, adapter, options, config, resolver }) {\n const { enumType, enumTypeSuffix, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, output, transformers = [] } = options\n\n const transformedNode = transform(node, composeTransformers(...transformers))\n\n const root = path.resolve(config.root, config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n const params = caseParams(node.parameters, paramsCasing)\n\n const meta = {\n file: resolver.resolveFile(\n { name: transformedNode.operationId, extname: '.ts', tag: transformedNode.tags[0] ?? 'default', path: transformedNode.path },\n { root, output, group },\n ),\n } as const\n\n function renderSchemaType({\n schema,\n name,\n description,\n keysToOmit,\n }: {\n schema: SchemaNode | null\n name: string\n description?: string\n keysToOmit?: Array<string>\n }) {\n if (!schema) return null\n\n const imports = adapter.getImports(schema, (schemaName) => ({\n name: resolver.default(schemaName, 'type'),\n path: resolver.resolveFile({ name: schemaName, extname: '.ts' }, { root, output, group }).path,\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 description={description}\n enumType={enumType}\n enumTypeSuffix={enumTypeSuffix}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n resolver={resolver}\n keysToOmit={keysToOmit}\n />\n </>\n )\n }\n\n const pathParams = params.filter((p) => p.in === 'path')\n const queryParams = params.filter((p) => p.in === 'query')\n const headerParams = params.filter((p) => p.in === 'header')\n\n const responseTypes = node.responses.map((res) => {\n const responseName = resolver.resolveResponseStatusName(node, res.statusCode)\n const baseResponseName = resolverTsLegacy.resolveResponseStatusName(node, res.statusCode)\n\n return renderSchemaType({\n schema: res.schema ? nameUnnamedEnums(res.schema, baseResponseName) : res.schema,\n name: responseName,\n description: res.description,\n keysToOmit: res.keysToOmit,\n })\n })\n\n const requestType = node.requestBody?.schema\n ? renderSchemaType({\n schema: nameUnnamedEnums(node.requestBody.schema, resolverTsLegacy.resolveDataName(node)),\n name: resolver.resolveDataName(node),\n description: node.requestBody.description ?? node.requestBody.schema.description,\n keysToOmit: node.requestBody.keysToOmit,\n })\n : null\n\n const legacyParamTypes = [\n pathParams.length > 0\n ? renderSchemaType({\n schema: buildGroupedParamsSchema({ params: pathParams, parentName: resolverTsLegacy.resolvePathParamsName(node, pathParams[0]!) }),\n name: resolver.resolvePathParamsName(node, pathParams[0]!),\n })\n : null,\n queryParams.length > 0\n ? renderSchemaType({\n schema: buildGroupedParamsSchema({ params: queryParams, parentName: resolverTsLegacy.resolveQueryParamsName(node, queryParams[0]!) }),\n name: resolver.resolveQueryParamsName(node, queryParams[0]!),\n })\n : null,\n headerParams.length > 0\n ? renderSchemaType({\n schema: buildGroupedParamsSchema({ params: headerParams, parentName: resolverTsLegacy.resolveHeaderParamsName(node, headerParams[0]!) }),\n name: resolver.resolveHeaderParamsName(node, headerParams[0]!),\n })\n : null,\n ]\n\n const legacyResponsesType = renderSchemaType({\n schema: buildLegacyResponsesSchemaNode(node, { resolver }),\n name: resolver.resolveResponsesName(node),\n })\n\n const legacyResponseType = renderSchemaType({\n schema: buildLegacyResponseUnionSchemaNode(node, { resolver }),\n name: resolver.resolveResponseName(node),\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.rootNode, { output, config })}\n footer={resolver.resolveFooter(adapter.rootNode, { output, config })}\n >\n {legacyParamTypes}\n {responseTypes}\n {requestType}\n {legacyResponseType}\n {legacyResponsesType}\n </File>\n )\n },\n})\n","import { definePresets } from '@kubb/core'\nimport { typeGenerator } from './generators/typeGenerator.tsx'\nimport { typeGeneratorLegacy } from './generators/typeGeneratorLegacy.tsx'\nimport { resolverTs } from './resolvers/resolverTs.ts'\nimport { resolverTsLegacy } from './resolvers/resolverTsLegacy.ts'\nimport type { ResolverTs } from './types.ts'\n\n/**\n * Built-in preset registry for `@kubb/plugin-ts`.\n *\n * - `default` — uses `resolverTs` and `typeGenerator` (current naming conventions).\n * - `kubbV4` — uses `resolverTsLegacy` and `typeGeneratorLegacy` (Kubb v4 naming conventions).\n */\nexport const presets = definePresets<ResolverTs>({\n default: {\n name: 'default',\n resolvers: [resolverTs],\n generators: [typeGenerator],\n },\n kubbV4: {\n name: 'kubbV4',\n resolvers: [resolverTsLegacy],\n generators: [typeGeneratorLegacy],\n },\n})\n","import path from 'node:path'\nimport { camelCase } from '@internals/utils'\nimport { walk } from '@kubb/ast'\nimport type { OperationNode } from '@kubb/ast/types'\nimport { createPlugin, type Group, getBarrelFiles, getPreset, runGeneratorOperation, runGeneratorOperations, runGeneratorSchema } from '@kubb/core'\nimport { presets } from './presets.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 = createPlugin<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 compatibilityPreset = 'default',\n resolvers: userResolvers = [],\n transformers: userTransformers = [],\n generators: userGenerators = [],\n } = options\n\n const preset = getPreset({\n preset: compatibilityPreset,\n presets: presets,\n resolvers: userResolvers,\n transformers: userTransformers,\n generators: userGenerators,\n })\n\n let resolveNameWarning = false\n let resolvePathWarning = false\n\n return {\n name: pluginTsName,\n get resolver() {\n return preset.resolver\n },\n get options() {\n return {\n output,\n optionalType,\n group: 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 arrayType,\n enumType,\n enumTypeSuffix,\n enumKeyCasing,\n syntaxType,\n paramsCasing,\n transformers: preset.transformers,\n }\n },\n resolvePath(baseName, pathMode, options) {\n if (!resolvePathWarning) {\n this.events.emit('warn', 'Do not use resolvePath for pluginTs, use resolverTs.resolvePath instead')\n resolvePathWarning = true\n }\n\n return this.plugin.resolver.resolvePath(\n { baseName, pathMode, tag: options?.group?.tag, path: options?.group?.path },\n { root: path.resolve(this.config.root, this.config.output.path), output, group: this.plugin.options.group },\n )\n },\n resolveName(name, type) {\n if (!resolveNameWarning) {\n this.events.emit('warn', 'Do not use resolveName for pluginTs, use resolverTs.default instead')\n resolveNameWarning = true\n }\n\n return this.plugin.resolver.default(name, type)\n },\n async install() {\n const { config, fabric, plugin, adapter, rootNode, driver, openInStudio, resolver } = this\n\n const root = path.resolve(config.root, config.output.path)\n\n if (!adapter) {\n throw new Error(`[${pluginTsName}] No adapter found. Add an OAS adapter (e.g. pluginOas()) before this plugin in your Kubb config.`)\n }\n\n await openInStudio({ ast: true })\n\n const collectedOperations: Array<OperationNode> = []\n const generatorContext = { generators: preset.generators, plugin, resolver, exclude, include, override, fabric, adapter, config, driver }\n\n await walk(rootNode, {\n depth: 'shallow',\n async schema(schemaNode) {\n await runGeneratorSchema(schemaNode, generatorContext)\n },\n async operation(operationNode) {\n const baseOptions = resolver.resolveOptions(operationNode, { options: plugin.options, exclude, include, override })\n\n if (baseOptions !== null) {\n collectedOperations.push(operationNode)\n }\n\n await runGeneratorOperation(operationNode, generatorContext)\n },\n })\n\n await runGeneratorOperations(collectedOperations, generatorContext)\n\n const barrelFiles = await getBarrelFiles(this.fabric.files, {\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginName: this.plugin.name,\n },\n })\n\n await this.upsertFile(...barrelFiles)\n },\n }\n})\n","import type { PrinterFactoryOptions } from '@kubb/ast'\nimport { createPrinterFactory } from '@kubb/ast'\nimport type { FunctionNode, FunctionNodeType, FunctionParameterNode, FunctionParametersNode, ParameterGroupNode, TypeNode } from '@kubb/ast/types'\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: FunctionParameterNode\n parameterGroup: ParameterGroupNode\n functionParameters: FunctionParametersNode\n type: TypeNode\n}\n\nconst kindToHandlerKey = {\n FunctionParameter: 'functionParameter',\n ParameterGroup: 'parameterGroup',\n FunctionParameters: 'functionParameters',\n Type: 'type',\n} satisfies Record<string, 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 = createPrinterFactory<FunctionNode, FunctionNodeType, FunctionNodeByType>((node) => kindToHandlerKey[node.kind])\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 = PrinterFactoryOptions<'functionParameters', FunctionPrinterOptions, string>\n\nfunction rank(param: FunctionParameterNode | 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<FunctionParameterNode | ParameterGroupNode>): Array<FunctionParameterNode | ParameterGroupNode> {\n return [...params].sort((a, b) => rank(a) - rank(b))\n}\n\nfunction sortChildParams(params: Array<FunctionParameterNode>): Array<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 type(node) {\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 return p.optional ? `${p.name}?: ${typeStr}` : `${p.name}: ${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,QAAQ,CAEV,MAAM,gBAAgB,CAAC,OAAO,QAAQ,CAG5D,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;AAClG,KA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