@kubb/parser-ts 4.1.3 → 5.0.0-alpha.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,230 +0,0 @@
1
- import ts from "typescript";
2
-
3
- //#region rolldown:runtime
4
- declare namespace factory_d_exports {
5
- export { appendJSDocToNode, createArrayDeclaration, createArrayTypeNode, createEnumDeclaration, createExportDeclaration, createFalse, createIdentifier, createImportDeclaration, createIndexSignature, createInterfaceDeclaration, createIntersectionDeclaration, createJSDoc, createLiteralTypeNode, createNamespaceDeclaration, createNull, createNumericLiteral, createOmitDeclaration, createOptionalTypeNode, createParameterSignature, createPropertySignature, createQuestionToken, createRestTypeNode, createStringLiteral, createTrue, createTupleDeclaration, createTupleTypeNode, createTypeAliasDeclaration, createTypeDeclaration, createTypeLiteralNode, createTypeReferenceNode, createUnionDeclaration, keywordTypeNodes, modifiers, syntaxKind };
6
- }
7
- declare const modifiers: {
8
- readonly async: ts.ModifierToken<ts.SyntaxKind.AsyncKeyword>;
9
- readonly export: ts.ModifierToken<ts.SyntaxKind.ExportKeyword>;
10
- readonly const: ts.ModifierToken<ts.SyntaxKind.ConstKeyword>;
11
- readonly static: ts.ModifierToken<ts.SyntaxKind.StaticKeyword>;
12
- };
13
- declare const syntaxKind: {
14
- readonly union: 192;
15
- };
16
- declare function createQuestionToken(token?: boolean | ts.QuestionToken): ts.PunctuationToken<ts.SyntaxKind.QuestionToken> | undefined;
17
- declare function createIntersectionDeclaration({
18
- nodes,
19
- withParentheses
20
- }: {
21
- nodes: Array<ts.TypeNode>;
22
- withParentheses?: boolean;
23
- }): ts.TypeNode | null;
24
- /**
25
- * Minimum nodes length of 2
26
- * @example `string & number`
27
- */
28
- declare function createTupleDeclaration({
29
- nodes,
30
- withParentheses
31
- }: {
32
- nodes: Array<ts.TypeNode>;
33
- withParentheses?: boolean;
34
- }): ts.TypeNode | null;
35
- declare function createArrayDeclaration({
36
- nodes
37
- }: {
38
- nodes: Array<ts.TypeNode>;
39
- }): ts.TypeNode | null;
40
- /**
41
- * Minimum nodes length of 2
42
- * @example `string | number`
43
- */
44
- declare function createUnionDeclaration({
45
- nodes,
46
- withParentheses
47
- }: {
48
- nodes: Array<ts.TypeNode>;
49
- withParentheses?: boolean;
50
- }): ts.TypeNode;
51
- declare function createPropertySignature({
52
- readOnly,
53
- modifiers,
54
- name,
55
- questionToken,
56
- type
57
- }: {
58
- readOnly?: boolean;
59
- modifiers?: Array<ts.Modifier>;
60
- name: ts.PropertyName | string;
61
- questionToken?: ts.QuestionToken | boolean;
62
- type?: ts.TypeNode;
63
- }): ts.PropertySignature;
64
- declare function createParameterSignature(name: string | ts.BindingName, {
65
- modifiers,
66
- dotDotDotToken,
67
- questionToken,
68
- type,
69
- initializer
70
- }: {
71
- decorators?: Array<ts.Decorator>;
72
- modifiers?: Array<ts.Modifier>;
73
- dotDotDotToken?: ts.DotDotDotToken;
74
- questionToken?: ts.QuestionToken | boolean;
75
- type?: ts.TypeNode;
76
- initializer?: ts.Expression;
77
- }): ts.ParameterDeclaration;
78
- declare function createJSDoc({
79
- comments
80
- }: {
81
- comments: string[];
82
- }): ts.JSDoc | null;
83
- /**
84
- * @link https://github.com/microsoft/TypeScript/issues/44151
85
- */
86
- declare function appendJSDocToNode<TNode extends ts.Node>({
87
- node,
88
- comments
89
- }: {
90
- node: TNode;
91
- comments: Array<string | undefined>;
92
- }): TNode;
93
- declare function createIndexSignature(type: ts.TypeNode, {
94
- modifiers,
95
- indexName,
96
- indexType
97
- }?: {
98
- indexName?: string;
99
- indexType?: ts.TypeNode;
100
- decorators?: Array<ts.Decorator>;
101
- modifiers?: Array<ts.Modifier>;
102
- }): ts.IndexSignatureDeclaration;
103
- declare function createTypeAliasDeclaration({
104
- modifiers,
105
- name,
106
- typeParameters,
107
- type
108
- }: {
109
- modifiers?: Array<ts.Modifier>;
110
- name: string | ts.Identifier;
111
- typeParameters?: Array<ts.TypeParameterDeclaration>;
112
- type: ts.TypeNode;
113
- }): ts.TypeAliasDeclaration;
114
- declare function createInterfaceDeclaration({
115
- modifiers,
116
- name,
117
- typeParameters,
118
- members
119
- }: {
120
- modifiers?: Array<ts.Modifier>;
121
- name: string | ts.Identifier;
122
- typeParameters?: Array<ts.TypeParameterDeclaration>;
123
- members: Array<ts.TypeElement>;
124
- }): ts.InterfaceDeclaration;
125
- declare function createTypeDeclaration({
126
- syntax,
127
- isExportable,
128
- comments,
129
- name,
130
- type
131
- }: {
132
- syntax: 'type' | 'interface';
133
- comments: Array<string | undefined>;
134
- isExportable?: boolean;
135
- name: string | ts.Identifier;
136
- type: ts.TypeNode;
137
- }): ts.TypeAliasDeclaration | ts.InterfaceDeclaration;
138
- declare function createNamespaceDeclaration({
139
- statements,
140
- name
141
- }: {
142
- name: string;
143
- statements: ts.Statement[];
144
- }): ts.ModuleDeclaration;
145
- /**
146
- * In { propertyName: string; name?: string } is `name` being used to make the type more unique when multiple same names are used.
147
- * @example `import { Pet as Cat } from './Pet'`
148
- */
149
- declare function createImportDeclaration({
150
- name,
151
- path,
152
- isTypeOnly,
153
- isNameSpace
154
- }: {
155
- name: string | Array<string | {
156
- propertyName: string;
157
- name?: string;
158
- }>;
159
- path: string;
160
- isTypeOnly?: boolean;
161
- isNameSpace?: boolean;
162
- }): ts.ImportDeclaration;
163
- declare function createExportDeclaration({
164
- path,
165
- asAlias,
166
- isTypeOnly,
167
- name
168
- }: {
169
- path: string;
170
- asAlias?: boolean;
171
- isTypeOnly?: boolean;
172
- name?: string | Array<ts.Identifier | string>;
173
- }): ts.ExportDeclaration;
174
- declare function createEnumDeclaration({
175
- type,
176
- name,
177
- typeName,
178
- enums
179
- }: {
180
- /**
181
- * @default `'enum'`
182
- */
183
- type?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal';
184
- /**
185
- * Enum name in camelCase.
186
- */
187
- name: string;
188
- /**
189
- * Enum name in PascalCase.
190
- */
191
- typeName: string;
192
- enums: [key: string | number, value: string | number | boolean][];
193
- }): [name: ts.Node | undefined, type: ts.Node];
194
- declare function createOmitDeclaration({
195
- keys,
196
- type,
197
- nonNullable
198
- }: {
199
- keys: Array<string> | string;
200
- type: ts.TypeNode;
201
- nonNullable?: boolean;
202
- }): ts.TypeReferenceNode;
203
- declare const keywordTypeNodes: {
204
- readonly any: ts.KeywordTypeNode<ts.SyntaxKind.AnyKeyword>;
205
- readonly unknown: ts.KeywordTypeNode<ts.SyntaxKind.UnknownKeyword>;
206
- readonly void: ts.KeywordTypeNode<ts.SyntaxKind.VoidKeyword>;
207
- readonly number: ts.KeywordTypeNode<ts.SyntaxKind.NumberKeyword>;
208
- readonly integer: ts.KeywordTypeNode<ts.SyntaxKind.NumberKeyword>;
209
- readonly object: ts.KeywordTypeNode<ts.SyntaxKind.ObjectKeyword>;
210
- readonly string: ts.KeywordTypeNode<ts.SyntaxKind.StringKeyword>;
211
- readonly boolean: ts.KeywordTypeNode<ts.SyntaxKind.BooleanKeyword>;
212
- readonly undefined: ts.KeywordTypeNode<ts.SyntaxKind.UndefinedKeyword>;
213
- readonly null: ts.LiteralTypeNode;
214
- };
215
- declare const createTypeLiteralNode: (members: readonly ts.TypeElement[] | undefined) => ts.TypeLiteralNode;
216
- declare const createTypeReferenceNode: (typeName: string | ts.EntityName, typeArguments?: readonly ts.TypeNode[]) => ts.TypeReferenceNode;
217
- declare const createNumericLiteral: (value: string | number, numericLiteralFlags?: ts.TokenFlags) => ts.NumericLiteral;
218
- declare const createStringLiteral: (text: string, isSingleQuote?: boolean) => ts.StringLiteral;
219
- declare const createArrayTypeNode: (elementType: ts.TypeNode) => ts.ArrayTypeNode;
220
- declare const createLiteralTypeNode: (literal: ts.LiteralTypeNode["literal"]) => ts.LiteralTypeNode;
221
- declare const createNull: () => ts.NullLiteral;
222
- declare const createIdentifier: (text: string) => ts.Identifier;
223
- declare const createOptionalTypeNode: (type: ts.TypeNode) => ts.OptionalTypeNode;
224
- declare const createTupleTypeNode: (elements: readonly (ts.TypeNode | ts.NamedTupleMember)[]) => ts.TupleTypeNode;
225
- declare const createRestTypeNode: (type: ts.TypeNode) => ts.RestTypeNode;
226
- declare const createTrue: () => ts.TrueLiteral;
227
- declare const createFalse: () => ts.FalseLiteral;
228
- //#endregion
229
- export { appendJSDocToNode, createArrayDeclaration, createArrayTypeNode, createEnumDeclaration, createExportDeclaration, createFalse, createIdentifier, createImportDeclaration, createIndexSignature, createInterfaceDeclaration, createIntersectionDeclaration, createJSDoc, createLiteralTypeNode, createNamespaceDeclaration, createNull, createNumericLiteral, createOmitDeclaration, createOptionalTypeNode, createParameterSignature, createPropertySignature, createQuestionToken, createRestTypeNode, createStringLiteral, createTrue, createTupleDeclaration, createTupleTypeNode, createTypeAliasDeclaration, createTypeDeclaration, createTypeLiteralNode, createTypeReferenceNode, createUnionDeclaration, factory_d_exports, keywordTypeNodes, modifiers, syntaxKind };
230
- //# sourceMappingURL=factory-_F-JTqnG.d.cts.map
package/dist/factory.cjs DELETED
@@ -1,36 +0,0 @@
1
- const require_factory = require('./factory-Ci8_piey.cjs');
2
-
3
- exports.appendJSDocToNode = require_factory.appendJSDocToNode;
4
- exports.createArrayDeclaration = require_factory.createArrayDeclaration;
5
- exports.createArrayTypeNode = require_factory.createArrayTypeNode;
6
- exports.createEnumDeclaration = require_factory.createEnumDeclaration;
7
- exports.createExportDeclaration = require_factory.createExportDeclaration;
8
- exports.createFalse = require_factory.createFalse;
9
- exports.createIdentifier = require_factory.createIdentifier;
10
- exports.createImportDeclaration = require_factory.createImportDeclaration;
11
- exports.createIndexSignature = require_factory.createIndexSignature;
12
- exports.createInterfaceDeclaration = require_factory.createInterfaceDeclaration;
13
- exports.createIntersectionDeclaration = require_factory.createIntersectionDeclaration;
14
- exports.createJSDoc = require_factory.createJSDoc;
15
- exports.createLiteralTypeNode = require_factory.createLiteralTypeNode;
16
- exports.createNamespaceDeclaration = require_factory.createNamespaceDeclaration;
17
- exports.createNull = require_factory.createNull;
18
- exports.createNumericLiteral = require_factory.createNumericLiteral;
19
- exports.createOmitDeclaration = require_factory.createOmitDeclaration;
20
- exports.createOptionalTypeNode = require_factory.createOptionalTypeNode;
21
- exports.createParameterSignature = require_factory.createParameterSignature;
22
- exports.createPropertySignature = require_factory.createPropertySignature;
23
- exports.createQuestionToken = require_factory.createQuestionToken;
24
- exports.createRestTypeNode = require_factory.createRestTypeNode;
25
- exports.createStringLiteral = require_factory.createStringLiteral;
26
- exports.createTrue = require_factory.createTrue;
27
- exports.createTupleDeclaration = require_factory.createTupleDeclaration;
28
- exports.createTupleTypeNode = require_factory.createTupleTypeNode;
29
- exports.createTypeAliasDeclaration = require_factory.createTypeAliasDeclaration;
30
- exports.createTypeDeclaration = require_factory.createTypeDeclaration;
31
- exports.createTypeLiteralNode = require_factory.createTypeLiteralNode;
32
- exports.createTypeReferenceNode = require_factory.createTypeReferenceNode;
33
- exports.createUnionDeclaration = require_factory.createUnionDeclaration;
34
- exports.keywordTypeNodes = require_factory.keywordTypeNodes;
35
- exports.modifiers = require_factory.modifiers;
36
- exports.syntaxKind = require_factory.syntaxKind;
@@ -1,2 +0,0 @@
1
- import { appendJSDocToNode, createArrayDeclaration, createArrayTypeNode, createEnumDeclaration, createExportDeclaration, createFalse, createIdentifier, createImportDeclaration, createIndexSignature, createInterfaceDeclaration, createIntersectionDeclaration, createJSDoc, createLiteralTypeNode, createNamespaceDeclaration, createNull, createNumericLiteral, createOmitDeclaration, createOptionalTypeNode, createParameterSignature, createPropertySignature, createQuestionToken, createRestTypeNode, createStringLiteral, createTrue, createTupleDeclaration, createTupleTypeNode, createTypeAliasDeclaration, createTypeDeclaration, createTypeLiteralNode, createTypeReferenceNode, createUnionDeclaration, keywordTypeNodes, modifiers, syntaxKind } from "./factory-_F-JTqnG.cjs";
2
- export { appendJSDocToNode, createArrayDeclaration, createArrayTypeNode, createEnumDeclaration, createExportDeclaration, createFalse, createIdentifier, createImportDeclaration, createIndexSignature, createInterfaceDeclaration, createIntersectionDeclaration, createJSDoc, createLiteralTypeNode, createNamespaceDeclaration, createNull, createNumericLiteral, createOmitDeclaration, createOptionalTypeNode, createParameterSignature, createPropertySignature, createQuestionToken, createRestTypeNode, createStringLiteral, createTrue, createTupleDeclaration, createTupleTypeNode, createTypeAliasDeclaration, createTypeDeclaration, createTypeLiteralNode, createTypeReferenceNode, createUnionDeclaration, keywordTypeNodes, modifiers, syntaxKind };
package/dist/factory.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { appendJSDocToNode, createArrayDeclaration, createArrayTypeNode, createEnumDeclaration, createExportDeclaration, createFalse, createIdentifier, createImportDeclaration, createIndexSignature, createInterfaceDeclaration, createIntersectionDeclaration, createJSDoc, createLiteralTypeNode, createNamespaceDeclaration, createNull, createNumericLiteral, createOmitDeclaration, createOptionalTypeNode, createParameterSignature, createPropertySignature, createQuestionToken, createRestTypeNode, createStringLiteral, createTrue, createTupleDeclaration, createTupleTypeNode, createTypeAliasDeclaration, createTypeDeclaration, createTypeLiteralNode, createTypeReferenceNode, createUnionDeclaration, keywordTypeNodes, modifiers, syntaxKind } from "./factory-CUjjpSgy.js";
2
- export { appendJSDocToNode, createArrayDeclaration, createArrayTypeNode, createEnumDeclaration, createExportDeclaration, createFalse, createIdentifier, createImportDeclaration, createIndexSignature, createInterfaceDeclaration, createIntersectionDeclaration, createJSDoc, createLiteralTypeNode, createNamespaceDeclaration, createNull, createNumericLiteral, createOmitDeclaration, createOptionalTypeNode, createParameterSignature, createPropertySignature, createQuestionToken, createRestTypeNode, createStringLiteral, createTrue, createTupleDeclaration, createTupleTypeNode, createTypeAliasDeclaration, createTypeDeclaration, createTypeLiteralNode, createTypeReferenceNode, createUnionDeclaration, keywordTypeNodes, modifiers, syntaxKind };
package/dist/factory.js DELETED
@@ -1,3 +0,0 @@
1
- import { appendJSDocToNode, createArrayDeclaration, createArrayTypeNode, createEnumDeclaration, createExportDeclaration, createFalse, createIdentifier, createImportDeclaration, createIndexSignature, createInterfaceDeclaration, createIntersectionDeclaration, createJSDoc, createLiteralTypeNode, createNamespaceDeclaration, createNull, createNumericLiteral, createOmitDeclaration, createOptionalTypeNode, createParameterSignature, createPropertySignature, createQuestionToken, createRestTypeNode, createStringLiteral, createTrue, createTupleDeclaration, createTupleTypeNode, createTypeAliasDeclaration, createTypeDeclaration, createTypeLiteralNode, createTypeReferenceNode, createUnionDeclaration, keywordTypeNodes, modifiers, syntaxKind } from "./factory-BB7TA5iA.js";
2
-
3
- export { appendJSDocToNode, createArrayDeclaration, createArrayTypeNode, createEnumDeclaration, createExportDeclaration, createFalse, createIdentifier, createImportDeclaration, createIndexSignature, createInterfaceDeclaration, createIntersectionDeclaration, createJSDoc, createLiteralTypeNode, createNamespaceDeclaration, createNull, createNumericLiteral, createOmitDeclaration, createOptionalTypeNode, createParameterSignature, createPropertySignature, createQuestionToken, createRestTypeNode, createStringLiteral, createTrue, createTupleDeclaration, createTupleTypeNode, createTypeAliasDeclaration, createTypeDeclaration, createTypeLiteralNode, createTypeReferenceNode, createUnionDeclaration, keywordTypeNodes, modifiers, syntaxKind };
package/dist/index.d.cts DELETED
@@ -1,25 +0,0 @@
1
- import { factory_d_exports } from "./factory-_F-JTqnG.cjs";
2
- import ts from "typescript";
3
-
4
- //#region src/format.d.ts
5
- declare function format(source?: string): Promise<string>;
6
- //#endregion
7
- //#region src/print.d.ts
8
- type PrintOptions = {
9
- source?: string;
10
- baseName?: string;
11
- scriptKind?: ts.ScriptKind;
12
- };
13
- /**
14
- * Convert AST TypeScript/TSX nodes to a string based on the TypeScript printer.
15
- * Ensures consistent output across environments.
16
- * Also works as a formatter when `source` is provided without `elements`.
17
- */
18
- declare function print(elements?: Array<ts.Node>, {
19
- source,
20
- baseName,
21
- scriptKind
22
- }?: PrintOptions): string;
23
- //#endregion
24
- export { factory_d_exports as factory, format, print };
25
- //# sourceMappingURL=index.d.cts.map