@kubb/plugin-ts 5.0.0-alpha.2 → 5.0.0-alpha.21
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/Type-B6fo0gSk.js +120 -0
- package/dist/Type-B6fo0gSk.js.map +1 -0
- package/dist/Type-oFwUfkZv.cjs +131 -0
- package/dist/Type-oFwUfkZv.cjs.map +1 -0
- package/dist/builderTs-Cd3juc2G.cjs +120 -0
- package/dist/builderTs-Cd3juc2G.cjs.map +1 -0
- package/dist/builderTs-DausqHpc.js +116 -0
- package/dist/builderTs-DausqHpc.js.map +1 -0
- package/dist/builders.cjs +3 -0
- package/dist/builders.d.ts +8 -0
- package/dist/builders.js +2 -0
- package/dist/casing-BJHFg-zZ.js +84 -0
- package/dist/casing-BJHFg-zZ.js.map +1 -0
- package/dist/casing-DHfdqpLi.cjs +107 -0
- package/dist/casing-DHfdqpLi.cjs.map +1 -0
- package/dist/chunk-ByKO4r7w.cjs +38 -0
- package/dist/components.cjs +3 -2
- package/dist/components.d.ts +40 -11
- package/dist/components.js +2 -2
- package/dist/generators-ByK18qUn.js +551 -0
- package/dist/generators-ByK18qUn.js.map +1 -0
- package/dist/generators-aSsiTfUO.cjs +563 -0
- package/dist/generators-aSsiTfUO.cjs.map +1 -0
- package/dist/generators.cjs +3 -2
- package/dist/generators.d.ts +7 -492
- package/dist/generators.js +2 -2
- package/dist/index.cjs +148 -3
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +146 -1
- package/dist/index.js.map +1 -0
- package/dist/printerTs-BgZucv4T.js +559 -0
- package/dist/printerTs-BgZucv4T.js.map +1 -0
- package/dist/printerTs-CFXc_LpP.cjs +595 -0
- package/dist/printerTs-CFXc_LpP.cjs.map +1 -0
- package/dist/printers.cjs +3 -0
- package/dist/printers.d.ts +75 -0
- package/dist/printers.js +2 -0
- package/dist/resolverTsLegacy-DLl854-P.js +185 -0
- package/dist/resolverTsLegacy-DLl854-P.js.map +1 -0
- package/dist/resolverTsLegacy-sJ16Iqrl.cjs +196 -0
- package/dist/resolverTsLegacy-sJ16Iqrl.cjs.map +1 -0
- package/dist/resolvers.cjs +4 -0
- package/dist/resolvers.d.ts +52 -0
- package/dist/resolvers.js +2 -0
- package/dist/types-BcyuFDn9.d.ts +344 -0
- package/package.json +27 -8
- package/src/builders/builderTs.ts +92 -0
- package/src/builders/index.ts +1 -0
- package/src/components/Enum.tsx +83 -0
- package/src/components/Type.tsx +24 -145
- package/src/components/index.ts +1 -0
- package/src/constants.ts +29 -0
- package/src/factory.ts +14 -48
- package/src/generators/index.ts +1 -0
- package/src/generators/typeGenerator.tsx +119 -403
- package/src/generators/typeGeneratorLegacy.tsx +345 -0
- package/src/plugin.ts +80 -122
- package/src/presets.ts +26 -0
- package/src/printers/index.ts +1 -0
- package/src/printers/printerTs.ts +389 -0
- package/src/resolvers/index.ts +2 -0
- package/src/resolvers/resolverTs.ts +107 -0
- package/src/resolvers/resolverTsLegacy.ts +87 -0
- package/src/types.ts +261 -72
- package/dist/components-9wydyqUx.cjs +0 -848
- package/dist/components-9wydyqUx.cjs.map +0 -1
- package/dist/components-LmqJfxMv.js +0 -721
- package/dist/components-LmqJfxMv.js.map +0 -1
- package/dist/plugin-CNkzbtpl.cjs +0 -508
- package/dist/plugin-CNkzbtpl.cjs.map +0 -1
- package/dist/plugin-DoLrDl9P.js +0 -476
- package/dist/plugin-DoLrDl9P.js.map +0 -1
- package/dist/types-BpeKGgCn.d.ts +0 -170
- package/src/parser.ts +0 -396
- package/src/printer.ts +0 -221
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"casing-BJHFg-zZ.js","names":[],"sources":["../../../internals/utils/src/casing.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"],"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,KA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
|
|
1
|
+
require("./chunk-ByKO4r7w.cjs");
|
|
2
|
+
//#region ../../internals/utils/src/casing.ts
|
|
3
|
+
/**
|
|
4
|
+
* Shared implementation for camelCase and PascalCase conversion.
|
|
5
|
+
* Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)
|
|
6
|
+
* and capitalizes each word according to `pascal`.
|
|
7
|
+
*
|
|
8
|
+
* When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
|
|
9
|
+
*/
|
|
10
|
+
function toCamelOrPascal(text, pascal) {
|
|
11
|
+
return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
|
|
12
|
+
if (word.length > 1 && word === word.toUpperCase()) return word;
|
|
13
|
+
if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1);
|
|
14
|
+
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
15
|
+
}).join("").replace(/[^a-zA-Z0-9]/g, "");
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Splits `text` on `.` and applies `transformPart` to each segment.
|
|
19
|
+
* The last segment receives `isLast = true`, all earlier segments receive `false`.
|
|
20
|
+
* Segments are joined with `/` to form a file path.
|
|
21
|
+
*
|
|
22
|
+
* Only splits on dots followed by a letter so that version numbers
|
|
23
|
+
* embedded in operationIds (e.g. `v2025.0`) are kept intact.
|
|
24
|
+
*/
|
|
25
|
+
function applyToFileParts(text, transformPart) {
|
|
26
|
+
const parts = text.split(/\.(?=[a-zA-Z])/);
|
|
27
|
+
return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join("/");
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Converts `text` to camelCase.
|
|
31
|
+
* When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* camelCase('hello-world') // 'helloWorld'
|
|
35
|
+
* camelCase('pet.petId', { isFile: true }) // 'pet/petId'
|
|
36
|
+
*/
|
|
37
|
+
function camelCase(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
38
|
+
if (isFile) return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? {
|
|
39
|
+
prefix,
|
|
40
|
+
suffix
|
|
41
|
+
} : {}));
|
|
42
|
+
return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Converts `text` to PascalCase.
|
|
46
|
+
* When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* pascalCase('hello-world') // 'HelloWorld'
|
|
50
|
+
* pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'
|
|
51
|
+
*/
|
|
52
|
+
function pascalCase(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
53
|
+
if (isFile) return applyToFileParts(text, (part, isLast) => isLast ? pascalCase(part, {
|
|
54
|
+
prefix,
|
|
55
|
+
suffix
|
|
56
|
+
}) : camelCase(part));
|
|
57
|
+
return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Converts `text` to snake_case.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* snakeCase('helloWorld') // 'hello_world'
|
|
64
|
+
* snakeCase('Hello-World') // 'hello_world'
|
|
65
|
+
*/
|
|
66
|
+
function snakeCase(text, { prefix = "", suffix = "" } = {}) {
|
|
67
|
+
return `${prefix} ${text} ${suffix}`.trim().replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[\s\-.]+/g, "_").replace(/[^a-zA-Z0-9_]/g, "").toLowerCase().split("_").filter(Boolean).join("_");
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Converts `text` to SCREAMING_SNAKE_CASE.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* screamingSnakeCase('helloWorld') // 'HELLO_WORLD'
|
|
74
|
+
*/
|
|
75
|
+
function screamingSnakeCase(text, { prefix = "", suffix = "" } = {}) {
|
|
76
|
+
return snakeCase(text, {
|
|
77
|
+
prefix,
|
|
78
|
+
suffix
|
|
79
|
+
}).toUpperCase();
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
Object.defineProperty(exports, "camelCase", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function() {
|
|
85
|
+
return camelCase;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(exports, "pascalCase", {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: function() {
|
|
91
|
+
return pascalCase;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
Object.defineProperty(exports, "screamingSnakeCase", {
|
|
95
|
+
enumerable: true,
|
|
96
|
+
get: function() {
|
|
97
|
+
return screamingSnakeCase;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
Object.defineProperty(exports, "snakeCase", {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
get: function() {
|
|
103
|
+
return snakeCase;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
//# sourceMappingURL=casing-DHfdqpLi.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"casing-DHfdqpLi.cjs","names":[],"sources":["../../../internals/utils/src/casing.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"],"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,MAA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"name", {
|
|
5
|
+
value,
|
|
6
|
+
configurable: true
|
|
7
|
+
});
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
14
|
+
key = keys[i];
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: ((k) => from[k]).bind(null, key),
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
//#endregion
|
|
27
|
+
Object.defineProperty(exports, "__name", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function() {
|
|
30
|
+
return __name;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, "__toESM", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function() {
|
|
36
|
+
return __toESM;
|
|
37
|
+
}
|
|
38
|
+
});
|
package/dist/components.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
exports.
|
|
2
|
+
const require_Type = require("./Type-oFwUfkZv.cjs");
|
|
3
|
+
exports.Enum = require_Type.Enum;
|
|
4
|
+
exports.Type = require_Type.Type;
|
package/dist/components.d.ts
CHANGED
|
@@ -1,38 +1,67 @@
|
|
|
1
1
|
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { SchemaObject } from "@kubb/oas";
|
|
2
|
+
import { i as ResolverTs, r as PluginTs } from "./types-BcyuFDn9.js";
|
|
3
|
+
import { EnumSchemaNode, SchemaNode } from "@kubb/ast/types";
|
|
5
4
|
import { FabricReactNode } from "@kubb/react-fabric/types";
|
|
6
5
|
|
|
6
|
+
//#region src/components/Enum.d.ts
|
|
7
|
+
type Props$1 = {
|
|
8
|
+
node: EnumSchemaNode;
|
|
9
|
+
enumType: PluginTs['resolvedOptions']['enumType'];
|
|
10
|
+
enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing'];
|
|
11
|
+
resolver: ResolverTs;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the runtime identifier name and the TypeScript type name for an enum schema node.
|
|
15
|
+
*
|
|
16
|
+
* The raw `node.name` may be a YAML key such as `"enumNames.Type"` which is not a
|
|
17
|
+
* valid TypeScript identifier. The resolver normalizes it; for inline enum
|
|
18
|
+
* properties the adapter already emits a PascalCase+suffix name so resolution is typically a no-op.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Renders the enum declaration(s) for a single named `EnumSchemaNode`.
|
|
22
|
+
*
|
|
23
|
+
* Depending on `enumType` this may emit:
|
|
24
|
+
* - A runtime object (`asConst` / `asPascalConst`) plus a `typeof` type alias
|
|
25
|
+
* - A `const enum` or plain `enum` declaration (`constEnum` / `enum`)
|
|
26
|
+
* - A union literal type alias (`literal`)
|
|
27
|
+
*
|
|
28
|
+
* The emitted `File.Source` nodes carry the resolved names so that the barrel
|
|
29
|
+
* index picks up the correct export identifiers.
|
|
30
|
+
*/
|
|
31
|
+
declare function Enum({
|
|
32
|
+
node,
|
|
33
|
+
enumType,
|
|
34
|
+
enumKeyCasing,
|
|
35
|
+
resolver
|
|
36
|
+
}: Props$1): FabricReactNode;
|
|
37
|
+
//#endregion
|
|
7
38
|
//#region src/components/Type.d.ts
|
|
8
39
|
type Props = {
|
|
9
40
|
name: string;
|
|
10
41
|
typedName: string;
|
|
11
|
-
|
|
12
|
-
tree: Array<Schema>;
|
|
42
|
+
node: SchemaNode;
|
|
13
43
|
optionalType: PluginTs['resolvedOptions']['optionalType'];
|
|
14
44
|
arrayType: PluginTs['resolvedOptions']['arrayType'];
|
|
15
45
|
enumType: PluginTs['resolvedOptions']['enumType'];
|
|
16
46
|
enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing'];
|
|
17
|
-
mapper: PluginTs['resolvedOptions']['mapper'];
|
|
18
47
|
syntaxType: PluginTs['resolvedOptions']['syntaxType'];
|
|
48
|
+
resolver: PluginTs['resolvedOptions']['resolver'];
|
|
19
49
|
description?: string;
|
|
20
50
|
keysToOmit?: string[];
|
|
21
51
|
};
|
|
22
52
|
declare function Type({
|
|
23
53
|
name,
|
|
24
54
|
typedName,
|
|
25
|
-
|
|
55
|
+
node,
|
|
26
56
|
keysToOmit,
|
|
27
|
-
schema,
|
|
28
57
|
optionalType,
|
|
29
58
|
arrayType,
|
|
30
59
|
syntaxType,
|
|
31
60
|
enumType,
|
|
32
61
|
enumKeyCasing,
|
|
33
|
-
|
|
34
|
-
|
|
62
|
+
description,
|
|
63
|
+
resolver
|
|
35
64
|
}: Props): FabricReactNode;
|
|
36
65
|
//#endregion
|
|
37
|
-
export { Type };
|
|
66
|
+
export { Enum, Type };
|
|
38
67
|
//# sourceMappingURL=components.d.ts.map
|
package/dist/components.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Type } from "./
|
|
2
|
-
export { Type };
|
|
1
|
+
import { n as Enum, t as Type } from "./Type-B6fo0gSk.js";
|
|
2
|
+
export { Enum, Type };
|