@hey-api/openapi-python 0.0.0-next-20260627144337 → 0.0.0-next-20260628160624

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.
@@ -0,0 +1,3142 @@
1
+ import { AnalysisContext, BindingKind, ExportModule, File, FromRef, ImportModule, Language, Node as Node$1, NodeName as NodeName$1, NodeNameSanitizer, NodeRelationship, NodeScope, ProjectMeta, Ref, RenderContext, Renderer, Symbol as Symbol$1 } from "@hey-api/codegen-core";
2
+ import { BaseOutput, Casing, DefinePlugin, FeatureToggle, IR, NameTransformer, NamingConfig, NamingOptions, NamingRule, OperationPathStrategy, OperationsStrategy, Plugin, PluginInstance, SchemaVisitorContext, SchemaWithType, Walker } from "@hey-api/shared";
3
+ import { AnyString, MaybeArray, MaybeFunc } from "@hey-api/types";
4
+ import { LinguistLanguages } from "@hey-api/spec-types";
5
+
6
+ //#region src/plugins/@hey-api/client-aiohttp/types.d.ts
7
+ type UserConfig$5 = Plugin.Name<'@hey-api/client-aiohttp'> & {
8
+ /**
9
+ * Set a default base URL when creating the client? You can set `baseUrl`
10
+ * to a string which will be used as the base URL. If your input defines
11
+ * server(s), you can set `baseUrl` to a number to pick a specific server
12
+ * to use as the base URL. You can disable setting the base URL by setting
13
+ * `baseUrl` to `false`. By default, `baseUrl` is `true` and it will try to
14
+ * use the first defined server value. If there's none, we won't set a
15
+ * base URL.
16
+ *
17
+ * If the matched URL contains template literals, it will be ignored.
18
+ *
19
+ * @default true
20
+ */
21
+ baseUrl?: string | number | boolean;
22
+ };
23
+ type Config$5 = Plugin.Name<'@hey-api/client-aiohttp'> & {
24
+ baseUrl: string | number | boolean;
25
+ };
26
+ type HeyApiClientAiohttpPlugin = DefinePlugin<UserConfig$5, Config$5>;
27
+ //#endregion
28
+ //#region src/plugins/@hey-api/client-httpx/types.d.ts
29
+ type UserConfig$4 = Plugin.Name<'@hey-api/client-httpx'> & {
30
+ /**
31
+ * Set a default base URL when creating the client? You can set `baseUrl`
32
+ * to a string which will be used as the base URL. If your input defines
33
+ * server(s), you can set `baseUrl` to a number to pick a specific server
34
+ * to use as the base URL. You can disable setting the base URL by setting
35
+ * `baseUrl` to `false`. By default, `baseUrl` is `true` and it will try to
36
+ * use the first defined server value. If there's none, we won't set a
37
+ * base URL.
38
+ *
39
+ * If the matched URL contains template literals, it will be ignored.
40
+ *
41
+ * @default true
42
+ */
43
+ baseUrl?: string | number | boolean;
44
+ };
45
+ type Config$4 = Plugin.Name<'@hey-api/client-httpx'> & {
46
+ baseUrl: string | number | boolean;
47
+ };
48
+ type HeyApiClientHttpxPlugin = DefinePlugin<UserConfig$4, Config$4>;
49
+ //#endregion
50
+ //#region src/plugins/@hey-api/client-requests/types.d.ts
51
+ type UserConfig$3 = Plugin.Name<'@hey-api/client-requests'> & {
52
+ /**
53
+ * Set a default base URL when creating the client? You can set `baseUrl`
54
+ * to a string which will be used as the base URL. If your input defines
55
+ * server(s), you can set `baseUrl` to a number to pick a specific server
56
+ * to use as the base URL. You can disable setting the base URL by setting
57
+ * `baseUrl` to `false`. By default, `baseUrl` is `true` and it will try to
58
+ * use the first defined server value. If there's none, we won't set a
59
+ * base URL.
60
+ *
61
+ * If the matched URL contains template literals, it will be ignored.
62
+ *
63
+ * @default true
64
+ */
65
+ baseUrl?: string | number | boolean;
66
+ };
67
+ type Config$3 = Plugin.Name<'@hey-api/client-requests'> & {
68
+ baseUrl: string | number | boolean;
69
+ };
70
+ type HeyApiClientRequestsPlugin = DefinePlugin<UserConfig$3, Config$3>;
71
+ //#endregion
72
+ //#region src/plugins/@hey-api/client-urllib3/types.d.ts
73
+ type UserConfig$2 = Plugin.Name<'@hey-api/client-urllib3'> & {
74
+ /**
75
+ * Set a default base URL when creating the client? You can set `baseUrl`
76
+ * to a string which will be used as the base URL. If your input defines
77
+ * server(s), you can set `baseUrl` to a number to pick a specific server
78
+ * to use as the base URL. You can disable setting the base URL by setting
79
+ * `baseUrl` to `false`. By default, `baseUrl` is `true` and it will try to
80
+ * use the first defined server value. If there's none, we won't set a
81
+ * base URL.
82
+ *
83
+ * If the matched URL contains template literals, it will be ignored.
84
+ *
85
+ * @default true
86
+ */
87
+ baseUrl?: string | number | boolean;
88
+ };
89
+ type Config$2 = Plugin.Name<'@hey-api/client-urllib3'> & {
90
+ baseUrl: string | number | boolean;
91
+ };
92
+ type HeyApiClientUrllib3Plugin = DefinePlugin<UserConfig$2, Config$2>;
93
+ //#endregion
94
+ //#region src/plugins/types.d.ts
95
+ type PluginClientNames = '@hey-api/client-aiohttp' | '@hey-api/client-httpx' | '@hey-api/client-requests' | '@hey-api/client-urllib3';
96
+ //#endregion
97
+ //#region src/py-compiler/nodes/kinds.d.ts
98
+ declare enum PyNodeKind {
99
+ Assignment = "Assignment",
100
+ AsyncExpression = "AsyncExpression",
101
+ AugmentedAssignment = "AugmentedAssignment",
102
+ AwaitExpression = "AwaitExpression",
103
+ BinaryExpression = "BinaryExpression",
104
+ Block = "Block",
105
+ BreakStatement = "BreakStatement",
106
+ CallExpression = "CallExpression",
107
+ ClassDeclaration = "ClassDeclaration",
108
+ Comment = "Comment",
109
+ ContinueStatement = "ContinueStatement",
110
+ DictComprehension = "DictComprehension",
111
+ DictExpression = "DictExpression",
112
+ EmptyStatement = "EmptyStatement",
113
+ ExceptClause = "ExceptClause",
114
+ ExpressionStatement = "ExpressionStatement",
115
+ FStringExpression = "FStringExpression",
116
+ ForStatement = "ForStatement",
117
+ FunctionDeclaration = "FunctionDeclaration",
118
+ FunctionParameter = "FunctionParameter",
119
+ GeneratorExpression = "GeneratorExpression",
120
+ Identifier = "Identifier",
121
+ IfStatement = "IfStatement",
122
+ ImportStatement = "ImportStatement",
123
+ KeywordArgument = "KeywordArgument",
124
+ LambdaExpression = "LambdaExpression",
125
+ ListComprehension = "ListComprehension",
126
+ ListExpression = "ListExpression",
127
+ Literal = "Literal",
128
+ MemberExpression = "MemberExpression",
129
+ RStringExpression = "RStringExpression",
130
+ RaiseStatement = "RaiseStatement",
131
+ ReturnStatement = "ReturnStatement",
132
+ SetComprehension = "SetComprehension",
133
+ SetExpression = "SetExpression",
134
+ SourceFile = "SourceFile",
135
+ SubscriptExpression = "SubscriptExpression",
136
+ SubscriptSlice = "SubscriptSlice",
137
+ TryStatement = "TryStatement",
138
+ TupleExpression = "TupleExpression",
139
+ WhileStatement = "WhileStatement",
140
+ WithItem = "WithItem",
141
+ WithStatement = "WithStatement",
142
+ YieldExpression = "YieldExpression",
143
+ YieldFromExpression = "YieldFromExpression"
144
+ }
145
+ //#endregion
146
+ //#region src/py-compiler/nodes/statements/block.d.ts
147
+ interface PyBlock extends PyNodeBase {
148
+ kind: PyNodeKind.Block;
149
+ statements: ReadonlyArray<PyStatement>;
150
+ }
151
+ declare function createBlock(statements: ReadonlyArray<PyStatement>, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyBlock;
152
+ //#endregion
153
+ //#region src/py-compiler/nodes/declarations/class.d.ts
154
+ interface PyClassDeclaration extends PyNodeBase {
155
+ baseClasses?: ReadonlyArray<PyNode>;
156
+ body: PyBlock;
157
+ decorators?: ReadonlyArray<PyExpression>;
158
+ docstring?: string;
159
+ kind: PyNodeKind.ClassDeclaration;
160
+ name: string;
161
+ }
162
+ declare function createClassDeclaration(name: string, body: ReadonlyArray<PyStatement>, decorators?: ReadonlyArray<PyExpression>, baseClasses?: ReadonlyArray<PyNode>, docstring?: string, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyClassDeclaration;
163
+ //#endregion
164
+ //#region src/py-compiler/nodes/declarations/function-parameter.d.ts
165
+ interface PyFunctionParameter extends PyNodeBase {
166
+ defaultValue?: PyExpression;
167
+ kind: PyNodeKind.FunctionParameter;
168
+ name: string;
169
+ type?: PyExpression;
170
+ }
171
+ declare function createFunctionParameter(name: string, type?: PyExpression, defaultValue?: PyExpression, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyFunctionParameter;
172
+ //#endregion
173
+ //#region src/py-compiler/nodes/declarations/function.d.ts
174
+ interface PyFunctionDeclaration extends PyNodeBase {
175
+ body: PyBlock;
176
+ decorators?: ReadonlyArray<PyExpression>;
177
+ docstring?: string;
178
+ kind: PyNodeKind.FunctionDeclaration;
179
+ modifiers?: ReadonlyArray<PyExpression>;
180
+ name: string;
181
+ parameters: ReadonlyArray<PyFunctionParameter>;
182
+ returnType?: PyExpression;
183
+ }
184
+ declare function createFunctionDeclaration(name: string, parameters: ReadonlyArray<PyFunctionParameter>, returnType: PyExpression | undefined, body: ReadonlyArray<PyStatement>, decorators?: ReadonlyArray<PyExpression>, docstring?: string, modifiers?: ReadonlyArray<PyExpression>, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyFunctionDeclaration;
185
+ //#endregion
186
+ //#region src/py-compiler/nodes/statements/assignment.d.ts
187
+ interface PyAssignment extends PyNodeBase {
188
+ kind: PyNodeKind.Assignment;
189
+ target: PyExpression;
190
+ type?: PyExpression;
191
+ value?: PyExpression;
192
+ }
193
+ declare function createAssignment(target: PyExpression, type?: PyExpression, value?: PyExpression, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyAssignment;
194
+ //#endregion
195
+ //#region src/py-compiler/nodes/statements/augmented-assignment.d.ts
196
+ type PyAugmentedOperator = '+=' | '-=' | '*=' | '/=' | '//=' | '%=' | '**=' | '&=' | '|=' | '^=' | '>>=' | '<<=';
197
+ interface PyAugmentedAssignment extends PyNodeBase {
198
+ kind: PyNodeKind.AugmentedAssignment;
199
+ operator: PyAugmentedOperator;
200
+ target: PyExpression;
201
+ value: PyExpression;
202
+ }
203
+ declare function createAugmentedAssignment(target: PyExpression, operator: PyAugmentedOperator, value: PyExpression): PyAugmentedAssignment;
204
+ //#endregion
205
+ //#region src/py-compiler/nodes/statements/break.d.ts
206
+ interface PyBreakStatement extends PyNodeBase {
207
+ kind: PyNodeKind.BreakStatement;
208
+ }
209
+ declare function createBreakStatement(): PyBreakStatement;
210
+ //#endregion
211
+ //#region src/py-compiler/nodes/statements/continue.d.ts
212
+ interface PyContinueStatement extends PyNodeBase {
213
+ kind: PyNodeKind.ContinueStatement;
214
+ }
215
+ declare function createContinueStatement(): PyContinueStatement;
216
+ //#endregion
217
+ //#region src/py-compiler/nodes/statements/empty.d.ts
218
+ interface PyEmptyStatement extends PyNodeBase {
219
+ kind: PyNodeKind.EmptyStatement;
220
+ }
221
+ declare function createEmptyStatement(): PyEmptyStatement;
222
+ //#endregion
223
+ //#region src/py-compiler/nodes/statements/expression.d.ts
224
+ interface PyExpressionStatement extends PyNodeBase {
225
+ expression: PyExpression;
226
+ kind: PyNodeKind.ExpressionStatement;
227
+ }
228
+ declare function createExpressionStatement(expression: PyExpression): PyExpressionStatement;
229
+ //#endregion
230
+ //#region src/py-compiler/nodes/statements/for.d.ts
231
+ interface PyForStatement extends PyNodeBase {
232
+ body: PyBlock;
233
+ elseBlock?: PyBlock;
234
+ iterable: PyExpression;
235
+ kind: PyNodeKind.ForStatement;
236
+ target: PyExpression;
237
+ }
238
+ declare function createForStatement(target: PyExpression, iterable: PyExpression, body: ReadonlyArray<PyStatement>, elseBlock?: ReadonlyArray<PyStatement>): PyForStatement;
239
+ //#endregion
240
+ //#region src/py-compiler/nodes/statements/if.d.ts
241
+ interface PyIfStatement extends PyNodeBase {
242
+ condition: PyExpression;
243
+ elseBlock?: PyBlock | PyIfStatement;
244
+ kind: PyNodeKind.IfStatement;
245
+ thenBlock: PyBlock;
246
+ }
247
+ declare function createIfStatement(condition: PyExpression, thenBlock: ReadonlyArray<PyStatement>, elseBlock?: ReadonlyArray<PyStatement> | PyIfStatement, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyIfStatement;
248
+ //#endregion
249
+ //#region src/py-compiler/nodes/statements/import.d.ts
250
+ interface PyImportStatement extends PyNodeBase {
251
+ isFrom: boolean;
252
+ kind: PyNodeKind.ImportStatement;
253
+ module: string;
254
+ names?: ReadonlyArray<{
255
+ alias?: string;
256
+ name: string;
257
+ }>;
258
+ }
259
+ declare function createImportStatement(module: string, names?: ReadonlyArray<{
260
+ alias?: string;
261
+ name: string;
262
+ }>, isFrom?: boolean): PyImportStatement;
263
+ //#endregion
264
+ //#region src/py-compiler/nodes/statements/raise.d.ts
265
+ interface PyRaiseStatement extends PyNodeBase {
266
+ expression?: PyExpression;
267
+ kind: PyNodeKind.RaiseStatement;
268
+ }
269
+ declare function createRaiseStatement(expression?: PyExpression): PyRaiseStatement;
270
+ //#endregion
271
+ //#region src/py-compiler/nodes/statements/return.d.ts
272
+ interface PyReturnStatement extends PyNodeBase {
273
+ expression?: PyExpression;
274
+ kind: PyNodeKind.ReturnStatement;
275
+ }
276
+ declare function createReturnStatement(expression?: PyExpression): PyReturnStatement;
277
+ //#endregion
278
+ //#region src/py-compiler/nodes/expressions/identifier.d.ts
279
+ interface PyIdentifier extends PyNodeBase {
280
+ kind: PyNodeKind.Identifier;
281
+ name: string;
282
+ }
283
+ declare function createIdentifier(name: string, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyIdentifier;
284
+ //#endregion
285
+ //#region src/py-compiler/nodes/statements/except.d.ts
286
+ interface PyExceptClause extends PyNodeBase {
287
+ block: PyBlock;
288
+ exceptionName?: PyIdentifier;
289
+ exceptionType?: PyExpression;
290
+ kind: PyNodeKind.ExceptClause;
291
+ }
292
+ declare function createExceptClause(block: ReadonlyArray<PyStatement>, exceptionType?: PyExpression, exceptionName?: PyIdentifier): PyExceptClause;
293
+ //#endregion
294
+ //#region src/py-compiler/nodes/statements/try.d.ts
295
+ interface PyTryStatement extends PyNodeBase {
296
+ elseBlock?: PyBlock;
297
+ exceptClauses?: ReadonlyArray<PyExceptClause>;
298
+ finallyBlock?: PyBlock;
299
+ kind: PyNodeKind.TryStatement;
300
+ tryBlock: PyBlock;
301
+ }
302
+ declare function createTryStatement(tryBlock: ReadonlyArray<PyStatement>, exceptClauses?: ReadonlyArray<PyExceptClause>, elseBlock?: ReadonlyArray<PyStatement>, finallyBlock?: ReadonlyArray<PyStatement>): PyTryStatement;
303
+ //#endregion
304
+ //#region src/py-compiler/nodes/statements/while.d.ts
305
+ interface PyWhileStatement extends PyNodeBase {
306
+ body: PyBlock;
307
+ condition: PyExpression;
308
+ elseBlock?: PyBlock;
309
+ kind: PyNodeKind.WhileStatement;
310
+ }
311
+ declare function createWhileStatement(condition: PyExpression, body: ReadonlyArray<PyStatement>, elseBlock?: ReadonlyArray<PyStatement>): PyWhileStatement;
312
+ //#endregion
313
+ //#region src/py-compiler/nodes/statements/with-item.d.ts
314
+ interface PyWithItem extends PyNodeBase {
315
+ alias?: PyExpression;
316
+ contextExpr: PyExpression;
317
+ kind: PyNodeKind.WithItem;
318
+ }
319
+ declare function createWithItem(contextExpr: PyExpression, alias?: PyExpression, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyWithItem;
320
+ //#endregion
321
+ //#region src/py-compiler/nodes/statements/with.d.ts
322
+ interface PyWithStatement extends PyNodeBase {
323
+ body: PyBlock;
324
+ items: ReadonlyArray<PyWithItem>;
325
+ kind: PyNodeKind.WithStatement;
326
+ modifiers?: ReadonlyArray<PyExpression>;
327
+ }
328
+ declare function createWithStatement(items: ReadonlyArray<PyWithItem>, body: ReadonlyArray<PyStatement>, modifiers?: ReadonlyArray<PyExpression>, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyWithStatement;
329
+ //#endregion
330
+ //#region src/py-compiler/nodes/structure/comment.d.ts
331
+ interface PyComment extends PyNodeBase {
332
+ kind: PyNodeKind.Comment;
333
+ text: string;
334
+ }
335
+ declare function createComment(text: string): PyComment;
336
+ //#endregion
337
+ //#region src/py-compiler/nodes/statement.d.ts
338
+ type PyStatement = PyAssignment | PyAugmentedAssignment | PyBreakStatement | PyClassDeclaration | PyComment | PyContinueStatement | PyEmptyStatement | PyExpressionStatement | PyForStatement | PyFunctionDeclaration | PyFunctionParameter | PyIfStatement | PyImportStatement | PyRaiseStatement | PyReturnStatement | PyTryStatement | PyWhileStatement | PyWithStatement;
339
+ //#endregion
340
+ //#region src/py-compiler/nodes/structure/source-file.d.ts
341
+ interface PySourceFile extends PyNodeBase {
342
+ docstring?: string;
343
+ kind: PyNodeKind.SourceFile;
344
+ statements: ReadonlyArray<PyNode>;
345
+ }
346
+ declare function createSourceFile(statements: ReadonlyArray<PyNode>, docstring?: string, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PySourceFile;
347
+ //#endregion
348
+ //#region src/py-compiler/nodes/base.d.ts
349
+ interface PyNodeBase {
350
+ kind: PyNodeKind;
351
+ leadingComments?: ReadonlyArray<string>;
352
+ trailingComments?: ReadonlyArray<string>;
353
+ }
354
+ type PyNode = PyBlock | PyExpression | PySourceFile | PyStatement;
355
+ //#endregion
356
+ //#region src/py-compiler/nodes/expressions/comprehensions/dict.d.ts
357
+ interface PyDictComprehension extends PyComprehensionNode {
358
+ key: PyExpression;
359
+ kind: PyNodeKind.DictComprehension;
360
+ value: PyExpression;
361
+ }
362
+ declare function createDictComprehension(key: PyExpression, value: PyExpression, target: PyExpression, iterable: PyExpression, ifs?: ReadonlyArray<PyExpression>, isAsync?: boolean): PyDictComprehension;
363
+ //#endregion
364
+ //#region src/py-compiler/nodes/expressions/comprehensions/list.d.ts
365
+ interface PyListComprehension extends PyComprehensionNode {
366
+ element: PyExpression;
367
+ kind: PyNodeKind.ListComprehension;
368
+ }
369
+ declare function createListComprehension(element: PyExpression, target: PyExpression, iterable: PyExpression, ifs?: ReadonlyArray<PyExpression>, isAsync?: boolean): PyListComprehension;
370
+ //#endregion
371
+ //#region src/py-compiler/nodes/expressions/comprehensions/set.d.ts
372
+ interface PySetComprehension extends PyComprehensionNode {
373
+ element: PyExpression;
374
+ kind: PyNodeKind.SetComprehension;
375
+ }
376
+ declare function createSetComprehension(element: PyExpression, target: PyExpression, iterable: PyExpression, ifs?: ReadonlyArray<PyExpression>, isAsync?: boolean): PySetComprehension;
377
+ //#endregion
378
+ //#region src/py-compiler/nodes/comprehension.d.ts
379
+ type PyComprehension = PyDictComprehension | PyListComprehension | PySetComprehension;
380
+ interface PyComprehensionNode extends PyNodeBase {
381
+ ifs?: ReadonlyArray<PyExpression>;
382
+ isAsync?: boolean;
383
+ iterable: PyExpression;
384
+ target: PyExpression;
385
+ }
386
+ //#endregion
387
+ //#region src/py-compiler/nodes/expressions/async.d.ts
388
+ interface PyAsyncExpression extends PyNodeBase {
389
+ expression: PyExpression;
390
+ kind: PyNodeKind.AsyncExpression;
391
+ }
392
+ declare function createAsyncExpression(expression: PyExpression): PyAsyncExpression;
393
+ //#endregion
394
+ //#region src/py-compiler/nodes/expressions/await.d.ts
395
+ interface PyAwaitExpression extends PyNodeBase {
396
+ expression: PyExpression;
397
+ kind: PyNodeKind.AwaitExpression;
398
+ }
399
+ declare function createAwaitExpression(expression: PyExpression): PyAwaitExpression;
400
+ //#endregion
401
+ //#region src/py-compiler/nodes/expressions/binary.d.ts
402
+ type PyBinaryOperator = '+' | '-' | '*' | '/' | '//' | '%' | '**' | '==' | '!=' | '>' | '>=' | '<' | '<=' | 'is' | 'is not' | 'in' | 'not in' | 'and' | 'or' | '|' | '&' | '^' | '<<' | '>>';
403
+ interface PyBinaryExpression extends PyNodeBase {
404
+ kind: PyNodeKind.BinaryExpression;
405
+ left: PyExpression;
406
+ operator: PyBinaryOperator;
407
+ right: PyExpression;
408
+ }
409
+ declare function createBinaryExpression(left: PyExpression, operator: PyBinaryOperator, right: PyExpression, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyBinaryExpression;
410
+ //#endregion
411
+ //#region src/py-compiler/nodes/expressions/call.d.ts
412
+ interface PyCallExpression extends PyNodeBase {
413
+ args: ReadonlyArray<PyExpression>;
414
+ callee: PyExpression;
415
+ kind: PyNodeKind.CallExpression;
416
+ }
417
+ declare function createCallExpression(callee: PyExpression, args: ReadonlyArray<PyExpression>, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyCallExpression;
418
+ //#endregion
419
+ //#region src/py-compiler/nodes/expressions/dict.d.ts
420
+ interface PyDictExpression extends PyNodeBase {
421
+ entries: ReadonlyArray<{
422
+ key: PyExpression;
423
+ value: PyExpression;
424
+ }>;
425
+ kind: PyNodeKind.DictExpression;
426
+ }
427
+ declare function createDictExpression(entries: ReadonlyArray<{
428
+ key: PyExpression;
429
+ value: PyExpression;
430
+ }>): PyDictExpression;
431
+ //#endregion
432
+ //#region src/py-compiler/nodes/expressions/f-string.d.ts
433
+ interface PyFStringExpression extends PyNodeBase {
434
+ kind: PyNodeKind.FStringExpression;
435
+ parts: Array<string | PyExpression>;
436
+ }
437
+ declare function createFStringExpression(parts: Array<string | PyExpression>, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyFStringExpression;
438
+ //#endregion
439
+ //#region src/py-compiler/nodes/expressions/generator.d.ts
440
+ interface PyGeneratorExpression extends PyNodeBase {
441
+ element: PyExpression;
442
+ ifs?: ReadonlyArray<PyExpression>;
443
+ isAsync?: boolean;
444
+ iterable: PyExpression;
445
+ kind: PyNodeKind.GeneratorExpression;
446
+ target: PyExpression;
447
+ }
448
+ declare function createGeneratorExpression(element: PyExpression, target: PyExpression, iterable: PyExpression, ifs?: ReadonlyArray<PyExpression>, isAsync?: boolean, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyGeneratorExpression;
449
+ //#endregion
450
+ //#region src/py-compiler/nodes/expressions/keyword-arg.d.ts
451
+ interface PyKeywordArgument extends PyNodeBase {
452
+ kind: PyNodeKind.KeywordArgument;
453
+ name: string;
454
+ value: PyExpression;
455
+ }
456
+ declare function createKeywordArgument(name: string, value: PyExpression, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyKeywordArgument;
457
+ //#endregion
458
+ //#region src/py-compiler/nodes/expressions/lambda.d.ts
459
+ interface PyLambdaExpression extends PyNodeBase {
460
+ expression: PyExpression;
461
+ kind: PyNodeKind.LambdaExpression;
462
+ parameters: ReadonlyArray<PyFunctionParameter>;
463
+ }
464
+ declare function createLambdaExpression(parameters: ReadonlyArray<PyFunctionParameter>, expression: PyExpression): PyLambdaExpression;
465
+ //#endregion
466
+ //#region src/py-compiler/nodes/expressions/list.d.ts
467
+ interface PyListExpression extends PyNodeBase {
468
+ elements: ReadonlyArray<PyNode>;
469
+ kind: PyNodeKind.ListExpression;
470
+ }
471
+ declare function createListExpression(elements: ReadonlyArray<PyNode>): PyListExpression;
472
+ //#endregion
473
+ //#region src/py-compiler/nodes/expressions/literal.d.ts
474
+ type PyLiteralValue = string | number | boolean | null;
475
+ interface PyLiteral extends PyNodeBase {
476
+ kind: PyNodeKind.Literal;
477
+ value: PyLiteralValue;
478
+ }
479
+ declare function createLiteral(value: PyLiteralValue, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyLiteral;
480
+ //#endregion
481
+ //#region src/py-compiler/nodes/expressions/member.d.ts
482
+ interface PyMemberExpression extends PyNodeBase {
483
+ kind: PyNodeKind.MemberExpression;
484
+ member: PyIdentifier;
485
+ object: PyExpression;
486
+ }
487
+ declare function createMemberExpression(object: PyExpression, member: PyIdentifier, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyMemberExpression;
488
+ //#endregion
489
+ //#region src/py-compiler/nodes/expressions/r-string.d.ts
490
+ interface PyRStringExpression extends PyNodeBase {
491
+ kind: PyNodeKind.RStringExpression;
492
+ value: string;
493
+ }
494
+ declare function createRStringExpression(value: string, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>): PyRStringExpression;
495
+ //#endregion
496
+ //#region src/py-compiler/nodes/expressions/set.d.ts
497
+ interface PySetExpression extends PyNodeBase {
498
+ elements: ReadonlyArray<PyExpression>;
499
+ kind: PyNodeKind.SetExpression;
500
+ }
501
+ declare function createSetExpression(elements: ReadonlyArray<PyExpression>): PySetExpression;
502
+ //#endregion
503
+ //#region src/py-compiler/nodes/expressions/subscript.d.ts
504
+ interface PySubscriptExpression extends PyNodeBase {
505
+ kind: PyNodeKind.SubscriptExpression;
506
+ slice: PyExpression;
507
+ value: PyExpression;
508
+ }
509
+ declare function createSubscriptExpression(value: PyExpression, slice: PyExpression): PySubscriptExpression;
510
+ //#endregion
511
+ //#region src/py-compiler/nodes/expressions/subscript-slice.d.ts
512
+ interface PySubscriptSlice extends PyNodeBase {
513
+ elements: ReadonlyArray<PyExpression>;
514
+ kind: PyNodeKind.SubscriptSlice;
515
+ }
516
+ declare function createSubscriptSlice(elements: ReadonlyArray<PyExpression>): PySubscriptSlice;
517
+ //#endregion
518
+ //#region src/py-compiler/nodes/expressions/tuple.d.ts
519
+ interface PyTupleExpression extends PyNodeBase {
520
+ elements: ReadonlyArray<PyExpression>;
521
+ kind: PyNodeKind.TupleExpression;
522
+ }
523
+ declare function createTupleExpression(elements: ReadonlyArray<PyExpression>): PyTupleExpression;
524
+ //#endregion
525
+ //#region src/py-compiler/nodes/expressions/yield.d.ts
526
+ interface PyYieldExpression extends PyNodeBase {
527
+ kind: PyNodeKind.YieldExpression;
528
+ value?: PyExpression;
529
+ }
530
+ declare function createYieldExpression(value?: PyExpression): PyYieldExpression;
531
+ //#endregion
532
+ //#region src/py-compiler/nodes/expressions/yield-from.d.ts
533
+ interface PyYieldFromExpression extends PyNodeBase {
534
+ expression: PyExpression;
535
+ kind: PyNodeKind.YieldFromExpression;
536
+ }
537
+ declare function createYieldFromExpression(expression: PyExpression): PyYieldFromExpression;
538
+ //#endregion
539
+ //#region src/py-compiler/nodes/expression.d.ts
540
+ type PyExpression = PyAsyncExpression | PyAwaitExpression | PyBinaryExpression | PyCallExpression | PyComprehension | PyDictExpression | PyFStringExpression | PyGeneratorExpression | PyIdentifier | PyKeywordArgument | PyLambdaExpression | PyListExpression | PyLiteral | PyMemberExpression | PyRStringExpression | PySetExpression | PySubscriptExpression | PySubscriptSlice | PyTupleExpression | PyYieldExpression | PyYieldFromExpression;
541
+ //#endregion
542
+ //#region src/py-compiler/printer.d.ts
543
+ type QuoteStyle = 'single' | 'double';
544
+ type QuoteFallback = 'avoid-escape' | 'escape';
545
+ interface PyPrinterOptions {
546
+ /**
547
+ * Number of spaces per indentation level.
548
+ *
549
+ * @default 4
550
+ */
551
+ indentSize?: number;
552
+ /**
553
+ * How to handle strings that contain the preferred quote character.
554
+ * - `'avoid-escape'`: switch to the alternative quote style to avoid
555
+ * escaping, unless the string contains both quote characters
556
+ * - `'escape'`: always use the preferred quote style, escaping conflicts
557
+ * with a backslash
558
+ *
559
+ * @default 'avoid-escape'
560
+ */
561
+ quoteConflict?: QuoteFallback;
562
+ /**
563
+ * Preferred string quote character.
564
+ *
565
+ * @default 'double'
566
+ */
567
+ quoteStyle?: QuoteStyle;
568
+ }
569
+ declare function createPrinter(options?: PyPrinterOptions): {
570
+ printFile: (node: PyNode) => string;
571
+ };
572
+ declare function printAst(node: PyNode): string;
573
+ //#endregion
574
+ //#region src/py-compiler/index.d.ts
575
+ declare namespace py {
576
+ type Node = PyNode;
577
+ type NodeBase = PyNodeBase;
578
+ type NodeKind = PyNodeKind;
579
+ type Expression = PyExpression;
580
+ type Statement = PyStatement;
581
+ type SourceFile = PySourceFile;
582
+ type Comment = PyComment;
583
+ type ClassDeclaration = PyClassDeclaration;
584
+ type FunctionDeclaration = PyFunctionDeclaration;
585
+ type FunctionParameter = PyFunctionParameter;
586
+ type Assignment = PyAssignment;
587
+ type AugmentedAssignment = PyAugmentedAssignment;
588
+ type AugmentedOperator = PyAugmentedOperator;
589
+ type Block = PyBlock;
590
+ type BreakStatement = PyBreakStatement;
591
+ type ContinueStatement = PyContinueStatement;
592
+ type EmptyStatement = PyEmptyStatement;
593
+ type ExceptClause = PyExceptClause;
594
+ type ExpressionStatement = PyExpressionStatement;
595
+ type ForStatement = PyForStatement;
596
+ type IfStatement = PyIfStatement;
597
+ type ImportStatement = PyImportStatement;
598
+ type RaiseStatement = PyRaiseStatement;
599
+ type ReturnStatement = PyReturnStatement;
600
+ type TryStatement = PyTryStatement;
601
+ type WhileStatement = PyWhileStatement;
602
+ type WithItem = PyWithItem;
603
+ type WithStatement = PyWithStatement;
604
+ type AsyncExpression = PyAsyncExpression;
605
+ type AwaitExpression = PyAwaitExpression;
606
+ type BinaryExpression = PyBinaryExpression;
607
+ type BinaryOperator = PyBinaryOperator;
608
+ type CallExpression = PyCallExpression;
609
+ type DictExpression = PyDictExpression;
610
+ type FStringExpression = PyFStringExpression;
611
+ type GeneratorExpression = PyGeneratorExpression;
612
+ type Identifier = PyIdentifier;
613
+ type KeywordArgument = PyKeywordArgument;
614
+ type LambdaExpression = PyLambdaExpression;
615
+ type ListExpression = PyListExpression;
616
+ type Literal = PyLiteral;
617
+ type MemberExpression = PyMemberExpression;
618
+ type RStringExpression = PyRStringExpression;
619
+ type SetExpression = PySetExpression;
620
+ type SubscriptExpression = PySubscriptExpression;
621
+ type SubscriptSlice = PySubscriptSlice;
622
+ type TupleExpression = PyTupleExpression;
623
+ type YieldExpression = PyYieldExpression;
624
+ type YieldFromExpression = PyYieldFromExpression;
625
+ type Comprehension = PyComprehension;
626
+ type ComprehensionNode = PyComprehensionNode;
627
+ type DictComprehension = PyDictComprehension;
628
+ type ListComprehension = PyListComprehension;
629
+ type SetComprehension = PySetComprehension;
630
+ type PrinterOptions = PyPrinterOptions;
631
+ type LiteralValue = PyLiteralValue;
632
+ }
633
+ declare const py: {
634
+ readonly PyNodeKind: typeof PyNodeKind;
635
+ readonly createPrinter: typeof createPrinter;
636
+ readonly factory: {
637
+ createAssignment: typeof createAssignment;
638
+ createAsyncExpression: typeof createAsyncExpression;
639
+ createAugmentedAssignment: typeof createAugmentedAssignment;
640
+ createAwaitExpression: typeof createAwaitExpression;
641
+ createBinaryExpression: typeof createBinaryExpression;
642
+ createBlock: typeof createBlock;
643
+ createBreakStatement: typeof createBreakStatement;
644
+ createCallExpression: typeof createCallExpression;
645
+ createClassDeclaration: typeof createClassDeclaration;
646
+ createComment: typeof createComment;
647
+ createContinueStatement: typeof createContinueStatement;
648
+ createDictComprehension: typeof createDictComprehension;
649
+ createDictExpression: typeof createDictExpression;
650
+ createEmptyStatement: typeof createEmptyStatement;
651
+ createExceptClause: typeof createExceptClause;
652
+ createExpressionStatement: typeof createExpressionStatement;
653
+ createFStringExpression: typeof createFStringExpression;
654
+ createForStatement: typeof createForStatement;
655
+ createFunctionDeclaration: typeof createFunctionDeclaration;
656
+ createFunctionParameter: typeof createFunctionParameter;
657
+ createGeneratorExpression: typeof createGeneratorExpression;
658
+ createIdentifier: typeof createIdentifier;
659
+ createIfStatement: typeof createIfStatement;
660
+ createImportStatement: typeof createImportStatement;
661
+ createKeywordArgument: typeof createKeywordArgument;
662
+ createLambdaExpression: typeof createLambdaExpression;
663
+ createListComprehension: typeof createListComprehension;
664
+ createListExpression: typeof createListExpression;
665
+ createLiteral: typeof createLiteral;
666
+ createMemberExpression: typeof createMemberExpression;
667
+ createRStringExpression: typeof createRStringExpression;
668
+ createRaiseStatement: typeof createRaiseStatement;
669
+ createReturnStatement: typeof createReturnStatement;
670
+ createSetComprehension: typeof createSetComprehension;
671
+ createSetExpression: typeof createSetExpression;
672
+ createSourceFile: typeof createSourceFile;
673
+ createSubscriptExpression: typeof createSubscriptExpression;
674
+ createSubscriptSlice: typeof createSubscriptSlice;
675
+ createTryStatement: typeof createTryStatement;
676
+ createTupleExpression: typeof createTupleExpression;
677
+ createWhileStatement: typeof createWhileStatement;
678
+ createWithItem: typeof createWithItem;
679
+ createWithStatement: typeof createWithStatement;
680
+ createYieldExpression: typeof createYieldExpression;
681
+ createYieldFromExpression: typeof createYieldFromExpression;
682
+ };
683
+ readonly printAst: typeof printAst;
684
+ };
685
+ //#endregion
686
+ //#region src/py-dsl/mixins/types.d.ts
687
+ type BaseCtor<T extends py.Node> = abstract new (...args: Array<any>) => PyDsl<T>;
688
+ type DropFirst<T extends Array<any>> = T extends [any, ...infer Rest] ? Rest : never;
689
+ type MixinCtor<T extends BaseCtor<any>, K> = abstract new (...args: Array<any>) => InstanceType<T> & K;
690
+ //#endregion
691
+ //#region src/py-dsl/expr/attr.d.ts
692
+ type AttrLeft = NodeName$1 | MaybePyDsl<py.Expression>;
693
+ type AttrCtor = (left: AttrLeft, right: NodeName$1) => AttrPyDsl;
694
+ declare const Mixed$36: MixinCtor<abstract new () => PyDsl<PyMemberExpression, "python">, ExprMethods>;
695
+ declare class AttrPyDsl extends Mixed$36 {
696
+ readonly '~dsl' = "AttrPyDsl";
697
+ protected left: Ref<AttrLeft>;
698
+ constructor(left: AttrLeft, right: NodeName$1);
699
+ analyze(ctx: AnalysisContext): void;
700
+ /** Returns true when all required builder calls are present. */
701
+ get isValid(): boolean;
702
+ toAst(): PyMemberExpression;
703
+ $validate(): asserts this is this & {
704
+ left: MaybePyDsl<py.Expression>;
705
+ };
706
+ private missingRequiredCalls;
707
+ }
708
+ //#endregion
709
+ //#region src/py-dsl/expr/binary.d.ts
710
+ type BinaryCtor = (left: MaybePyDsl<py.Expression>, op: PyBinaryOperator, right: MaybePyDsl<py.Expression>) => BinaryPyDsl;
711
+ declare const Mixed$35: abstract new () => PyDsl<PyBinaryExpression, "python">;
712
+ declare class BinaryPyDsl extends Mixed$35 {
713
+ readonly '~dsl' = "BinaryPyDsl";
714
+ protected _left?: Ref<MaybePyDsl<py.Expression>>;
715
+ protected _op?: PyBinaryOperator;
716
+ protected _right?: Ref<MaybePyDsl<py.Expression>>;
717
+ constructor(left: MaybePyDsl<py.Expression>, op: PyBinaryOperator, right: MaybePyDsl<py.Expression>);
718
+ analyze(ctx: AnalysisContext): void;
719
+ /** Returns true when all required builder calls are present. */
720
+ get isValid(): boolean;
721
+ and(right: MaybePyDsl<py.Expression>): this;
722
+ div(right: MaybePyDsl<py.Expression>): this;
723
+ eq(right: MaybePyDsl<py.Expression>): this;
724
+ floordiv(right: MaybePyDsl<py.Expression>): this;
725
+ gt(right: MaybePyDsl<py.Expression>): this;
726
+ gte(right: MaybePyDsl<py.Expression>): this;
727
+ in_(right: MaybePyDsl<py.Expression>): this;
728
+ is(right: MaybePyDsl<py.Expression>): this;
729
+ isNot(right: MaybePyDsl<py.Expression>): this;
730
+ lt(right: MaybePyDsl<py.Expression>): this;
731
+ lte(right: MaybePyDsl<py.Expression>): this;
732
+ minus(right: MaybePyDsl<py.Expression>): this;
733
+ mod(right: MaybePyDsl<py.Expression>): this;
734
+ neq(right: MaybePyDsl<py.Expression>): this;
735
+ notIn(right: MaybePyDsl<py.Expression>): this;
736
+ or(right: MaybePyDsl<py.Expression>): this;
737
+ plus(right: MaybePyDsl<py.Expression>): this;
738
+ pow(right: MaybePyDsl<py.Expression>): this;
739
+ times(right: MaybePyDsl<py.Expression>): this;
740
+ toAst(): PyBinaryExpression;
741
+ $validate(): asserts this is this & {
742
+ _left: MaybePyDsl<py.Expression>;
743
+ _op: PyBinaryOperator;
744
+ _right: MaybePyDsl<py.Expression>;
745
+ };
746
+ private missingRequiredCalls;
747
+ private opAndExpr;
748
+ }
749
+ //#endregion
750
+ //#region src/py-dsl/expr/expr.d.ts
751
+ type ExprId = NodeName$1 | MaybePyDsl<py.Expression>;
752
+ type ExprCtor = (id: ExprId) => ExprPyDsl;
753
+ declare const Mixed$34: MixinCtor<abstract new () => PyDsl<PyExpression, "python">, ExprMethods>;
754
+ declare class ExprPyDsl extends Mixed$34 {
755
+ readonly '~dsl' = "ExprPyDsl";
756
+ protected _exprInput: Ref<ExprId>;
757
+ constructor(id: ExprId);
758
+ analyze(ctx: AnalysisContext): void;
759
+ toAst(): any;
760
+ }
761
+ //#endregion
762
+ //#region src/py-dsl/mixins/layout.d.ts
763
+ interface LayoutMethods extends Node$1 {
764
+ /** Computes whether output should be multiline based on layout setting and element count. */
765
+ $multiline(count: number): boolean;
766
+ /** Sets automatic line output with optional threshold (default: 3). */
767
+ auto(threshold?: number): this;
768
+ /** Sets single line output. */
769
+ inline(): this;
770
+ /** Sets multi line output. */
771
+ pretty(): this;
772
+ }
773
+ //#endregion
774
+ //#region src/py-dsl/expr/subscript.d.ts
775
+ type SubscriptExpr = NodeName$1 | MaybePyDsl<py.Expression>;
776
+ type SubscriptCtor = (value: SubscriptExpr, ...slices: Array<SubscriptExpr>) => SubscriptPyDsl;
777
+ declare const Mixed$33: MixinCtor<abstract new () => PyDsl<PySubscriptExpression, "python">, LayoutMethods>;
778
+ declare class SubscriptPyDsl extends Mixed$33 {
779
+ readonly '~dsl' = "SubscriptPyDsl";
780
+ protected _slices: Array<Ref<SubscriptExpr>>;
781
+ protected _value: Ref<SubscriptExpr>;
782
+ constructor(value: SubscriptExpr, ...slices: Array<SubscriptExpr>);
783
+ analyze(ctx: AnalysisContext): void;
784
+ toAst(): PySubscriptExpression;
785
+ }
786
+ //#endregion
787
+ //#region src/py-dsl/expr/tuple.d.ts
788
+ type TupleElement = NodeName$1 | MaybePyDsl<py.Expression>;
789
+ type TupleCtor = (...elements: Array<TupleElement>) => TuplePyDsl;
790
+ declare const Mixed$32: MixinCtor<abstract new () => PyDsl<PyTupleExpression, "python">, LayoutMethods>;
791
+ declare class TuplePyDsl extends Mixed$32 {
792
+ readonly '~dsl' = "TuplePyDsl";
793
+ protected _elements: Array<Ref<TupleElement>>;
794
+ constructor(...elements: Array<TupleElement>);
795
+ analyze(ctx: AnalysisContext): void;
796
+ element(expr: TupleElement): this;
797
+ elements(...exprs: ReadonlyArray<TupleElement>): this;
798
+ toAst(): PyTupleExpression;
799
+ }
800
+ //#endregion
801
+ //#region src/py-dsl/stmt/return.d.ts
802
+ type ReturnExpr = NodeName$1 | MaybePyDsl<py.Expression>;
803
+ type ReturnCtor = (expr?: ReturnExpr) => ReturnPyDsl;
804
+ declare const Mixed$31: abstract new () => PyDsl<PyReturnStatement, "python">;
805
+ declare class ReturnPyDsl extends Mixed$31 {
806
+ readonly '~dsl' = "ReturnPyDsl";
807
+ protected _returnExpr?: Ref<ReturnExpr>;
808
+ constructor(expr?: ReturnExpr);
809
+ analyze(ctx: AnalysisContext): void;
810
+ toAst(): PyReturnStatement;
811
+ }
812
+ //#endregion
813
+ //#region src/py-dsl/utils/factories.d.ts
814
+ type Ctor = (...args: Array<any>) => any;
815
+ type Factory<T extends Ctor> = {
816
+ (...args: Parameters<T>): ReturnType<T>; /** Sets the implementation of this factory. */
817
+ set(fn: T): void;
818
+ };
819
+ declare const f: {
820
+ /** Factory for creating property access expressions (e.g., `obj.foo`). */attr: Factory<AttrCtor>; /** Factory for creating binary expressions (e.g., `a + b`). */
821
+ binary: Factory<BinaryCtor>; /** Factory for creating function or method call expressions (e.g., `fn(arg)`). */
822
+ call: Factory<CallCtor>; /** Factory for creating expression nodes. */
823
+ expr: Factory<ExprCtor>; /** Factory for creating return statements. */
824
+ return: Factory<ReturnCtor>; /** Factory for creating slice expressions. */
825
+ slice: Factory<SubscriptCtor>; /** Factory for creating tuple expressions. */
826
+ tuple: Factory<TupleCtor>;
827
+ };
828
+ //#endregion
829
+ //#region src/py-dsl/mixins/expr.d.ts
830
+ interface ExprMethods extends Node$1 {
831
+ /** Accesses a property on the current expression (e.g., `this.foo`). */
832
+ attr(...args: DropFirst<Parameters<typeof f.attr>>): ReturnType<typeof f.attr>;
833
+ /** Calls the current expression (e.g., `fn(arg1, arg2)`). */
834
+ call(...args: DropFirst<Parameters<typeof f.call>>): ReturnType<typeof f.call>;
835
+ /** Produces a `return` statement returning the current expression. */
836
+ return(): ReturnType<typeof f.return>;
837
+ /** Produces a subscript/slice expression (e.g., `expr[args]`). */
838
+ slice(...args: DropFirst<Parameters<typeof f.slice>>): ReturnType<typeof f.slice>;
839
+ }
840
+ //#endregion
841
+ //#region src/py-dsl/mixins/args.d.ts
842
+ type Arg = NodeName$1 | MaybePyDsl<py.Expression>;
843
+ interface ArgsMethods extends Node$1 {
844
+ /** Renders the arguments into an array of `Expression`s. */
845
+ $args(): ReadonlyArray<py.Expression>;
846
+ /** Adds a single expression argument. */
847
+ arg(arg: Arg | undefined): this;
848
+ /** Adds one or more expression arguments. */
849
+ args(...args: ReadonlyArray<Arg | undefined>): this;
850
+ }
851
+ //#endregion
852
+ //#region src/py-dsl/expr/call.d.ts
853
+ type CallArgs = ReadonlyArray<CallCallee | undefined>;
854
+ type CallCallee = NodeName$1 | MaybePyDsl<py.Expression>;
855
+ type CallCtor = (callee: CallCallee, ...args: CallArgs) => CallPyDsl;
856
+ declare const Mixed$30: MixinCtor<MixinCtor<abstract new () => PyDsl<PyCallExpression, "python">, ExprMethods>, ArgsMethods>;
857
+ declare class CallPyDsl extends Mixed$30 {
858
+ readonly '~dsl' = "CallPyDsl";
859
+ protected _callee: Ref<CallCallee>;
860
+ constructor(callee: CallCallee, ...args: CallArgs);
861
+ analyze(ctx: AnalysisContext): void;
862
+ /** Returns true when all required builder calls are present. */
863
+ get isValid(): boolean;
864
+ toAst(): PyCallExpression;
865
+ $validate(): asserts this is this & {
866
+ _callee: MaybePyDsl<py.Expression>;
867
+ };
868
+ private missingRequiredCalls;
869
+ }
870
+ //#endregion
871
+ //#region src/py-dsl/utils/context.d.ts
872
+ type NodeChain = ReadonlyArray<PyDsl>;
873
+ interface AccessOptions {
874
+ /** The access context. */
875
+ context?: 'example';
876
+ /** Enable debug mode. */
877
+ debug?: boolean;
878
+ /** Transform function for each node in the access chain. */
879
+ transform?: (node: PyDsl, index: number, chain: NodeChain) => PyDsl;
880
+ }
881
+ interface ExampleOptions {
882
+ /** Import kind for the root node. */
883
+ importKind?: BindingKind;
884
+ /** Import name for the root node. */
885
+ importName?: string;
886
+ /** Setup to run before calling the example. */
887
+ importSetup?: MaybeFunc<(ctx: DollarPyDsl & {
888
+ /** The imported expression. */node: PyDsl<py.Expression>;
889
+ }) => PyDsl<py.Expression>>;
890
+ /** Module to import from. */
891
+ moduleName?: string;
892
+ /** Example request payload. */
893
+ payload?: MaybeFunc<(ctx: DollarPyDsl) => CallArgs | CallArgs[number]>;
894
+ /** Variable name for setup node. */
895
+ setupName?: string;
896
+ }
897
+ /**
898
+ * Fold a structural chain to an access chain by removing
899
+ * non-accessor nodes.
900
+ */
901
+ declare class PyDslContext {}
902
+ declare const ctx: PyDslContext;
903
+ //#endregion
904
+ //#region src/py-dsl/base.d.ts
905
+ declare abstract class PyDsl<T extends py.Node = py.Node, L extends Language = 'python'> implements Node$1<T, L> {
906
+ analyze(_: AnalysisContext): void;
907
+ clone(): this;
908
+ exported?: boolean;
909
+ file?: File;
910
+ get name(): Node$1['name'];
911
+ readonly nameSanitizer?: NodeNameSanitizer;
912
+ language: L;
913
+ meta: Required<ProjectMeta>[L];
914
+ parent?: Node$1;
915
+ root: boolean;
916
+ scope?: NodeScope;
917
+ structuralChildren?: Map<PyDsl, NodeRelationship>;
918
+ structuralParents?: Map<PyDsl, NodeRelationship>;
919
+ symbol?: Symbol$1;
920
+ toAst(): T;
921
+ readonly '~brand': any;
922
+ /** Branding property to identify the DSL class at runtime. */
923
+ abstract readonly '~dsl': AnyString;
924
+ /** Conditionally applies a callback to this builder. */
925
+ $if<T extends PyDsl, V, R extends PyDsl = T>(this: T, value: V, ifTrue: (self: T, v: Exclude<V, false | null | undefined>) => R | void, ifFalse?: (self: T, v: Extract<V, false | null | undefined>) => R | void): R | T;
926
+ $if<T extends PyDsl, V, R extends PyDsl = T>(this: T, value: V, ifTrue: (v: Exclude<V, false | null | undefined>) => R | void, ifFalse?: (v: Extract<V, false | null | undefined>) => R | void): R | T;
927
+ $if<T extends PyDsl, V, R extends PyDsl = T>(this: T, value: V, ifTrue: () => R | void, ifFalse?: () => R | void): R | T;
928
+ /** Access patterns for this node. */
929
+ toAccessNode?(node: this, options: AccessOptions, ctx: {
930
+ /** The full chain. */chain: ReadonlyArray<PyDsl>; /** Position in the chain (0 = root). */
931
+ index: number; /** Is this the leaf node? */
932
+ isLeaf: boolean; /** Is this the root node? */
933
+ isRoot: boolean; /** Total length of the chain. */
934
+ length: number;
935
+ }): PyDsl | undefined;
936
+ protected $maybeId<T extends string | py.Expression>(expr: T): T extends string ? py.Identifier : T;
937
+ protected $name(name: Ref<NodeName$1>): string;
938
+ protected $node<I>(value: I): NodeOfMaybe<I>;
939
+ private _name?;
940
+ /** Unwraps nested nodes into raw Python AST. */
941
+ private unwrap;
942
+ }
943
+ type NodeOfMaybe<I> = undefined extends I ? NodeOf<NonNullable<FromRef<I>>> | undefined : NodeOf<FromRef<I>>;
944
+ type NodeOf<I> = I extends ReadonlyArray<infer U> ? ReadonlyArray<U extends PyDsl<infer N> ? N : U> : I extends string ? py.Expression : I extends PyDsl<infer N> ? N : I extends py.Node ? I : never;
945
+ type MaybePyDsl<T> = [T] extends [PyDsl<infer U>] ? U | PyDsl<U> : [T] extends [py.Node] ? T | PyDsl<T> : never;
946
+ //#endregion
947
+ //#region src/py-dsl/layout/doc.d.ts
948
+ type DocMaybeLazy<T> = ((ctx: PyDslContext) => T) | T;
949
+ type DocFn = (d: DocPyDsl) => void;
950
+ type DocLines = DocMaybeLazy<MaybeArray<string>>;
951
+ declare class DocPyDsl extends PyDsl<py.Comment> {
952
+ readonly '~dsl' = "DocPyDsl";
953
+ protected _lines: Array<DocLines>;
954
+ constructor(lines?: DocLines, fn?: DocFn);
955
+ analyze(ctx: AnalysisContext): void;
956
+ add(lines: DocLines): this;
957
+ resolve(): string | undefined;
958
+ toAst(): PyComment;
959
+ }
960
+ //#endregion
961
+ //#region src/py-dsl/layout/hint.d.ts
962
+ type HintMaybeLazy<T> = ((ctx: PyDslContext) => T) | T;
963
+ type HintFn = (d: HintPyDsl) => void;
964
+ type HintLines = HintMaybeLazy<MaybeArray<string>>;
965
+ declare class HintPyDsl extends PyDsl<py.Comment> {
966
+ readonly '~dsl' = "HintPyDsl";
967
+ protected _lines: Array<HintLines>;
968
+ constructor(lines?: HintLines, fn?: HintFn);
969
+ analyze(ctx: AnalysisContext): void;
970
+ add(lines: HintLines): this;
971
+ apply<T extends py.Node>(node: T): T;
972
+ toAst(): PyComment;
973
+ private _resolveLines;
974
+ }
975
+ //#endregion
976
+ //#region src/py-dsl/mixins/do.d.ts
977
+ type DoExpr = MaybePyDsl<py.Expression | py.Statement>;
978
+ interface DoMethods extends Node$1 {
979
+ /** Renders the collected `.do()` calls into an array of `py.Statement` nodes. */
980
+ $do(): ReadonlyArray<py.Statement>;
981
+ _do: Array<DoExpr>;
982
+ /** Adds one or more expressions/statements to the body. */
983
+ do(...items: ReadonlyArray<DoExpr>): this;
984
+ }
985
+ //#endregion
986
+ //#region src/py-dsl/stmt/if.d.ts
987
+ type IfCondition = string | MaybePyDsl<py.Expression>;
988
+ declare const Mixed$29: MixinCtor<abstract new () => PyDsl<PyIfStatement, "python">, DoMethods>;
989
+ declare class IfPyDsl extends Mixed$29 {
990
+ readonly '~dsl' = "IfPyDsl";
991
+ protected _condition?: IfCondition;
992
+ protected _else?: Array<DoExpr>;
993
+ constructor(condition?: IfCondition);
994
+ analyze(ctx: AnalysisContext): void;
995
+ /** Returns true when all required builder calls are present. */
996
+ get isValid(): boolean;
997
+ condition(condition: IfCondition): this;
998
+ otherwise(...items: Array<DoExpr>): this;
999
+ toAst(): PyIfStatement;
1000
+ $validate(): asserts this is this & {
1001
+ _condition: IfCondition;
1002
+ };
1003
+ private missingRequiredCalls;
1004
+ }
1005
+ //#endregion
1006
+ //#region src/py-dsl/utils/r-string.d.ts
1007
+ declare class RString {
1008
+ readonly value: string;
1009
+ readonly '~brand': "RString";
1010
+ constructor(value: string);
1011
+ }
1012
+ //#endregion
1013
+ //#region src/py-dsl/expr/kwarg.d.ts
1014
+ type KwargValue = string | number | boolean | null | RString | MaybePyDsl<py.Expression>;
1015
+ declare const Mixed$28: abstract new () => PyDsl<PyKeywordArgument, "python">;
1016
+ declare class KwargPyDsl extends Mixed$28 {
1017
+ readonly '~dsl' = "KwargPyDsl";
1018
+ protected _value: KwargValue;
1019
+ constructor(name: NodeName$1, value: KwargValue);
1020
+ get key(): string;
1021
+ toAst(): PyKeywordArgument;
1022
+ private $valueToNode;
1023
+ }
1024
+ //#endregion
1025
+ //#region src/py-dsl/utils/lazy.d.ts
1026
+ type LazyThunk<T extends py.Node> = (ctx: PyDslContext) => PyDsl<T>;
1027
+ declare class LazyPyDsl<T extends py.Node = py.Node> extends PyDsl<T> {
1028
+ readonly '~dsl' = "LazyPyDsl";
1029
+ private _thunk;
1030
+ private _result?;
1031
+ constructor(thunk: LazyThunk<T>);
1032
+ analyze(ctx: AnalysisContext): void;
1033
+ toResult(): PyDsl<T>;
1034
+ toAst(): T;
1035
+ }
1036
+ //#endregion
1037
+ //#region src/py-dsl/decl/param.d.ts
1038
+ type ParamDefaultValue = NodeName$1 | py.Expression | undefined;
1039
+ type ParamFn = (p: ParamPyDsl) => void;
1040
+ type ParamName = NodeName$1 | ParamFn;
1041
+ type ParamType = NodeName$1 | PyDsl<py.Expression> | undefined;
1042
+ type ParamCtor = (name: ParamName, fn?: ParamFn) => ParamPyDsl;
1043
+ declare class ParamPyDsl extends PyDsl<py.FunctionParameter> {
1044
+ readonly '~dsl' = "ParamPyDsl";
1045
+ protected _defaultValue?: Ref<ParamDefaultValue>;
1046
+ protected _type?: Ref<ParamType>;
1047
+ constructor(name: ParamName, fn?: ParamFn);
1048
+ analyze(ctx: AnalysisContext): void;
1049
+ /** Sets the parameter default value. */
1050
+ default(value: ParamDefaultValue): this;
1051
+ get isValid(): boolean;
1052
+ /** Sets the parameter type. */
1053
+ type(type: ParamType): this;
1054
+ toAst(): PyFunctionParameter;
1055
+ $validate(): asserts this;
1056
+ private missingRequiredCalls;
1057
+ }
1058
+ //#endregion
1059
+ //#region src/py-dsl/mixins/modifiers.d.ts
1060
+ type Modifiers = {
1061
+ /**
1062
+ * Checks if specified modifier is present.
1063
+ *
1064
+ * @param modifier - The modifier to check.
1065
+ * @returns True if modifier is present, false otherwise.
1066
+ */
1067
+ hasModifier(modifier: Modifier): boolean;
1068
+ modifiers: Array<py.Expression>;
1069
+ };
1070
+ type Modifier = 'async';
1071
+ interface AsyncMethods extends Modifiers {
1072
+ /**
1073
+ * Adds an `async` keyword modifier if condition is true.
1074
+ *
1075
+ * @param condition - Whether to add modifier (default: true).
1076
+ * @returns The target object for chaining.
1077
+ */
1078
+ async(condition?: boolean): this;
1079
+ }
1080
+ interface ExportMethods extends Modifiers {
1081
+ /**
1082
+ * Adds the `export` keyword modifier if the condition is true.
1083
+ *
1084
+ * @param condition - Whether to add the modifier (default: true).
1085
+ * @returns The target object for chaining.
1086
+ */
1087
+ export(condition?: boolean): this;
1088
+ }
1089
+ //#endregion
1090
+ //#region src/py-dsl/mixins/doc.d.ts
1091
+ interface DocMethods extends Node$1 {
1092
+ $docs(): string | undefined;
1093
+ doc(lines?: DocLines, fn?: DocFn): this;
1094
+ }
1095
+ //#endregion
1096
+ //#region src/py-dsl/mixins/decorator.d.ts
1097
+ type DecoratorArg = MaybePyDsl<py.Expression>;
1098
+ type DecoratorName = NodeName$1 | MaybePyDsl<py.Expression>;
1099
+ interface DecoratorMethods extends Node {
1100
+ $decorators(): ReadonlyArray<py.Expression>;
1101
+ decorator(name: DecoratorName, ...args: ReadonlyArray<DecoratorArg>): this;
1102
+ }
1103
+ //#endregion
1104
+ //#region src/py-dsl/utils/name.d.ts
1105
+ declare function safeRuntimeName(name: string): string;
1106
+ declare function safeKeywordName(name: string): string;
1107
+ //#endregion
1108
+ //#region src/py-dsl/decl/class.d.ts
1109
+ type ClassBody = Array<PyDsl<py.Statement>>;
1110
+ declare const Mixed$27: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => PyDsl<PyClassDeclaration, "python">, LayoutMethods>, ExportMethods>, DocMethods>, DecoratorMethods>;
1111
+ declare class ClassPyDsl extends Mixed$27 {
1112
+ readonly '~dsl' = "ClassPyDsl";
1113
+ readonly nameSanitizer: typeof safeRuntimeName;
1114
+ protected baseClasses: Array<Ref<NodeName$1 | SubscriptExpr>>;
1115
+ protected body: ClassBody;
1116
+ constructor(name: NodeName$1);
1117
+ analyze(ctx: AnalysisContext): void;
1118
+ /** Returns true when all required builder calls are present. */
1119
+ get isValid(): boolean;
1120
+ /** Returns true if the class has any members. */
1121
+ get hasBody(): boolean;
1122
+ /** Adds one or more class members (fields, methods, etc.). */
1123
+ do(...items: ClassBody): this;
1124
+ /** Records base classes to extend from. */
1125
+ extends(...baseClass: ReadonlyArray<NodeName$1 | SubscriptExpr>): this;
1126
+ /** Inserts an empty line between members for formatting. */
1127
+ newline(): this;
1128
+ toAst(): PyClassDeclaration;
1129
+ $validate(): asserts this;
1130
+ private missingRequiredCalls;
1131
+ }
1132
+ //#endregion
1133
+ //#region src/py-dsl/decl/enum.d.ts
1134
+ type EnumMember = {
1135
+ name: NodeName$1;
1136
+ value: number | string | boolean;
1137
+ };
1138
+ declare const Mixed$26: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => PyDsl<PyClassDeclaration, "python">, LayoutMethods>, ExportMethods>, DocMethods>, DecoratorMethods>;
1139
+ declare class EnumPyDsl extends Mixed$26 {
1140
+ readonly '~dsl' = "EnumPyDsl";
1141
+ readonly nameSanitizer: typeof safeRuntimeName;
1142
+ private _decision?;
1143
+ private _members;
1144
+ constructor(name: NodeName$1);
1145
+ members(...members: ReadonlyArray<EnumMember>): this;
1146
+ analyze(ctx: AnalysisContext): void;
1147
+ /** Returns true when all required builder calls are present. */
1148
+ get isValid(): boolean;
1149
+ toAst(): PyClassDeclaration;
1150
+ $validate(): asserts this;
1151
+ private missingRequiredCalls;
1152
+ }
1153
+ //#endregion
1154
+ //#region src/py-dsl/mixins/value.d.ts
1155
+ type ValueExpr = NodeName$1 | MaybePyDsl<py.Expression>;
1156
+ interface ValueMethods extends Node$1 {
1157
+ $value(): py.Expression | undefined;
1158
+ /** Sets the initializer expression (e.g., `= expr`). */
1159
+ assign(expr: ValueExpr): this;
1160
+ }
1161
+ //#endregion
1162
+ //#region src/py-dsl/decl/field.d.ts
1163
+ declare const Mixed$25: MixinCtor<abstract new () => PyDsl<PyAssignment, "python">, ValueMethods>;
1164
+ type FieldType = NodeName$1 | MaybePyDsl<py.Expression>;
1165
+ declare class FieldPyDsl extends Mixed$25 {
1166
+ readonly '~dsl' = "FieldPyDsl";
1167
+ readonly nameSanitizer: typeof safeKeywordName;
1168
+ protected _type?: Ref<FieldType>;
1169
+ constructor(name?: NodeName$1);
1170
+ analyze(ctx: AnalysisContext): void;
1171
+ /** Returns true when all required builder calls are present. */
1172
+ get isValid(): boolean;
1173
+ /** Sets the type annotation for the field. */
1174
+ type(type: FieldType): this;
1175
+ toAst(): PyAssignment;
1176
+ $validate(): asserts this;
1177
+ protected $_type(): py.Expression | undefined;
1178
+ private missingRequiredCalls;
1179
+ }
1180
+ //#endregion
1181
+ //#region src/py-dsl/mixins/returns.d.ts
1182
+ interface ReturnsMethods extends Node$1 {
1183
+ $returns(): py.Expression | undefined;
1184
+ returns(type: NodeName$1 | py.Expression): this;
1185
+ }
1186
+ //#endregion
1187
+ //#region src/py-dsl/mixins/param.d.ts
1188
+ interface ParamMethods extends Node$1 {
1189
+ /** Renders the parameters into an array of `FunctionParameter`s. */
1190
+ $params(): ReadonlyArray<py.FunctionParameter>;
1191
+ /** Adds a parameter. */
1192
+ param(...args: Parameters<ParamCtor>): this;
1193
+ /** Adds multiple parameters. */
1194
+ params(...params: ReadonlyArray<MaybePyDsl<py.FunctionParameter>>): this;
1195
+ }
1196
+ //#endregion
1197
+ //#region src/py-dsl/decl/func.d.ts
1198
+ declare const Mixed$24: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => PyDsl<PyFunctionDeclaration, "python">, ReturnsMethods>, ParamMethods>, LayoutMethods>, ExportMethods>, DoMethods>, DocMethods>, DecoratorMethods>, AsyncMethods>;
1199
+ declare class FuncPyDsl extends Mixed$24 {
1200
+ readonly '~dsl' = "FuncPyDsl";
1201
+ readonly nameSanitizer: typeof safeRuntimeName;
1202
+ constructor(name: NodeName$1, fn?: (f: FuncPyDsl) => void);
1203
+ analyze(ctx: AnalysisContext): void;
1204
+ /** Returns true when all required builder calls are present. */
1205
+ get isValid(): boolean;
1206
+ toAst(): PyFunctionDeclaration;
1207
+ $validate(): asserts this;
1208
+ private missingRequiredCalls;
1209
+ }
1210
+ //#endregion
1211
+ //#region src/py-dsl/decl/method.d.ts
1212
+ declare const Mixed$23: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => PyDsl<PyFunctionDeclaration, "python">, ReturnsMethods>, ParamMethods>, LayoutMethods>, DoMethods>, DocMethods>, DecoratorMethods>, AsyncMethods>;
1213
+ declare class MethodPyDsl extends Mixed$23 {
1214
+ readonly '~dsl' = "MethodPyDsl";
1215
+ readonly nameSanitizer: typeof safeKeywordName;
1216
+ constructor(name: NodeName$1, fn?: (f: MethodPyDsl) => void);
1217
+ analyze(ctx: AnalysisContext): void;
1218
+ /** Returns true when all required builder calls are present. */
1219
+ get isValid(): boolean;
1220
+ toAst(): PyFunctionDeclaration;
1221
+ $validate(): asserts this;
1222
+ private missingRequiredCalls;
1223
+ }
1224
+ //#endregion
1225
+ //#region src/py-dsl/expr/dict.d.ts
1226
+ declare const Mixed$22: MixinCtor<abstract new () => PyDsl<PyDictExpression, "python">, LayoutMethods>;
1227
+ declare class DictPyDsl extends Mixed$22 {
1228
+ readonly '~dsl' = "DictPyDsl";
1229
+ protected _entries: Array<{
1230
+ key: MaybePyDsl<py.Expression>;
1231
+ value: MaybePyDsl<py.Expression>;
1232
+ }>;
1233
+ constructor(...entries: Array<{
1234
+ key: MaybePyDsl<py.Expression>;
1235
+ value: MaybePyDsl<py.Expression>;
1236
+ }>);
1237
+ analyze(ctx: AnalysisContext): void;
1238
+ entry(key: MaybePyDsl<py.Expression>, value: MaybePyDsl<py.Expression>): this;
1239
+ entries(...entries: ReadonlyArray<{
1240
+ key: MaybePyDsl<py.Expression>;
1241
+ value: MaybePyDsl<py.Expression>;
1242
+ }>): this;
1243
+ toAst(): PyDictExpression;
1244
+ }
1245
+ //#endregion
1246
+ //#region src/py-dsl/expr/identifier.d.ts
1247
+ declare const Mixed$21: abstract new () => PyDsl<PyIdentifier, "python">;
1248
+ declare class IdPyDsl extends Mixed$21 {
1249
+ readonly '~dsl' = "IdPyDsl";
1250
+ constructor(name: NodeName$1);
1251
+ analyze(ctx: AnalysisContext): void;
1252
+ toAst(): PyIdentifier;
1253
+ }
1254
+ //#endregion
1255
+ //#region src/py-dsl/expr/list.d.ts
1256
+ declare const Mixed$20: MixinCtor<abstract new () => PyDsl<PyListExpression, "python">, LayoutMethods>;
1257
+ declare class ListPyDsl extends Mixed$20 {
1258
+ readonly '~dsl' = "ListPyDsl";
1259
+ protected _elements: Array<MaybePyDsl<py.Expression>>;
1260
+ constructor(...elements: Array<MaybePyDsl<py.Expression>>);
1261
+ analyze(ctx: AnalysisContext): void;
1262
+ element(expr: MaybePyDsl<py.Expression>): this;
1263
+ elements(...exprs: ReadonlyArray<MaybePyDsl<py.Expression>>): this;
1264
+ toAst(): PyListExpression;
1265
+ }
1266
+ //#endregion
1267
+ //#region src/py-dsl/expr/literal.d.ts
1268
+ declare const Mixed$19: abstract new () => PyDsl<PyLiteral, "python">;
1269
+ declare class LiteralPyDsl extends Mixed$19 {
1270
+ readonly '~dsl' = "LiteralPyDsl";
1271
+ protected value: py.LiteralValue;
1272
+ constructor(value: py.LiteralValue);
1273
+ analyze(_ctx: AnalysisContext): void;
1274
+ toAst(): PyLiteral;
1275
+ }
1276
+ //#endregion
1277
+ //#region src/py-dsl/expr/set.d.ts
1278
+ declare const Mixed$18: MixinCtor<abstract new () => PyDsl<PySetExpression, "python">, LayoutMethods>;
1279
+ declare class SetPyDsl extends Mixed$18 {
1280
+ readonly '~dsl' = "SetPyDsl";
1281
+ protected _elements: Array<MaybePyDsl<py.Expression>>;
1282
+ constructor(...elements: Array<MaybePyDsl<py.Expression>>);
1283
+ analyze(ctx: AnalysisContext): void;
1284
+ element(expr: MaybePyDsl<py.Expression>): this;
1285
+ elements(...exprs: ReadonlyArray<MaybePyDsl<py.Expression>>): this;
1286
+ toAst(): PySetExpression;
1287
+ }
1288
+ //#endregion
1289
+ //#region src/py-dsl/layout/newline.d.ts
1290
+ declare class NewlinePyDsl extends PyDsl<py.EmptyStatement> {
1291
+ readonly '~dsl' = "NewlinePyDsl";
1292
+ analyze(ctx: AnalysisContext): void;
1293
+ toAst(): PyEmptyStatement;
1294
+ }
1295
+ //#endregion
1296
+ //#region src/py-dsl/stmt/block.d.ts
1297
+ declare const Mixed$17: MixinCtor<MixinCtor<abstract new () => PyDsl<PyBlock, "python">, LayoutMethods>, DoMethods>;
1298
+ declare class BlockPyDsl extends Mixed$17 {
1299
+ readonly '~dsl' = "BlockPyDsl";
1300
+ constructor(...items: Array<DoExpr>);
1301
+ analyze(ctx: AnalysisContext): void;
1302
+ toAst(): PyBlock;
1303
+ }
1304
+ //#endregion
1305
+ //#region src/py-dsl/stmt/break.d.ts
1306
+ declare const Mixed$16: abstract new () => PyDsl<PyBreakStatement, "python">;
1307
+ declare class BreakPyDsl extends Mixed$16 {
1308
+ readonly '~dsl' = "BreakPyDsl";
1309
+ analyze(_ctx: AnalysisContext): void;
1310
+ toAst(): PyBreakStatement;
1311
+ }
1312
+ //#endregion
1313
+ //#region src/py-dsl/stmt/continue.d.ts
1314
+ declare const Mixed$15: abstract new () => PyDsl<PyContinueStatement, "python">;
1315
+ declare class ContinuePyDsl extends Mixed$15 {
1316
+ readonly '~dsl' = "ContinuePyDsl";
1317
+ analyze(_ctx: AnalysisContext): void;
1318
+ toAst(): PyContinueStatement;
1319
+ }
1320
+ //#endregion
1321
+ //#region src/py-dsl/stmt/for.d.ts
1322
+ declare const Mixed$14: abstract new () => PyDsl<PyForStatement, "python">;
1323
+ declare class ForPyDsl extends Mixed$14 {
1324
+ readonly '~dsl' = "ForPyDsl";
1325
+ protected _body?: Array<DoExpr>;
1326
+ protected _else?: Array<DoExpr>;
1327
+ protected _iterable?: MaybePyDsl<py.Expression>;
1328
+ protected _target?: MaybePyDsl<py.Expression>;
1329
+ constructor(target: MaybePyDsl<py.Expression>, iterable: MaybePyDsl<py.Expression>, ...body: Array<DoExpr>);
1330
+ analyze(ctx: AnalysisContext): void;
1331
+ /** Returns true when all required builder calls are present. */
1332
+ get isValid(): boolean;
1333
+ body(...items: Array<DoExpr>): this;
1334
+ else(...items: Array<DoExpr>): this;
1335
+ toAst(): PyForStatement;
1336
+ $validate(): asserts this is this & {
1337
+ _body: Array<DoExpr>;
1338
+ _iterable: MaybePyDsl<py.Expression>;
1339
+ _target: MaybePyDsl<py.Expression>;
1340
+ };
1341
+ private missingRequiredCalls;
1342
+ }
1343
+ //#endregion
1344
+ //#region src/py-dsl/stmt/import.d.ts
1345
+ type ImportName = {
1346
+ alias?: string;
1347
+ name: string;
1348
+ };
1349
+ declare const Mixed$13: abstract new () => PyDsl<PyImportStatement, "python">;
1350
+ declare class ImportPyDsl extends Mixed$13 {
1351
+ readonly '~dsl' = "ImportPyDsl";
1352
+ protected isFrom: boolean;
1353
+ protected module: string;
1354
+ protected names?: ReadonlyArray<ImportName>;
1355
+ constructor(module: string);
1356
+ constructor(module: string, isFrom: boolean);
1357
+ constructor(module: string, names: ReadonlyArray<ImportName>, isFrom: boolean);
1358
+ static from(module: string, names?: ReadonlyArray<ImportName>): ImportPyDsl;
1359
+ static direct(module: string): ImportPyDsl;
1360
+ analyze(_ctx: AnalysisContext): void;
1361
+ toAst(): PyImportStatement;
1362
+ }
1363
+ //#endregion
1364
+ //#region src/py-dsl/stmt/raise.d.ts
1365
+ declare const Mixed$12: abstract new () => PyDsl<PyRaiseStatement, "python">;
1366
+ declare class RaisePyDsl extends Mixed$12 {
1367
+ readonly '~dsl' = "RaisePyDsl";
1368
+ protected _error?: string | MaybePyDsl<py.Expression>;
1369
+ constructor(error?: string | MaybePyDsl<py.Expression>);
1370
+ analyze(ctx: AnalysisContext): void;
1371
+ toAst(): PyRaiseStatement;
1372
+ }
1373
+ //#endregion
1374
+ //#region src/py-dsl/stmt/stmt.d.ts
1375
+ declare const Mixed$11: abstract new () => PyDsl<PyStatement, "python">;
1376
+ declare class StmtPyDsl extends Mixed$11 {
1377
+ readonly '~dsl' = "StmtPyDsl";
1378
+ protected _inner: py.Expression | py.Statement | PyDsl<any>;
1379
+ constructor(inner: py.Expression | py.Statement | PyDsl<any>);
1380
+ analyze(ctx: AnalysisContext): void;
1381
+ toAst(): PyStatement;
1382
+ }
1383
+ //#endregion
1384
+ //#region src/py-dsl/stmt/try.d.ts
1385
+ declare const Mixed$10: abstract new () => PyDsl<PyTryStatement, "python">;
1386
+ type ExceptType = string | MaybePyDsl<py.Expression>;
1387
+ interface ExceptEntry {
1388
+ body: Array<DoExpr>;
1389
+ name?: Ref<NodeName$1>;
1390
+ types: Array<ExceptType>;
1391
+ }
1392
+ declare class TryPyDsl extends Mixed$10 {
1393
+ readonly '~dsl' = "TryPyDsl";
1394
+ /**
1395
+ * Ordered list of except clauses. We also keep a lookup map
1396
+ * (`_exceptIndex`) keyed by the normalised type key so that
1397
+ * repeated `.except()` calls with the same type set merge their
1398
+ * body statements instead of creating duplicate clauses.
1399
+ */
1400
+ protected _excepts: Array<ExceptEntry>;
1401
+ protected _exceptIndex: Map<string, number>;
1402
+ protected _finally?: Array<DoExpr>;
1403
+ protected _try?: Array<DoExpr>;
1404
+ constructor(...tryBlock: Array<DoExpr>);
1405
+ analyze(ctx: AnalysisContext): void;
1406
+ /** Returns true when all required builder calls are present. */
1407
+ get isValid(): boolean;
1408
+ /**
1409
+ * Add (or merge into) an except clause.
1410
+ *
1411
+ * ```ts
1412
+ * $.try(...)
1413
+ * .except('ValueError', 'e', body1, body2) // except ValueError as e:
1414
+ * .except(['TypeError', 'KeyError'], 'e', ...) // except (TypeError, KeyError) as e:
1415
+ * .except('ValueError', moreBody) // merges into first clause
1416
+ * ```
1417
+ *
1418
+ * @param types Single exception type or array of types.
1419
+ * @param nameOrBody Either the `as` variable name (`NodeName`) or the
1420
+ * first body expression. If it looks like a `NodeName` (string that
1421
+ * is a valid Python identifier and is *not* a DSL node), it is treated
1422
+ * as the name; pass body items after it.
1423
+ * @param body Remaining body statements.
1424
+ */
1425
+ except(types: MaybeArray<ExceptType>, nameOrBody?: NodeName$1 | DoExpr, ...body: Array<DoExpr>): this;
1426
+ /** Add a bare `except:` clause (catches everything). */
1427
+ exceptAll(...body: Array<DoExpr>): this;
1428
+ finally(...items: Array<DoExpr>): this;
1429
+ try(...items: Array<DoExpr>): this;
1430
+ toAst(): PyTryStatement;
1431
+ $validate(): asserts this is this & {
1432
+ _try: Array<DoExpr>;
1433
+ };
1434
+ private missingRequiredCalls;
1435
+ /**
1436
+ * Heuristic: a value is a `NodeName` (intended as the `as` variable)
1437
+ * if it is a plain string matching a Python identifier pattern, or a
1438
+ * Symbol.
1439
+ */
1440
+ private _isNodeName;
1441
+ }
1442
+ //#endregion
1443
+ //#region src/py-dsl/stmt/var.d.ts
1444
+ declare const Mixed$9: MixinCtor<abstract new () => PyDsl<PyAssignment, "python">, ValueMethods>;
1445
+ type VarType = NodeName$1 | MaybePyDsl<py.Expression>;
1446
+ declare class VarPyDsl extends Mixed$9 {
1447
+ readonly '~dsl' = "VarPyDsl";
1448
+ readonly nameSanitizer: typeof safeRuntimeName;
1449
+ protected _type?: Ref<VarType>;
1450
+ constructor(name?: NodeName$1);
1451
+ analyze(ctx: AnalysisContext): void;
1452
+ /** Returns true when all required builder calls are present. */
1453
+ get isValid(): boolean;
1454
+ /** Sets the type annotation for the variable. */
1455
+ type(type: VarType): this;
1456
+ toAst(): PyAssignment;
1457
+ $validate(): asserts this;
1458
+ protected $_type(): py.Expression | undefined;
1459
+ private missingRequiredCalls;
1460
+ }
1461
+ //#endregion
1462
+ //#region src/py-dsl/stmt/while.d.ts
1463
+ declare const Mixed$8: abstract new () => PyDsl<PyWhileStatement, "python">;
1464
+ declare class WhilePyDsl extends Mixed$8 {
1465
+ readonly '~dsl' = "WhilePyDsl";
1466
+ protected _body?: Array<DoExpr>;
1467
+ protected _condition?: MaybePyDsl<py.Expression>;
1468
+ protected _else?: Array<DoExpr>;
1469
+ constructor(condition: MaybePyDsl<py.Expression>, ...body: Array<DoExpr>);
1470
+ analyze(ctx: AnalysisContext): void;
1471
+ /** Returns true when all required builder calls are present. */
1472
+ get isValid(): boolean;
1473
+ body(...items: Array<DoExpr>): this;
1474
+ else(...items: Array<DoExpr>): this;
1475
+ toAst(): PyWhileStatement;
1476
+ $validate(): asserts this is this & {
1477
+ _body: Array<DoExpr>;
1478
+ _condition: MaybePyDsl<py.Expression>;
1479
+ };
1480
+ private missingRequiredCalls;
1481
+ }
1482
+ //#endregion
1483
+ //#region src/py-dsl/stmt/with.d.ts
1484
+ declare const Mixed$7: abstract new () => PyDsl<PyWithStatement, "python">;
1485
+ type WithItemInput = MaybePyDsl<py.Expression> | {
1486
+ alias?: MaybePyDsl<py.Expression>;
1487
+ context: MaybePyDsl<py.Expression>;
1488
+ };
1489
+ declare class WithPyDsl extends Mixed$7 {
1490
+ readonly '~dsl' = "WithPyDsl";
1491
+ protected _body?: Array<DoExpr>;
1492
+ protected _items: Array<WithItemInput>;
1493
+ protected _modifier?: MaybePyDsl<py.Expression>;
1494
+ constructor(...items: Array<WithItemInput>);
1495
+ analyze(ctx: AnalysisContext): void;
1496
+ /** Returns true when all required builder calls are present. */
1497
+ get isValid(): boolean;
1498
+ body(...items: Array<DoExpr>): this;
1499
+ item(item: WithItemInput): this;
1500
+ modifier(expr: MaybePyDsl<py.Expression>): this;
1501
+ async(): this;
1502
+ toAst(): PyWithStatement;
1503
+ $validate(): asserts this is this & {
1504
+ _body: Array<DoExpr>;
1505
+ };
1506
+ private missingRequiredCalls;
1507
+ }
1508
+ //#endregion
1509
+ //#region src/py-dsl/type/or.d.ts
1510
+ declare const Mixed$6: abstract new () => PyDsl<PyExpression, "python">;
1511
+ type Type$1 = NodeName$1 | MaybePyDsl<py.Expression>;
1512
+ declare class TypeOrPyDsl extends Mixed$6 {
1513
+ readonly '~dsl' = "TypeOrPyDsl";
1514
+ scope: NodeScope;
1515
+ protected _types: Array<Ref<Type$1>>;
1516
+ private _decision?;
1517
+ constructor(...nodes: Array<Type$1>);
1518
+ analyze(ctx: AnalysisContext): void;
1519
+ types(...nodes: Array<Type$1>): this;
1520
+ toAst(): any;
1521
+ $validate(): asserts this;
1522
+ private $flatten;
1523
+ private $flattenRefs;
1524
+ }
1525
+ //#endregion
1526
+ //#region src/py-dsl/type/tuple.d.ts
1527
+ declare const Mixed$5: abstract new () => PyDsl<PyExpression, "python">;
1528
+ type Type = NodeName$1 | MaybePyDsl<py.Expression>;
1529
+ declare class TypeTuplePyDsl extends Mixed$5 {
1530
+ readonly '~dsl' = "TypeTuplePyDsl";
1531
+ scope: NodeScope;
1532
+ protected _items: Array<Ref<Type>>;
1533
+ private _decision?;
1534
+ constructor(...nodes: Array<Type>);
1535
+ analyze(ctx: AnalysisContext): void;
1536
+ items(...nodes: Array<Type>): this;
1537
+ toAst(): any;
1538
+ $validate(): asserts this;
1539
+ private $flatten;
1540
+ private $flattenRefs;
1541
+ }
1542
+ //#endregion
1543
+ //#region src/py-dsl/utils/keywords.d.ts
1544
+ declare const keywords: {
1545
+ pythonBuiltins: string[];
1546
+ pythonKeywords: string[];
1547
+ };
1548
+ //#endregion
1549
+ //#region src/py-dsl/utils/regexp.d.ts
1550
+ declare const regexp: {
1551
+ /**
1552
+ * Matches characters from the start that are not valid Python identifier starts.
1553
+ */
1554
+ illegalStartCharacters: RegExp;
1555
+ /**
1556
+ * Simpler pattern for quick identifier checks.
1557
+ */
1558
+ looksLikeIdentifier: RegExp;
1559
+ /**
1560
+ * Matches if string contains only digits and optionally decimal point or leading minus.
1561
+ */
1562
+ number: RegExp;
1563
+ /**
1564
+ * Python identifier pattern for validation.
1565
+ */
1566
+ pythonIdentifier: RegExp;
1567
+ };
1568
+ //#endregion
1569
+ //#region src/py-dsl/utils/render-utils.d.ts
1570
+ type ModuleExport = Omit<ExportModule, 'from'> & {
1571
+ /** Module specifier for re-exports, e.g., `./foo`. */modulePath: string;
1572
+ };
1573
+ type ModuleImport = Omit<ImportModule, 'from'> & {
1574
+ /** Module specifier for imports, e.g., `./foo`. */modulePath: string;
1575
+ };
1576
+ //#endregion
1577
+ //#region src/py-dsl/utils/render.d.ts
1578
+ type Exports = ReadonlyArray<ReadonlyArray<ModuleExport>>;
1579
+ type ExportsOptions = {
1580
+ preferExportAll?: boolean;
1581
+ };
1582
+ type Header = MaybeArray<string> | null | undefined;
1583
+ type HeaderArg = MaybeFunc<(ctx: RenderContext<PyDsl>) => Header>;
1584
+ type Imports = Array<ReadonlyArray<ModuleImport>>;
1585
+ declare class PythonRenderer implements Renderer {
1586
+ /**
1587
+ * Function to generate a file header.
1588
+ *
1589
+ * @private
1590
+ */
1591
+ private _header?;
1592
+ /**
1593
+ * Options for module specifier resolution.
1594
+ *
1595
+ * @private
1596
+ */
1597
+ private _module?;
1598
+ /**
1599
+ * Whether `export * from 'module'` should be used when possible instead of named exports.
1600
+ *
1601
+ * @private
1602
+ */
1603
+ private _preferExportAll;
1604
+ constructor(args?: Pick<Partial<BaseOutput>, 'module'> & {
1605
+ header?: HeaderArg;
1606
+ preferExportAll?: boolean;
1607
+ });
1608
+ render(ctx: RenderContext<PyDsl>): string;
1609
+ supports(ctx: RenderContext): boolean;
1610
+ static astToString(args: {
1611
+ exports?: Exports;
1612
+ exportsOptions?: ExportsOptions;
1613
+ header?: Header;
1614
+ imports?: Imports;
1615
+ nodes?: ReadonlyArray<PyDsl>;
1616
+ /**
1617
+ * Whether to include a trailing newline at the end of the file.
1618
+ *
1619
+ * @default true
1620
+ */
1621
+ trailingNewline?: boolean;
1622
+ }): string;
1623
+ static toExportAst(group: ModuleExport, _options?: ExportsOptions): py.Assignment;
1624
+ static toImportAst(group: ModuleImport): py.ImportStatement;
1625
+ private getExports;
1626
+ private getImports;
1627
+ }
1628
+ //#endregion
1629
+ //#region src/py-dsl/utils/reserved.d.ts
1630
+ type List = ReadonlyArray<string>;
1631
+ declare class ReservedList {
1632
+ private _array;
1633
+ private _set;
1634
+ constructor(values: List);
1635
+ get '~values'(): Set<string>;
1636
+ /**
1637
+ * Updates the reserved list with new values.
1638
+ *
1639
+ * @param values New reserved values or a function that receives the previous
1640
+ * reserved values and returns the new ones.
1641
+ */
1642
+ set(values: List | ((prev: List) => List)): void;
1643
+ }
1644
+ /**
1645
+ * Reserved names for identifiers. These names will not be used
1646
+ * for variables, functions, classes, or other identifiers in generated code.
1647
+ */
1648
+ declare const reserved: {
1649
+ /**
1650
+ * Reserved names for Python language keywords. These names are syntactically
1651
+ * invalid as identifiers in any scope.
1652
+ */
1653
+ keywords: ReservedList;
1654
+ /**
1655
+ * Reserved names for runtime identifiers. These names will not be used
1656
+ * for variables, functions, classes, or other runtime identifiers in
1657
+ * generated code.
1658
+ */
1659
+ runtime: ReservedList;
1660
+ };
1661
+ //#endregion
1662
+ //#region src/py-dsl/index.d.ts
1663
+ declare const $$1: ((id: any) => ExprPyDsl) & {
1664
+ /** Creates an array literal expression (e.g., `[1, 2, 3]`). */
1665
+ /** Creates an `as` type assertion expression (e.g., `value as Type`). */
1666
+ /** Creates a property access expression (e.g., `obj.foo`). */
1667
+ attr: (left: any, right: NodeName$1) => AttrPyDsl;
1668
+ /** Creates an await expression (e.g., `await promise`). */
1669
+ /** Creates a binary expression (e.g., `a + b`). */
1670
+ binary: (left: PyExpression | PyDsl<PyExpression, "python">, op: PyBinaryOperator, right: PyExpression | PyDsl<PyExpression, "python">) => BinaryPyDsl; /** Creates a statement block. */
1671
+ block: (...args: ConstructorParameters<typeof BlockPyDsl>) => BlockPyDsl; /** Creates a break statement. */
1672
+ break: () => BreakPyDsl; /** Creates a function or method call expression (e.g., `fn(arg)`). */
1673
+ call: (callee: any, ...args: any[]) => CallPyDsl; /** Creates a class declaration or expression. */
1674
+ class: (name: NodeName$1) => ClassPyDsl; /** Creates a continue statement. */
1675
+ continue: () => ContinuePyDsl;
1676
+ /** Creates a decorator expression (e.g., `@decorator`). */
1677
+ /** Creates a dictionary expression (e.g., `{ 'a': 1 }`). */
1678
+ dict: (...args: ConstructorParameters<typeof DictPyDsl>) => DictPyDsl; /** Creates a Python docstring (`"""..."""`). */
1679
+ doc: (lines?: DocLines | undefined, fn?: DocFn | undefined) => DocPyDsl; /** Creates an enum declaration. */
1680
+ enum: (name: NodeName$1) => EnumPyDsl; /** Creates a general expression node. */
1681
+ expr: (id: any) => ExprPyDsl; /** Creates a field declaration in a class body. */
1682
+ field: (name?: any) => FieldPyDsl; /** Creates a for statement (e.g., `for x in items:`). */
1683
+ for: (target: PyExpression | PyDsl<PyExpression, "python">, iterable: PyExpression | PyDsl<PyExpression, "python">, ...body: (PyExpression | PyStatement | PyDsl<PyExpression | PyStatement, "python">)[]) => ForPyDsl;
1684
+ /** Converts a runtime value into a corresponding expression node. */
1685
+ /** Creates a function declaration. */
1686
+ func: {
1687
+ (name: NodeName$1): FuncPyDsl;
1688
+ (name: NodeName$1, fn: (f: FuncPyDsl) => void): FuncPyDsl;
1689
+ };
1690
+ /** Creates a getter method declaration. */
1691
+ /** Creates a Python comment (`# ...`). */
1692
+ hint: (lines?: HintLines | undefined, fn?: HintFn | undefined) => HintPyDsl; /** Creates an identifier (e.g., `foo`). */
1693
+ id: (name: NodeName$1) => IdPyDsl; /** Creates an if statement. */
1694
+ if: (condition?: IfCondition | undefined) => IfPyDsl; /** Creates an import statement. */
1695
+ import: (module: string, names: readonly {
1696
+ alias?: string;
1697
+ name: string;
1698
+ }[], isFrom: boolean) => ImportPyDsl;
1699
+ /** Creates an initialization block or statement. */
1700
+ /** Creates a keyword argument expression (e.g., `name=value`). */
1701
+ kwarg: (name: NodeName$1, value: KwargValue) => KwargPyDsl; /** Creates a lazy, context-aware node with deferred evaluation. */
1702
+ lazy: <T extends py.Node>(thunk: LazyThunk<T>) => LazyPyDsl<T>; /** Creates a list expression (e.g., `[1, 2, 3]`). */
1703
+ list: (...args: ConstructorParameters<typeof ListPyDsl>) => ListPyDsl; /** Creates a literal value (e.g., string, number, boolean). */
1704
+ literal: (value: PyLiteralValue) => LiteralPyDsl;
1705
+ /** Creates an enum member declaration. */
1706
+ /** Creates a method declaration in a class body. */
1707
+ method: {
1708
+ (name: NodeName$1): MethodPyDsl;
1709
+ (name: NodeName$1, fn: (f: MethodPyDsl) => void): MethodPyDsl;
1710
+ };
1711
+ /** Creates a negation expression (`-x`). */
1712
+ /** Creates a new expression (e.g., `new ClassName()`). */
1713
+ /** Creates a newline (for formatting purposes). */
1714
+ newline: () => NewlinePyDsl;
1715
+ /** Creates a logical NOT expression (`!x`). */
1716
+ /** Creates an object literal expression. */
1717
+ /** Creates a parameter declaration for functions or methods. */
1718
+ param: (name: any, fn?: ParamFn | undefined) => ParamPyDsl;
1719
+ /** Creates a pattern for destructuring or matching. */
1720
+ /** Creates a prefix unary expression (e.g., `-x`, `!x`, `~x`). */
1721
+ /** Creates an object literal property (e.g., `{ foo: bar }`). */
1722
+ /** Creates a raise statement. */
1723
+ raise: (error?: string | PyExpression | PyDsl<PyExpression, "python"> | undefined) => RaisePyDsl;
1724
+ /** Creates a regular expression literal (e.g., `/foo/gi`). */
1725
+ /** Creates a return statement. */
1726
+ return: (expr?: any) => ReturnPyDsl; /** Creates a set expression (e.g., `{1, 2, 3}`). */
1727
+ set: (...args: ConstructorParameters<typeof SetPyDsl>) => SetPyDsl;
1728
+ /** Creates a setter method declaration. */
1729
+ /** Wraps an expression or statement-like value into a `StmtPyDsl`. */
1730
+ stmt: (inner: PyExpression | PyStatement | PyDsl<any, "python">) => StmtPyDsl; /** Creates a subscript expression (e.g., `obj[index]` or `Type[Param]`). */
1731
+ subscript: (value: any, ...slices: any[]) => SubscriptPyDsl;
1732
+ /** Creates a template literal expression. */
1733
+ /** Creates a ternary conditional expression (if ? then : else). */
1734
+ /** Creates a syntax token (e.g., `?`, `readonly`, `+`, `-`). */
1735
+ /** Creates a try/except/finally statement. */
1736
+ try: (...args: ConstructorParameters<typeof TryPyDsl>) => TryPyDsl; /** Creates a tuple expression (e.g., `(1, 2, 3)`). */
1737
+ tuple: (...args: ConstructorParameters<typeof TuplePyDsl>) => TuplePyDsl; /** Creates a basic type reference or type expression (e.g., Foo or Foo<T>). */
1738
+ type: {
1739
+ /** Creates a type alias declaration (e.g., `type Foo = Bar`). */
1740
+ /** Creates an intersection type (e.g., `A & B`). */
1741
+ /** Creates a qualified type reference (e.g., Foo.Bar). */
1742
+ /** Creates a basic type reference or type expression (e.g., Foo or Foo<T>). */
1743
+ /** Converts a runtime value into a corresponding type expression node. */
1744
+ /** Creates a function type node (e.g., `(a: string) => number`). */
1745
+ /** Creates an indexed-access type (e.g., `Foo<T>[K]`). */
1746
+ /** Creates a literal type node (e.g., 'foo', 42, or true). */
1747
+ /** Creates a mapped type (e.g., `{ [K in keyof T]: U }`). */
1748
+ /** Creates a type literal node (e.g., { foo: string }). */
1749
+ /** Creates a type operator node (e.g., `readonly T`, `keyof T`, `unique T`). */
1750
+ /** Creates a union type (e.g., `A | B | C`). */
1751
+ or: (...args: ConstructorParameters<typeof TypeOrPyDsl>) => TypeOrPyDsl;
1752
+ /** Creates a type parameter (e.g., `<T>`). */
1753
+ /** Creates a type query node (e.g., `typeof Foo`). */
1754
+ /** Builds a TypeScript template literal *type* (e.g., `${Foo}-${Bar}` as a type). */
1755
+ /** Creates a tuple type (e.g., [A, B, C]). */
1756
+ tuple: (...args: ConstructorParameters<typeof TypeTuplePyDsl>) => TypeTuplePyDsl;
1757
+ };
1758
+ /** Creates a `typeof` expression (e.g., `typeof value`). */
1759
+ /** Creates a variable assignment. */
1760
+ var: (name?: any) => VarPyDsl; /** Creates a while statement (e.g., `while x:`). */
1761
+ while: (condition: PyExpression | PyDsl<PyExpression, "python">, ...body: (PyExpression | PyStatement | PyDsl<PyExpression | PyStatement, "python">)[]) => WhilePyDsl; /** Creates a with statement (e.g., `with open(f) as file:`). */
1762
+ with: (...args: ConstructorParameters<typeof WithPyDsl>) => WithPyDsl;
1763
+ };
1764
+ type DollarPyDsl = {
1765
+ /**
1766
+ * Entry point to the Python DSL.
1767
+ *
1768
+ * `$` creates a general expression node by default, but also exposes
1769
+ * builders for all other constructs.
1770
+ *
1771
+ * Example:
1772
+ * ```ts
1773
+ * const node = $('console').attr('log').call($.literal('Hello'));
1774
+ * ```
1775
+ *
1776
+ * Returns:
1777
+ * - A new `ExprPyDsl` instance when called directly.
1778
+ * - The `pyDsl` object for constructing more specific nodes.
1779
+ */
1780
+ $: typeof $$1;
1781
+ };
1782
+ //#endregion
1783
+ //#region src/plugins/@hey-api/sdk/examples.d.ts
1784
+ type UserExamplesConfig = Omit<ExampleOptions, 'payload'> & {
1785
+ /**
1786
+ * Whether this feature is enabled.
1787
+ *
1788
+ * @default true
1789
+ */
1790
+ enabled?: boolean;
1791
+ /**
1792
+ * The programming language for the generated examples.
1793
+ *
1794
+ * This is used to display the language label in code blocks in
1795
+ * documentation UIs.
1796
+ *
1797
+ * @default 'Python'
1798
+ */
1799
+ language?: LinguistLanguages;
1800
+ /**
1801
+ * Example request payload.
1802
+ */
1803
+ payload?: MaybeFunc<(operation: IR.OperationObject, ctx: DollarPyDsl) => CallArgs | CallArgs[number]>;
1804
+ /**
1805
+ * Transform the generated example string.
1806
+ *
1807
+ * @param example The generated example string.
1808
+ * @param operation The operation the example was generated for.
1809
+ * @returns The final example string.
1810
+ */
1811
+ transform?: (example: string, operation: IR.OperationObject) => string;
1812
+ };
1813
+ type ExamplesConfig = Omit<ExampleOptions, 'payload'> & FeatureToggle & {
1814
+ /**
1815
+ * The programming language for the generated examples.
1816
+ *
1817
+ * This is used to display the language label in code blocks in
1818
+ * documentation UIs.
1819
+ */
1820
+ language: LinguistLanguages;
1821
+ /**
1822
+ * Example request payload.
1823
+ */
1824
+ payload?: MaybeFunc<(operation: IR.OperationObject, ctx: DollarPyDsl) => CallArgs | CallArgs[number]>;
1825
+ /**
1826
+ * Transform the generated example string.
1827
+ *
1828
+ * @param example The generated example string.
1829
+ * @param operation The operation the example was generated for.
1830
+ * @returns The final example string.
1831
+ */
1832
+ transform?: (example: string, operation: IR.OperationObject) => string;
1833
+ };
1834
+ //#endregion
1835
+ //#region src/plugins/@hey-api/sdk/imports.d.ts
1836
+ declare function sdkImports(plugin: PluginInstance): {
1837
+ Client: Symbol<Node>;
1838
+ buildClientParams: Symbol<Node>;
1839
+ funcTools: {
1840
+ cachedProperty: Symbol<Node>;
1841
+ };
1842
+ typing: {
1843
+ Annotated: Symbol<Node>;
1844
+ Any: Symbol<Node>;
1845
+ Literal: Symbol<Node>;
1846
+ NoReturn: Symbol<Node>;
1847
+ Optional: Symbol<Node>;
1848
+ Tuple: Symbol<Node>;
1849
+ TypeAlias: Symbol<Node>;
1850
+ Union: Symbol<Node>;
1851
+ };
1852
+ };
1853
+ type SdkImports = ReturnType<typeof sdkImports>;
1854
+ //#endregion
1855
+ //#region src/plugins/@hey-api/sdk/operations/types.d.ts
1856
+ interface UserOperationsConfig {
1857
+ /**
1858
+ * Type of container for grouped operations.
1859
+ *
1860
+ * Ignored when `strategy` is `'flat'`.
1861
+ *
1862
+ * - `'class'` - Class with methods
1863
+ *
1864
+ * @default 'class'
1865
+ */
1866
+ container?: 'class';
1867
+ /**
1868
+ * Customize container names.
1869
+ *
1870
+ * For `'single'` strategy, this sets the root container name.
1871
+ * For `'byTags'` strategy, this transforms tag names.
1872
+ *
1873
+ * @default 'Sdk' for `'single'` strategy
1874
+ *
1875
+ * @example
1876
+ * // Set root name for single strategy
1877
+ * containerName: 'MyApi'
1878
+ *
1879
+ * @example
1880
+ * // Transform tag names with suffix
1881
+ * containerName: '{{name}}Service'
1882
+ *
1883
+ * @example
1884
+ * // With casing
1885
+ * containerName: { name: '{{name}}Service', casing: 'PascalCase' }
1886
+ */
1887
+ containerName?: NamingRule;
1888
+ /**
1889
+ * Customize method/function names.
1890
+ *
1891
+ * Applied to the final segment of the path (the method name).
1892
+ */
1893
+ methodName?: NamingRule;
1894
+ /**
1895
+ * How methods are attached to class containers.
1896
+ *
1897
+ * Only applies when `container` is `'class'`.
1898
+ *
1899
+ * - `'instance'` - Instance methods, requires `new ClassName(config)`
1900
+ *
1901
+ * @default 'instance'
1902
+ */
1903
+ methods?: 'instance';
1904
+ /**
1905
+ * How to derive nesting structure from operations.
1906
+ *
1907
+ * - `'operationId'` - Split operationId by delimiters (e.g., `users.list` → `Users.list()`)
1908
+ * - `'id'` - Use operation id as-is, no nesting
1909
+ * - Custom function for full control
1910
+ *
1911
+ * @default 'operationId'
1912
+ */
1913
+ nesting?: 'operationId' | 'id' | OperationPathStrategy;
1914
+ /**
1915
+ * Delimiters for splitting operationId.
1916
+ *
1917
+ * Only applies when `nesting` is `'operationId'`.
1918
+ *
1919
+ * @default /[./]/
1920
+ */
1921
+ nestingDelimiters?: RegExp;
1922
+ /**
1923
+ * Customize nesting segment names.
1924
+ *
1925
+ * Applied to intermediate path segments (not the method name).
1926
+ */
1927
+ segmentName?: NamingRule;
1928
+ /**
1929
+ * Grouping strategy.
1930
+ *
1931
+ * - `'byTags'` - One container per operation tag
1932
+ * - `'single'` - All operations in one container
1933
+ * - Custom function for full control
1934
+ *
1935
+ * @default 'single'
1936
+ */
1937
+ strategy?: Exclude<OperationsStrategy, 'flat'>;
1938
+ /**
1939
+ * Default container name for operations without tags.
1940
+ *
1941
+ * Only applies when `strategy` is `'byTags'`.
1942
+ *
1943
+ * @default 'default'
1944
+ */
1945
+ strategyDefaultTag?: string;
1946
+ }
1947
+ interface OperationsConfig {
1948
+ /**
1949
+ * Type of container for grouped operations.
1950
+ *
1951
+ * Ignored when `strategy` is `'flat'`.
1952
+ *
1953
+ * - `'class'` - Class with methods
1954
+ */
1955
+ container: 'class';
1956
+ /**
1957
+ * Customize container names.
1958
+ *
1959
+ * For `'single'` strategy, this sets the root container name.
1960
+ * For `'byTags'` strategy, this transforms tag names.
1961
+ *
1962
+ * @default 'Sdk' for `'single'` strategy
1963
+ *
1964
+ * @example
1965
+ * // Set root name for single strategy
1966
+ * containerName: 'MyApi'
1967
+ *
1968
+ * @example
1969
+ * // Transform tag names with suffix
1970
+ * containerName: '{{name}}Service'
1971
+ *
1972
+ * @example
1973
+ * // With casing
1974
+ * containerName: { name: '{{name}}Service', case: 'PascalCase' }
1975
+ */
1976
+ containerName: NamingConfig;
1977
+ /**
1978
+ * Customize method/function names.
1979
+ *
1980
+ * Applied to the final segment of the path (the method name).
1981
+ */
1982
+ methodName: NamingConfig;
1983
+ /**
1984
+ * How methods are attached to class containers.
1985
+ *
1986
+ * Only applies when `container` is `'class'`.
1987
+ *
1988
+ * - `'instance'` - Instance methods, requires `new ClassName(config)`
1989
+ */
1990
+ methods: 'instance';
1991
+ /**
1992
+ * How to derive nesting structure from operations.
1993
+ *
1994
+ * - `'operationId'` - Split operationId by delimiters (e.g., `users.list` → `Users.list()`)
1995
+ * - `'id'` - Use operation id as-is, no nesting
1996
+ * - Custom function for full control
1997
+ */
1998
+ nesting: 'operationId' | 'id' | OperationPathStrategy;
1999
+ /**
2000
+ * Delimiters for splitting operationId.
2001
+ *
2002
+ * Only applies when `nesting` is `'operationId'`.
2003
+ */
2004
+ nestingDelimiters: RegExp;
2005
+ /**
2006
+ * Customize nesting segment names.
2007
+ *
2008
+ * Applied to intermediate path segments (not the method name).
2009
+ */
2010
+ segmentName: NamingConfig;
2011
+ /**
2012
+ * Grouping strategy.
2013
+ *
2014
+ * - `'byTags'` - One container per operation tag
2015
+ * - `'single'` - All operations in one container
2016
+ * - Custom function for full control
2017
+ */
2018
+ strategy: Exclude<OperationsStrategy, 'flat'>;
2019
+ /**
2020
+ * Default container name for operations without tags.
2021
+ *
2022
+ * Only applies when `strategy` is `'byTags'`.
2023
+ */
2024
+ strategyDefaultTag: string;
2025
+ }
2026
+ //#endregion
2027
+ //#region src/plugins/@hey-api/sdk/types.d.ts
2028
+ type UserConfig$1 = Plugin.Name<'@hey-api/python-sdk'> & Plugin.Hooks & Plugin.UserComments & Plugin.UserExports & {
2029
+ /**
2030
+ * Use an internal client instance to send HTTP requests? This is useful if
2031
+ * you don't want to manually pass the client to each SDK function.
2032
+ *
2033
+ * You can customize the selected client output through its plugin. You can
2034
+ * also set `client` to `true` to automatically choose the client from your
2035
+ * defined plugins. If we can't detect a client plugin when using `true`, we
2036
+ * will default to `@hey-api/client-httpx`.
2037
+ *
2038
+ * @default true
2039
+ */
2040
+ client?: PluginClientNames | boolean;
2041
+ /**
2042
+ * Generate code examples for SDK operations and attach them to the
2043
+ * input source (e.g., via `x-codeSamples`).
2044
+ *
2045
+ * Set to `false` to disable example generation entirely, or provide an
2046
+ * object for fine-grained control over the output and post-processing.
2047
+ *
2048
+ * @default false
2049
+ */
2050
+ examples?: boolean | UserExamplesConfig;
2051
+ /**
2052
+ * Define the structure of generated SDK operations.
2053
+ *
2054
+ * String shorthand:
2055
+ * - `'byTags'` – one container per operation tag
2056
+ * - `'single'` – all operations in a single container
2057
+ * - custom function for full control
2058
+ *
2059
+ * Use the object form for advanced configuration.
2060
+ *
2061
+ * @default 'single'
2062
+ */
2063
+ operations?: Exclude<OperationsStrategy, 'flat'> | UserOperationsConfig;
2064
+ /**
2065
+ * Define how request parameters are structured in generated SDK methods.
2066
+ *
2067
+ * - `'flat'` merges parameters into a single object.
2068
+ * - `'grouped'` separates parameters by transport layer.
2069
+ *
2070
+ * Use `'flat'` for simpler calls or `'grouped'` for stricter typing and code clarity.
2071
+ *
2072
+ * @default 'grouped'
2073
+ */
2074
+ paramsStructure?: 'flat' | 'grouped';
2075
+ };
2076
+ type Config$1 = Plugin.Name<'@hey-api/python-sdk'> & Plugin.Hooks & Plugin.Comments & Plugin.Exports & {
2077
+ /**
2078
+ * Use an internal client instance to send HTTP requests? This is useful if
2079
+ * you don't want to manually pass the client to each SDK function.
2080
+ *
2081
+ * You can customize the selected client output through its plugin. You can
2082
+ * also set `client` to `true` to automatically choose the client from your
2083
+ * defined plugins. If we can't detect a client plugin when using `true`, we
2084
+ * will default to `@hey-api/client-httpx`.
2085
+ *
2086
+ * @default true
2087
+ */
2088
+ client: PluginClientNames | false;
2089
+ /**
2090
+ * Configuration for generating SDK code examples.
2091
+ */
2092
+ examples: ExamplesConfig;
2093
+ /**
2094
+ * Define the structure of generated SDK operations.
2095
+ */
2096
+ operations: OperationsConfig;
2097
+ /**
2098
+ * Define how request parameters are structured in generated SDK methods.
2099
+ *
2100
+ * - `'flat'` merges parameters into a single object.
2101
+ * - `'grouped'` separates parameters by transport layer.
2102
+ *
2103
+ * Use `'flat'` for simpler calls or `'grouped'` for stricter typing and code clarity.
2104
+ *
2105
+ * @default 'grouped'
2106
+ */
2107
+ paramsStructure: 'flat' | 'grouped';
2108
+ };
2109
+ type HeyApiSdkPlugin = DefinePlugin<UserConfig$1, Config$1, never, SdkImports>;
2110
+ //#endregion
2111
+ //#region src/plugins/pydantic/imports.d.ts
2112
+ declare function pydanticImports(plugin: PluginInstance): {
2113
+ datetime: {
2114
+ date: Symbol<Node>;
2115
+ datetime: Symbol<Node>;
2116
+ time: Symbol<Node>;
2117
+ timedelta: Symbol<Node>;
2118
+ };
2119
+ enum: {
2120
+ Enum: Symbol<Node>;
2121
+ IntEnum: Symbol<Node>;
2122
+ StrEnum: Symbol<Node>;
2123
+ };
2124
+ typing: {
2125
+ Annotated: Symbol<Node>;
2126
+ Any: Symbol<Node>;
2127
+ Literal: Symbol<Node>;
2128
+ NoReturn: Symbol<Node>;
2129
+ Optional: Symbol<Node>;
2130
+ Tuple: Symbol<Node>;
2131
+ TypeAlias: Symbol<Node>;
2132
+ Union: Symbol<Node>;
2133
+ };
2134
+ uuid: {
2135
+ UUID: Symbol<Node>;
2136
+ };
2137
+ AnyUrl: Symbol<Node>;
2138
+ BaseModel: Symbol<Node>;
2139
+ ConfigDict: Symbol<Node>;
2140
+ EmailStr: Symbol<Node>;
2141
+ Field: Symbol<Node>;
2142
+ RootModel: Symbol<Node>;
2143
+ dataclass: Symbol<Node>;
2144
+ };
2145
+ type PydanticImports = ReturnType<typeof pydanticImports>;
2146
+ //#endregion
2147
+ //#region src/plugins/pydantic/dsl/decl/enum.d.ts
2148
+ declare const Mixed$4: MixinCtor<abstract new () => PyDsl<PyClassDeclaration, "python">, DocMethods>;
2149
+ declare class PydanticEnumDsl extends Mixed$4 {
2150
+ readonly '~dsl' = "PydanticEnumDsl";
2151
+ private _dsl?;
2152
+ private _members;
2153
+ constructor(name: NodeName$1);
2154
+ members(...members: ReadonlyArray<EnumMember>): this;
2155
+ _build(): ReturnType<typeof $$1.enum>;
2156
+ analyze(ctx: AnalysisContext): void;
2157
+ toAst(): PyClassDeclaration;
2158
+ }
2159
+ //#endregion
2160
+ //#region src/py-dsl/mixins/optional.d.ts
2161
+ interface OptionalMethods extends Node$1 {
2162
+ _optional?: boolean;
2163
+ /** Marks the node as optional when the condition is true. */
2164
+ optional(condition?: boolean): this;
2165
+ /** Marks the node as required when the condition is true. */
2166
+ required(condition?: boolean): this;
2167
+ }
2168
+ //#endregion
2169
+ //#region src/plugins/pydantic/dsl/expr/constraints.d.ts
2170
+ interface PydanticFieldConstraints {
2171
+ description?: string;
2172
+ /** Greater than or equal constraint for numbers. */
2173
+ ge?: number;
2174
+ /** Greater than constraint for numbers. */
2175
+ gt?: number;
2176
+ /** Less than or equal constraint for numbers. */
2177
+ le?: number;
2178
+ /** Less than constraint for numbers. */
2179
+ lt?: number;
2180
+ /** Maximum length constraint for strings/arrays. */
2181
+ max_length?: number;
2182
+ /** Minimum length constraint for strings/arrays. */
2183
+ min_length?: number;
2184
+ /** Multiple of constraint for numbers. */
2185
+ multiple_of?: number;
2186
+ /** Regex pattern constraint for strings. */
2187
+ pattern?: RString;
2188
+ title?: string;
2189
+ }
2190
+ declare class PydanticConstraintsDsl {
2191
+ readonly '~dsl' = "PydanticConstraintsDsl";
2192
+ private _values;
2193
+ get hasValidationConstraints(): boolean;
2194
+ get isEmpty(): boolean;
2195
+ get values(): Readonly<PydanticFieldConstraints>;
2196
+ description(text: string): this;
2197
+ ge(n: number): this;
2198
+ gt(n: number): this;
2199
+ le(n: number): this;
2200
+ lt(n: number): this;
2201
+ maxLength(n: number): this;
2202
+ merge(other: PydanticConstraintsDsl): PydanticConstraintsDsl;
2203
+ minLength(n: number): this;
2204
+ multipleOf(n: number): this;
2205
+ pattern(p: string): this;
2206
+ title(text: string): this;
2207
+ }
2208
+ //#endregion
2209
+ //#region src/plugins/pydantic/dsl/expr/constrained-type.d.ts
2210
+ declare class PydanticConstrainedTypeDsl {
2211
+ readonly '~dsl' = "PydanticConstrainedTypeDsl";
2212
+ readonly constraints: PydanticConstraintsDsl;
2213
+ readonly type: NodeName$1 | MaybePyDsl<py.Expression>;
2214
+ constructor(type: NodeName$1 | MaybePyDsl<py.Expression>, constraints?: PydanticConstraintsDsl);
2215
+ mergeConstraints(constraints: PydanticConstraintsDsl): this;
2216
+ }
2217
+ //#endregion
2218
+ //#region src/plugins/pydantic/dsl/decl/field.d.ts
2219
+ declare const Mixed$3: MixinCtor<abstract new () => PyDsl<PyStatement, "python">, OptionalMethods>;
2220
+ declare class PydanticFieldDsl extends Mixed$3 {
2221
+ readonly '~dsl' = "PydanticFieldDsl";
2222
+ protected plugin: PydanticPlugin['Instance'];
2223
+ private _decision?;
2224
+ private _fieldArgs?;
2225
+ private _pythonName;
2226
+ private _wireName;
2227
+ private _alias?;
2228
+ private _default;
2229
+ private _defaultFactory?;
2230
+ private _deprecated?;
2231
+ private _discriminator?;
2232
+ private _dsl?;
2233
+ private _constrainedType?;
2234
+ private _nullable?;
2235
+ private _unionMembers?;
2236
+ constructor(plugin: PydanticPlugin['Instance'], name: string);
2237
+ get hasAlias(): boolean;
2238
+ alias(name: string): this;
2239
+ default(value: unknown): this;
2240
+ defaultFactory(factory: string): this;
2241
+ deprecated(value: boolean): this;
2242
+ discriminator(field: string): this;
2243
+ metadata(constrainedType: PydanticConstrainedTypeDsl): this;
2244
+ nullable(value: boolean): this;
2245
+ type(constrainedType: PydanticConstrainedTypeDsl | Array<PydanticConstrainedTypeDsl>): this;
2246
+ private _buildUnionVarType;
2247
+ private _constraintsToKwargs;
2248
+ _build(): ReturnType<typeof $$1.field>;
2249
+ analyze(ctx: AnalysisContext): void;
2250
+ toAst(): PyAssignment;
2251
+ }
2252
+ //#endregion
2253
+ //#region src/plugins/pydantic/shared/types.d.ts
2254
+ /** Return type for toType converters. */
2255
+ interface PydanticType {
2256
+ /** Discriminator property name, present when this type is a discriminated union. */
2257
+ discriminator?: string;
2258
+ /** Pre-resolved node. */
2259
+ node?: PydanticNode;
2260
+ type?: ReturnType<typeof $.constrainedType>;
2261
+ /** Per-member constrained types for union fields. Present only on union results. */
2262
+ unionMembers?: Array<ReturnType<typeof $.constrainedType>>;
2263
+ }
2264
+ /** Metadata that flows through schema walking. */
2265
+ interface PydanticMeta {
2266
+ /** Default value from schema. */
2267
+ default?: unknown;
2268
+ /** Whether this or any child contains a forward reference. */
2269
+ hasForwardReference: boolean;
2270
+ /** Does this schema explicitly allow null? */
2271
+ nullable: boolean;
2272
+ /** Is this schema read-only? */
2273
+ readonly: boolean;
2274
+ }
2275
+ /** Result from walking a schema node. */
2276
+ interface PydanticResult extends PydanticType {
2277
+ meta: PydanticMeta;
2278
+ }
2279
+ interface PydanticModelConfig {
2280
+ extra?: 'allow' | 'forbid' | 'ignore';
2281
+ populate_by_name?: boolean;
2282
+ }
2283
+ /** Discriminated union of all finalized schema outputs. */
2284
+ type PydanticNode = {
2285
+ kind: 'alias';
2286
+ type: ReturnType<typeof $.constrainedType>;
2287
+ } | {
2288
+ kind: 'enum';
2289
+ members: Array<EnumMember>;
2290
+ } | {
2291
+ config?: PydanticModelConfig;
2292
+ fields: Array<ReturnType<typeof $.field>>;
2293
+ kind: 'model';
2294
+ } | {
2295
+ discriminator?: string;
2296
+ kind: 'rootModel';
2297
+ type: ReturnType<typeof $.constrainedType>;
2298
+ };
2299
+ //#endregion
2300
+ //#region src/plugins/pydantic/dsl/decl/model.d.ts
2301
+ declare const Mixed$2: MixinCtor<abstract new () => PyDsl<PyClassDeclaration, "python">, DocMethods>;
2302
+ declare class PydanticModelDsl extends Mixed$2 {
2303
+ readonly '~dsl' = "PydanticModelDsl";
2304
+ protected plugin: PydanticPlugin['Instance'];
2305
+ private _bases;
2306
+ private _configKwargs;
2307
+ private _dsl?;
2308
+ private _fields;
2309
+ constructor(plugin: PydanticPlugin['Instance'], name: NodeName$1);
2310
+ config(options: PydanticModelConfig): this;
2311
+ extends(base: NodeName$1): this;
2312
+ fields(...fields: ReadonlyArray<PydanticFieldDsl>): this;
2313
+ _build(): ReturnType<typeof $$1.class>;
2314
+ analyze(ctx: AnalysisContext): void;
2315
+ toAst(): PyClassDeclaration;
2316
+ }
2317
+ //#endregion
2318
+ //#region src/plugins/pydantic/dsl/decl/root-model.d.ts
2319
+ declare const Mixed$1: MixinCtor<abstract new () => PyDsl<PyClassDeclaration, "python">, DocMethods>;
2320
+ declare class PydanticRootModelDsl extends Mixed$1 {
2321
+ readonly '~dsl' = "PydanticRootModelDsl";
2322
+ protected plugin: PydanticPlugin['Instance'];
2323
+ private _discriminator?;
2324
+ private _dsl?;
2325
+ private _type?;
2326
+ constructor(plugin: PydanticPlugin['Instance'], name: NodeName$1);
2327
+ type(constrainedType: PydanticConstrainedTypeDsl): this;
2328
+ discriminator(field: string): this;
2329
+ _build(): ReturnType<typeof $$1.class>;
2330
+ analyze(ctx: AnalysisContext): void;
2331
+ toAst(): PyClassDeclaration;
2332
+ }
2333
+ //#endregion
2334
+ //#region src/plugins/pydantic/dsl/decl/type-alias.d.ts
2335
+ declare const Mixed: abstract new () => PyDsl<PyStatement, "python">;
2336
+ declare class PydanticTypeAliasDsl extends Mixed {
2337
+ readonly '~dsl' = "PydanticTypeAliasDsl";
2338
+ readonly aliased?: PydanticConstrainedTypeDsl;
2339
+ protected plugin: PydanticPlugin['Instance'];
2340
+ private _dsl?;
2341
+ constructor(plugin: PydanticPlugin['Instance'], name: NodeName$1, aliased?: PydanticConstrainedTypeDsl);
2342
+ _build(): ReturnType<typeof $$1.var>;
2343
+ analyze(ctx: AnalysisContext): void;
2344
+ toAst(): PyAssignment;
2345
+ }
2346
+ //#endregion
2347
+ //#region src/plugins/pydantic/dsl/index.d.ts
2348
+ declare const $: ((plugin: import("@hey-api/shared").PluginInstance<import("@hey-api/shared").Plugin.Types<UserConfig, Config, never, {
2349
+ datetime: {
2350
+ date: Symbol<Node>;
2351
+ datetime: Symbol<Node>;
2352
+ time: Symbol<Node>;
2353
+ timedelta: Symbol<Node>;
2354
+ };
2355
+ enum: {
2356
+ Enum: Symbol<Node>;
2357
+ IntEnum: Symbol<Node>;
2358
+ StrEnum: Symbol<Node>;
2359
+ };
2360
+ typing: {
2361
+ Annotated: Symbol<Node>;
2362
+ Any: Symbol<Node>;
2363
+ Literal: Symbol<Node>;
2364
+ NoReturn: Symbol<Node>;
2365
+ Optional: Symbol<Node>;
2366
+ Tuple: Symbol<Node>;
2367
+ TypeAlias: Symbol<Node>;
2368
+ Union: Symbol<Node>;
2369
+ };
2370
+ uuid: {
2371
+ UUID: Symbol<Node>;
2372
+ };
2373
+ AnyUrl: Symbol<Node>;
2374
+ BaseModel: Symbol<Node>;
2375
+ ConfigDict: Symbol<Node>;
2376
+ EmailStr: Symbol<Node>;
2377
+ Field: Symbol<Node>;
2378
+ RootModel: Symbol<Node>;
2379
+ dataclass: Symbol<Node>;
2380
+ }>>, name: NodeName) => PydanticModelDsl) & {
2381
+ /** Constrained type: a type with attached validation constraints and metadata. */constrainedType: (type: any, constraints?: PydanticConstraintsDsl | undefined) => PydanticConstrainedTypeDsl; /** Constraints bag: validation constraints and field metadata. */
2382
+ constraints: () => PydanticConstraintsDsl; /** Pydantic enum class. */
2383
+ enum: (name: NodeName) => PydanticEnumDsl; /** Pydantic field. */
2384
+ field: (plugin: import("@hey-api/shared").PluginInstance<import("@hey-api/shared").Plugin.Types<UserConfig, Config, never, {
2385
+ datetime: {
2386
+ date: Symbol<Node>;
2387
+ datetime: Symbol<Node>;
2388
+ time: Symbol<Node>;
2389
+ timedelta: Symbol<Node>;
2390
+ };
2391
+ enum: {
2392
+ Enum: Symbol<Node>;
2393
+ IntEnum: Symbol<Node>;
2394
+ StrEnum: Symbol<Node>;
2395
+ };
2396
+ typing: {
2397
+ Annotated: Symbol<Node>;
2398
+ Any: Symbol<Node>;
2399
+ Literal: Symbol<Node>;
2400
+ NoReturn: Symbol<Node>;
2401
+ Optional: Symbol<Node>;
2402
+ Tuple: Symbol<Node>;
2403
+ TypeAlias: Symbol<Node>;
2404
+ Union: Symbol<Node>;
2405
+ };
2406
+ uuid: {
2407
+ UUID: Symbol<Node>;
2408
+ };
2409
+ AnyUrl: Symbol<Node>;
2410
+ BaseModel: Symbol<Node>;
2411
+ ConfigDict: Symbol<Node>;
2412
+ EmailStr: Symbol<Node>;
2413
+ Field: Symbol<Node>;
2414
+ RootModel: Symbol<Node>;
2415
+ dataclass: Symbol<Node>;
2416
+ }>>, name: string) => PydanticFieldDsl; /** Pydantic model class. */
2417
+ model: (plugin: import("@hey-api/shared").PluginInstance<import("@hey-api/shared").Plugin.Types<UserConfig, Config, never, {
2418
+ datetime: {
2419
+ date: Symbol<Node>;
2420
+ datetime: Symbol<Node>;
2421
+ time: Symbol<Node>;
2422
+ timedelta: Symbol<Node>;
2423
+ };
2424
+ enum: {
2425
+ Enum: Symbol<Node>;
2426
+ IntEnum: Symbol<Node>;
2427
+ StrEnum: Symbol<Node>;
2428
+ };
2429
+ typing: {
2430
+ Annotated: Symbol<Node>;
2431
+ Any: Symbol<Node>;
2432
+ Literal: Symbol<Node>;
2433
+ NoReturn: Symbol<Node>;
2434
+ Optional: Symbol<Node>;
2435
+ Tuple: Symbol<Node>;
2436
+ TypeAlias: Symbol<Node>;
2437
+ Union: Symbol<Node>;
2438
+ };
2439
+ uuid: {
2440
+ UUID: Symbol<Node>;
2441
+ };
2442
+ AnyUrl: Symbol<Node>;
2443
+ BaseModel: Symbol<Node>;
2444
+ ConfigDict: Symbol<Node>;
2445
+ EmailStr: Symbol<Node>;
2446
+ Field: Symbol<Node>;
2447
+ RootModel: Symbol<Node>;
2448
+ dataclass: Symbol<Node>;
2449
+ }>>, name: NodeName) => PydanticModelDsl; /** Pydantic RootModel class. */
2450
+ rootModel: (plugin: import("@hey-api/shared").PluginInstance<import("@hey-api/shared").Plugin.Types<UserConfig, Config, never, {
2451
+ datetime: {
2452
+ date: Symbol<Node>;
2453
+ datetime: Symbol<Node>;
2454
+ time: Symbol<Node>;
2455
+ timedelta: Symbol<Node>;
2456
+ };
2457
+ enum: {
2458
+ Enum: Symbol<Node>;
2459
+ IntEnum: Symbol<Node>;
2460
+ StrEnum: Symbol<Node>;
2461
+ };
2462
+ typing: {
2463
+ Annotated: Symbol<Node>;
2464
+ Any: Symbol<Node>;
2465
+ Literal: Symbol<Node>;
2466
+ NoReturn: Symbol<Node>;
2467
+ Optional: Symbol<Node>;
2468
+ Tuple: Symbol<Node>;
2469
+ TypeAlias: Symbol<Node>;
2470
+ Union: Symbol<Node>;
2471
+ };
2472
+ uuid: {
2473
+ UUID: Symbol<Node>;
2474
+ };
2475
+ AnyUrl: Symbol<Node>;
2476
+ BaseModel: Symbol<Node>;
2477
+ ConfigDict: Symbol<Node>;
2478
+ EmailStr: Symbol<Node>;
2479
+ Field: Symbol<Node>;
2480
+ RootModel: Symbol<Node>;
2481
+ dataclass: Symbol<Node>;
2482
+ }>>, name: NodeName) => PydanticRootModelDsl; /** Pydantic type alias. */
2483
+ typeAlias: (plugin: import("@hey-api/shared").PluginInstance<import("@hey-api/shared").Plugin.Types<UserConfig, Config, never, {
2484
+ datetime: {
2485
+ date: Symbol<Node>;
2486
+ datetime: Symbol<Node>;
2487
+ time: Symbol<Node>;
2488
+ timedelta: Symbol<Node>;
2489
+ };
2490
+ enum: {
2491
+ Enum: Symbol<Node>;
2492
+ IntEnum: Symbol<Node>;
2493
+ StrEnum: Symbol<Node>;
2494
+ };
2495
+ typing: {
2496
+ Annotated: Symbol<Node>;
2497
+ Any: Symbol<Node>;
2498
+ Literal: Symbol<Node>;
2499
+ NoReturn: Symbol<Node>;
2500
+ Optional: Symbol<Node>;
2501
+ Tuple: Symbol<Node>;
2502
+ TypeAlias: Symbol<Node>;
2503
+ Union: Symbol<Node>;
2504
+ };
2505
+ uuid: {
2506
+ UUID: Symbol<Node>;
2507
+ };
2508
+ AnyUrl: Symbol<Node>;
2509
+ BaseModel: Symbol<Node>;
2510
+ ConfigDict: Symbol<Node>;
2511
+ EmailStr: Symbol<Node>;
2512
+ Field: Symbol<Node>;
2513
+ RootModel: Symbol<Node>;
2514
+ dataclass: Symbol<Node>;
2515
+ }>>, name: NodeName, aliased?: PydanticConstrainedTypeDsl | undefined) => PydanticTypeAliasDsl;
2516
+ };
2517
+ //#endregion
2518
+ //#region src/plugins/pydantic/resolvers.d.ts
2519
+ type PydanticResolvers = Plugin.Resolvers<{
2520
+ /**
2521
+ * Resolver for array schemas.
2522
+ *
2523
+ * Allows customization of how array types are rendered.
2524
+ *
2525
+ * Returning `undefined` will execute the default resolver logic.
2526
+ */
2527
+ array?: (ctx: ArrayResolverContext) => PydanticType | undefined;
2528
+ /**
2529
+ * Resolver for boolean schemas.
2530
+ *
2531
+ * Allows customization of how boolean types are rendered.
2532
+ *
2533
+ * Returning `undefined` will execute the default resolver logic.
2534
+ */
2535
+ boolean?: (ctx: BooleanResolverContext) => PydanticType | undefined;
2536
+ /**
2537
+ * Resolver for enum schemas.
2538
+ *
2539
+ * Allows customization of how enum types are rendered.
2540
+ *
2541
+ * Returning `undefined` will execute the default resolver logic.
2542
+ */
2543
+ enum?: (ctx: EnumResolverContext) => PydanticType | undefined;
2544
+ /**
2545
+ * Resolver for intersection schemas.
2546
+ *
2547
+ * Allows customization of how intersection types are rendered.
2548
+ *
2549
+ * Returning `undefined` will execute the default resolver logic.
2550
+ */
2551
+ intersection?: (ctx: IntersectionResolverContext) => PydanticType | undefined;
2552
+ /**
2553
+ * Resolver for never schemas.
2554
+ *
2555
+ * Allows customization of how never types are rendered.
2556
+ *
2557
+ * Returning `undefined` will execute the default resolver logic.
2558
+ */
2559
+ never?: (ctx: NeverResolverContext) => PydanticType | undefined;
2560
+ /**
2561
+ * Resolver for null schemas.
2562
+ *
2563
+ * Allows customization of how null types are rendered.
2564
+ *
2565
+ * Returning `undefined` will execute the default resolver logic.
2566
+ */
2567
+ null?: (ctx: NullResolverContext) => PydanticType | undefined;
2568
+ /**
2569
+ * Resolver for number schemas.
2570
+ *
2571
+ * Allows customization of how number types are rendered.
2572
+ *
2573
+ * Returning `undefined` will execute the default resolver logic.
2574
+ */
2575
+ number?: (ctx: NumberResolverContext) => PydanticType | undefined;
2576
+ /**
2577
+ * Resolver for object schemas.
2578
+ *
2579
+ * Allows customization of how object types are rendered.
2580
+ *
2581
+ * Returning `undefined` will execute the default resolver logic.
2582
+ */
2583
+ object?: (ctx: ObjectResolverContext) => PydanticType | undefined;
2584
+ /**
2585
+ * Resolver for string schemas.
2586
+ *
2587
+ * Allows customization of how string types are rendered.
2588
+ *
2589
+ * Returning `undefined` will execute the default resolver logic.
2590
+ */
2591
+ string?: (ctx: StringResolverContext) => PydanticType | undefined;
2592
+ /**
2593
+ * Resolver for tuple schemas.
2594
+ *
2595
+ * Allows customization of how tuple types are rendered.
2596
+ *
2597
+ * Returning `undefined` will execute the default resolver logic.
2598
+ */
2599
+ tuple?: (ctx: TupleResolverContext) => PydanticType | undefined;
2600
+ /**
2601
+ * Resolver for undefined schemas.
2602
+ *
2603
+ * Allows customization of how undefined types are rendered.
2604
+ *
2605
+ * Returning `undefined` will execute the default resolver logic.
2606
+ */
2607
+ undefined?: (ctx: UndefinedResolverContext) => PydanticType | undefined;
2608
+ /**
2609
+ * Resolver for union schemas.
2610
+ *
2611
+ * Allows customization of how union types are rendered.
2612
+ *
2613
+ * Returning `undefined` will execute the default resolver logic.
2614
+ */
2615
+ union?: (ctx: UnionResolverContext) => PydanticType | undefined;
2616
+ /**
2617
+ * Resolver for unknown schemas.
2618
+ *
2619
+ * Allows customization of how unknown types are rendered.
2620
+ *
2621
+ * Returning `undefined` will execute the default resolver logic.
2622
+ */
2623
+ unknown?: (ctx: UnknownResolverContext) => PydanticType | undefined;
2624
+ /**
2625
+ * Resolver for void schemas.
2626
+ *
2627
+ * Allows customization of how void types are rendered.
2628
+ *
2629
+ * Returning `undefined` will execute the default resolver logic.
2630
+ */
2631
+ void?: (ctx: VoidResolverContext) => PydanticType | undefined;
2632
+ }>;
2633
+ interface BaseContext extends DollarPyDsl, SchemaVisitorContext<PydanticPlugin['Instance']> {}
2634
+ interface ArrayResolverContext extends BaseContext, Plugin.ResolverNodes<{
2635
+ base: (ctx: ArrayResolverContext) => PydanticType;
2636
+ }> {
2637
+ applyModifiers: (result: PydanticResult, opts?: {
2638
+ optional?: boolean;
2639
+ }) => PydanticResult;
2640
+ childResults: Array<PydanticResult>;
2641
+ schema: SchemaWithType<'array'>;
2642
+ walk: Walker<PydanticResult, PydanticPlugin['Instance']>;
2643
+ }
2644
+ interface BooleanResolverContext extends BaseContext, Plugin.ResolverNodes<{
2645
+ base: (ctx: BooleanResolverContext) => PydanticType;
2646
+ const: (ctx: BooleanResolverContext) => PydanticType | undefined;
2647
+ }> {
2648
+ schema: SchemaWithType<'boolean'>;
2649
+ }
2650
+ interface EnumResolverContext extends BaseContext, Plugin.ResolverNodes<{
2651
+ base: (ctx: EnumResolverContext) => PydanticType;
2652
+ items: (ctx: EnumResolverContext) => {
2653
+ enumMembers: Array<EnumMember>;
2654
+ isNullable: boolean;
2655
+ };
2656
+ }> {
2657
+ schema: SchemaWithType<'enum'>;
2658
+ }
2659
+ interface IntersectionResolverContext extends BaseContext, Plugin.ResolverNodes<{
2660
+ base: (ctx: IntersectionResolverContext) => PydanticType;
2661
+ }> {
2662
+ applyModifiers: (result: PydanticResult, opts?: {
2663
+ optional?: boolean;
2664
+ }) => PydanticResult;
2665
+ childResults: Array<PydanticResult>;
2666
+ parentSchema: IR.SchemaObject;
2667
+ schema: IR.SchemaObject;
2668
+ }
2669
+ interface NeverResolverContext extends BaseContext, Plugin.ResolverNodes<{
2670
+ base: (ctx: NeverResolverContext) => PydanticType;
2671
+ }> {
2672
+ schema: SchemaWithType<'never'>;
2673
+ }
2674
+ interface NullResolverContext extends BaseContext, Plugin.ResolverNodes<{
2675
+ base: (ctx: NullResolverContext) => PydanticType;
2676
+ }> {
2677
+ schema: SchemaWithType<'null'>;
2678
+ }
2679
+ interface NumberResolverContext extends BaseContext, Plugin.ResolverNodes<{
2680
+ base: (ctx: NumberResolverContext) => PydanticType;
2681
+ const: (ctx: NumberResolverContext) => PydanticType | undefined;
2682
+ }> {
2683
+ schema: SchemaWithType<'integer' | 'number'>;
2684
+ }
2685
+ interface ObjectResolverContext extends BaseContext, Plugin.ResolverNodes<{
2686
+ additionalProperties: (ctx: ObjectResolverContext) => PydanticType | null | undefined;
2687
+ base: (ctx: ObjectResolverContext) => PydanticType;
2688
+ fields: (ctx: ObjectResolverContext) => Array<ReturnType<typeof $.field>>;
2689
+ }> {
2690
+ _childResults: Array<PydanticResult>;
2691
+ applyModifiers: (result: PydanticResult, opts: {
2692
+ optional?: boolean;
2693
+ }) => PydanticResult;
2694
+ schema: SchemaWithType<'object'>;
2695
+ walk: Walker<PydanticResult, PydanticPlugin['Instance']>;
2696
+ }
2697
+ interface StringResolverContext extends BaseContext, Plugin.ResolverNodes<{
2698
+ base: (ctx: StringResolverContext) => PydanticType;
2699
+ const: (ctx: StringResolverContext) => PydanticType | undefined;
2700
+ format: (ctx: StringResolverContext) => PydanticType | undefined;
2701
+ }> {
2702
+ schema: SchemaWithType<'string'>;
2703
+ }
2704
+ interface TupleResolverContext extends BaseContext, Plugin.ResolverNodes<{
2705
+ base: (ctx: TupleResolverContext) => PydanticType;
2706
+ const: (ctx: TupleResolverContext) => PydanticType | undefined;
2707
+ }> {
2708
+ applyModifiers: (result: PydanticResult, opts?: {
2709
+ optional?: boolean;
2710
+ }) => PydanticResult;
2711
+ childResults: Array<PydanticResult>;
2712
+ schema: SchemaWithType<'tuple'>;
2713
+ walk: Walker<PydanticResult, PydanticPlugin['Instance']>;
2714
+ }
2715
+ interface UndefinedResolverContext extends BaseContext, Plugin.ResolverNodes<{
2716
+ base: (ctx: UndefinedResolverContext) => PydanticType;
2717
+ }> {
2718
+ schema: SchemaWithType<'undefined'>;
2719
+ }
2720
+ interface UnionResolverContext extends BaseContext, Plugin.ResolverNodes<{
2721
+ base: (ctx: UnionResolverContext) => PydanticType;
2722
+ }> {
2723
+ applyModifiers: (result: PydanticResult, opts?: {
2724
+ optional?: boolean;
2725
+ }) => PydanticResult;
2726
+ childResults: Array<PydanticResult>;
2727
+ parentSchema: IR.SchemaObject;
2728
+ schema: IR.SchemaObject;
2729
+ schemas: ReadonlyArray<IR.SchemaObject>;
2730
+ }
2731
+ interface UnknownResolverContext extends BaseContext, Plugin.ResolverNodes<{
2732
+ base: (ctx: UnknownResolverContext) => PydanticType;
2733
+ }> {
2734
+ schema: SchemaWithType<'unknown'>;
2735
+ }
2736
+ interface VoidResolverContext extends BaseContext, Plugin.ResolverNodes<{
2737
+ base: (ctx: VoidResolverContext) => PydanticType;
2738
+ }> {
2739
+ schema: SchemaWithType<'void'>;
2740
+ }
2741
+ //#endregion
2742
+ //#region src/plugins/pydantic/types.d.ts
2743
+ type UserConfig = Plugin.Name<'pydantic'> & Plugin.Hooks & Plugin.UserComments & Plugin.UserExports & PydanticResolvers & {
2744
+ /**
2745
+ * Casing convention for generated names.
2746
+ *
2747
+ * @default 'PascalCase'
2748
+ */
2749
+ case?: Casing;
2750
+ /**
2751
+ * Configuration for reusable schema definitions.
2752
+ *
2753
+ * Controls generation of shared Pydantic models that can be referenced
2754
+ * across requests and responses.
2755
+ *
2756
+ * Can be:
2757
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
2758
+ * - `string` or `function`: Shorthand for `{ name: string | function }`
2759
+ * - `object`: Full configuration object
2760
+ *
2761
+ * @default true
2762
+ */
2763
+ definitions?: boolean | NameTransformer | {
2764
+ /**
2765
+ * Casing convention for generated names.
2766
+ *
2767
+ * @default 'PascalCase'
2768
+ */
2769
+ case?: Casing;
2770
+ /**
2771
+ * Whether this feature is enabled.
2772
+ *
2773
+ * @default true
2774
+ */
2775
+ enabled?: boolean;
2776
+ /**
2777
+ * Naming pattern for generated names.
2778
+ *
2779
+ * @default '{{name}}'
2780
+ */
2781
+ name?: NameTransformer;
2782
+ };
2783
+ /**
2784
+ * How to generate enum types.
2785
+ *
2786
+ * - `'enum'`: Generate Python Enum classes (e.g., `class Status(str, Enum): ...`)
2787
+ * - `'literal'`: Generate Literal type hints (e.g., `Literal["pending", "active"]`)
2788
+ *
2789
+ * @default 'enum'
2790
+ */
2791
+ enums?: 'enum' | 'literal';
2792
+ /**
2793
+ * How to render field constraints.
2794
+ *
2795
+ * - `'field'`: `foo: Optional[int] = Field(default=None, ge=0, le=100)`
2796
+ * - `'annotated'`: `foo: Annotated[Optional[int], Field(ge=0, le=100)] = None`
2797
+ *
2798
+ * @default 'field'
2799
+ */
2800
+ fieldStyle?: 'annotated' | 'field';
2801
+ /**
2802
+ * Model type to generate.
2803
+ *
2804
+ * - `'BaseModel'`: Pydantic `BaseModel` subclass.
2805
+ * - `'dataclass'`: Pydantic `@dataclass` decorator.
2806
+ *
2807
+ * @default 'BaseModel'
2808
+ */
2809
+ modelType?: 'BaseModel' | 'dataclass';
2810
+ /**
2811
+ * Configuration for request-specific Pydantic models.
2812
+ *
2813
+ * Controls generation of Pydantic models for request bodies,
2814
+ * query parameters, path parameters, and headers.
2815
+ *
2816
+ * Can be:
2817
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
2818
+ * - `string` or `function`: Shorthand for `{ name: string | function }`
2819
+ * - `object`: Full configuration object
2820
+ *
2821
+ * @default true
2822
+ */
2823
+ requests?: boolean | NameTransformer | {
2824
+ /**
2825
+ * Configuration for request body Pydantic models.
2826
+ *
2827
+ * Can be:
2828
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
2829
+ * - `string` or `function`: Shorthand for `{ name: string | function }`
2830
+ * - `object`: Full configuration object
2831
+ *
2832
+ * @default true
2833
+ */
2834
+ body?: boolean | NameTransformer | {
2835
+ /**
2836
+ * Casing convention for generated names.
2837
+ *
2838
+ * @default 'PascalCase'
2839
+ */
2840
+ case?: Casing;
2841
+ /**
2842
+ * Whether this feature is enabled.
2843
+ *
2844
+ * @default true
2845
+ */
2846
+ enabled?: boolean;
2847
+ /**
2848
+ * Naming pattern for generated names.
2849
+ *
2850
+ * @default '{{name}}Body'
2851
+ */
2852
+ name?: NameTransformer;
2853
+ };
2854
+ /**
2855
+ * Casing convention for generated names.
2856
+ *
2857
+ * @default 'PascalCase'
2858
+ */
2859
+ case?: Casing;
2860
+ /**
2861
+ * Whether this feature is enabled.
2862
+ *
2863
+ * @default true
2864
+ */
2865
+ enabled?: boolean;
2866
+ /**
2867
+ * Configuration for request headers Pydantic models.
2868
+ *
2869
+ * Can be:
2870
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
2871
+ * - `string` or `function`: Shorthand for `{ name: string | function }`
2872
+ * - `object`: Full configuration object
2873
+ *
2874
+ * @default true
2875
+ */
2876
+ headers?: boolean | NameTransformer | {
2877
+ /**
2878
+ * Casing convention for generated names.
2879
+ *
2880
+ * @default 'PascalCase'
2881
+ */
2882
+ case?: Casing;
2883
+ /**
2884
+ * Whether this feature is enabled.
2885
+ *
2886
+ * @default true
2887
+ */
2888
+ enabled?: boolean;
2889
+ /**
2890
+ * Naming pattern for generated names.
2891
+ *
2892
+ * @default '{{name}}Headers'
2893
+ */
2894
+ name?: NameTransformer;
2895
+ };
2896
+ /**
2897
+ * Naming pattern for generated names.
2898
+ *
2899
+ * @default '{{name}}Request'
2900
+ */
2901
+ name?: NameTransformer;
2902
+ /**
2903
+ * Configuration for request path parameters Pydantic models.
2904
+ *
2905
+ * Can be:
2906
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
2907
+ * - `string` or `function`: Shorthand for `{ name: string | function }`
2908
+ * - `object`: Full configuration object
2909
+ *
2910
+ * @default true
2911
+ */
2912
+ path?: boolean | NameTransformer | {
2913
+ /**
2914
+ * Casing convention for generated names.
2915
+ *
2916
+ * @default 'PascalCase'
2917
+ */
2918
+ case?: Casing;
2919
+ /**
2920
+ * Whether this feature is enabled.
2921
+ *
2922
+ * @default true
2923
+ */
2924
+ enabled?: boolean;
2925
+ /**
2926
+ * Naming pattern for generated names.
2927
+ *
2928
+ * @default '{{name}}Path'
2929
+ */
2930
+ name?: NameTransformer;
2931
+ };
2932
+ /**
2933
+ * Configuration for request query parameters Pydantic models.
2934
+ *
2935
+ * Can be:
2936
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
2937
+ * - `string` or `function`: Shorthand for `{ name: string | function }`
2938
+ * - `object`: Full configuration object
2939
+ *
2940
+ * @default true
2941
+ */
2942
+ query?: boolean | NameTransformer | {
2943
+ /**
2944
+ * Casing convention for generated names.
2945
+ *
2946
+ * @default 'PascalCase'
2947
+ */
2948
+ case?: Casing;
2949
+ /**
2950
+ * Whether this feature is enabled.
2951
+ *
2952
+ * @default true
2953
+ */
2954
+ enabled?: boolean;
2955
+ /**
2956
+ * Naming pattern for generated names.
2957
+ *
2958
+ * @default '{{name}}Query'
2959
+ */
2960
+ name?: NameTransformer;
2961
+ };
2962
+ };
2963
+ /**
2964
+ * Configuration for response-specific Pydantic models.
2965
+ *
2966
+ * Controls generation of Pydantic models for response bodies,
2967
+ * error responses, and status codes.
2968
+ *
2969
+ * Can be:
2970
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
2971
+ * - `string` or `function`: Shorthand for `{ name: string | function }`
2972
+ * - `object`: Full configuration object
2973
+ *
2974
+ * @default true
2975
+ */
2976
+ responses?: boolean | NameTransformer | {
2977
+ /**
2978
+ * Casing convention for generated names.
2979
+ *
2980
+ * @default 'PascalCase'
2981
+ */
2982
+ case?: Casing;
2983
+ /**
2984
+ * Whether this feature is enabled.
2985
+ *
2986
+ * @default true
2987
+ */
2988
+ enabled?: boolean;
2989
+ /**
2990
+ * Naming pattern for generated names.
2991
+ *
2992
+ * @default '{{name}}Response'
2993
+ */
2994
+ name?: NameTransformer;
2995
+ };
2996
+ /**
2997
+ * Enable strict mode for Pydantic models?
2998
+ *
2999
+ * When enabled, extra fields not defined in the schema will be rejected.
3000
+ *
3001
+ * This adds `model_config = ConfigDict(extra='forbid')`
3002
+ * to generated models.
3003
+ *
3004
+ * Note: {@link strict} has no effect when `modelType` is `'dataclass'`
3005
+ * as `ConfigDict` is not supported for dataclasses.
3006
+ *
3007
+ * @default false
3008
+ */
3009
+ strict?: boolean;
3010
+ /**
3011
+ * Configuration for webhook-specific Pydantic models.
3012
+ *
3013
+ * Controls generation of Pydantic models for webhook payloads.
3014
+ *
3015
+ * Can be:
3016
+ * - `boolean`: Shorthand for `{ enabled: boolean }`
3017
+ * - `string` or `function`: Shorthand for `{ name: string | function }`
3018
+ * - `object`: Full configuration object
3019
+ *
3020
+ * @default true
3021
+ */
3022
+ webhooks?: boolean | NameTransformer | {
3023
+ /**
3024
+ * Casing convention for generated names.
3025
+ *
3026
+ * @default 'PascalCase'
3027
+ */
3028
+ case?: Casing;
3029
+ /**
3030
+ * Whether this feature is enabled.
3031
+ *
3032
+ * @default true
3033
+ */
3034
+ enabled?: boolean;
3035
+ /**
3036
+ * Naming pattern for generated names.
3037
+ *
3038
+ * @default '{{name}}Webhook'
3039
+ */
3040
+ name?: NameTransformer;
3041
+ };
3042
+ };
3043
+ type Config = Plugin.Name<'pydantic'> & Plugin.Hooks & Plugin.Comments & Plugin.Exports & PydanticResolvers & {
3044
+ /** Casing convention for generated names. */case: Casing; /** Configuration for reusable schema definitions. */
3045
+ definitions: NamingOptions & FeatureToggle; /** How to generate enum types. */
3046
+ enums: 'enum' | 'literal'; /** How to render field constraints. */
3047
+ fieldStyle: 'annotated' | 'field'; /** Model type to generate. */
3048
+ modelType: 'BaseModel' | 'dataclass'; /** Configuration for request-specific Pydantic models. */
3049
+ requests: NamingOptions & FeatureToggle & {
3050
+ /** Configuration for request body Zod schemas. */body: NamingOptions & FeatureToggle; /** Configuration for request headers Zod schemas. */
3051
+ headers: NamingOptions & FeatureToggle; /** Configuration for request path parameters Zod schemas. */
3052
+ path: NamingOptions & FeatureToggle; /** Configuration for request query parameters Zod schemas. */
3053
+ query: NamingOptions & FeatureToggle;
3054
+ }; /** Configuration for response-specific Pydantic models. */
3055
+ responses: NamingOptions & FeatureToggle; /** Enable strict mode for Pydantic models? */
3056
+ strict: boolean; /** Configuration for webhook-specific Pydantic models. */
3057
+ webhooks: NamingOptions & FeatureToggle;
3058
+ };
3059
+ type PydanticPlugin = DefinePlugin<UserConfig, Config, never, PydanticImports>;
3060
+ declare namespace plugins_d_exports {
3061
+ export { clientAiohttp, clientHttpx, clientRequests, clientUrllib3, pydantic, sdk };
3062
+ }
3063
+ declare const clientAiohttp: (config?: Omit<UserConfig$5, "name"> | undefined) => import("@hey-api/shared").Plugin.Name<"@hey-api/client-aiohttp"> & {
3064
+ baseUrl?: string | number | boolean;
3065
+ } & {
3066
+ name: "@hey-api/client-aiohttp";
3067
+ };
3068
+ declare const clientHttpx: (config?: Omit<UserConfig$4, "name"> | undefined) => import("@hey-api/shared").Plugin.Name<"@hey-api/client-httpx"> & {
3069
+ baseUrl?: string | number | boolean;
3070
+ } & {
3071
+ name: "@hey-api/client-httpx";
3072
+ };
3073
+ declare const clientRequests: (config?: Omit<UserConfig$3, "name"> | undefined) => import("@hey-api/shared").Plugin.Name<"@hey-api/client-requests"> & {
3074
+ baseUrl?: string | number | boolean;
3075
+ } & {
3076
+ name: "@hey-api/client-requests";
3077
+ };
3078
+ declare const clientUrllib3: (config?: Omit<UserConfig$2, "name"> | undefined) => import("@hey-api/shared").Plugin.Name<"@hey-api/client-urllib3"> & {
3079
+ baseUrl?: string | number | boolean;
3080
+ } & {
3081
+ name: "@hey-api/client-urllib3";
3082
+ };
3083
+ declare const sdk: (config?: Omit<UserConfig$1, "name"> | undefined) => import("@hey-api/shared").Plugin.Name<"@hey-api/python-sdk"> & import("@hey-api/shared").Plugin.Hooks & import("@hey-api/shared").UserCommentsOption & import("@hey-api/shared").UserIndexExportOption & {
3084
+ client?: PluginClientNames | boolean;
3085
+ examples?: boolean | UserExamplesConfig;
3086
+ operations?: Exclude<import("@hey-api/shared").OperationsStrategy, "flat"> | UserOperationsConfig;
3087
+ paramsStructure?: "flat" | "grouped";
3088
+ } & {
3089
+ name: "@hey-api/python-sdk";
3090
+ };
3091
+ declare const pydantic: (config?: Omit<UserConfig, "name"> | undefined) => import("@hey-api/shared").Plugin.Name<"pydantic"> & import("@hey-api/shared").Plugin.Hooks & import("@hey-api/shared").UserCommentsOption & import("@hey-api/shared").UserIndexExportOption & PydanticResolvers & {
3092
+ case?: import("@hey-api/shared").Casing;
3093
+ definitions?: boolean | import("@hey-api/shared").NameTransformer | {
3094
+ case?: import("@hey-api/shared").Casing;
3095
+ enabled?: boolean;
3096
+ name?: import("@hey-api/shared").NameTransformer;
3097
+ };
3098
+ enums?: "enum" | "literal";
3099
+ fieldStyle?: "annotated" | "field";
3100
+ modelType?: "BaseModel" | "dataclass";
3101
+ requests?: boolean | import("@hey-api/shared").NameTransformer | {
3102
+ body?: boolean | import("@hey-api/shared").NameTransformer | {
3103
+ case?: import("@hey-api/shared").Casing;
3104
+ enabled?: boolean;
3105
+ name?: import("@hey-api/shared").NameTransformer;
3106
+ };
3107
+ case?: import("@hey-api/shared").Casing;
3108
+ enabled?: boolean;
3109
+ headers?: boolean | import("@hey-api/shared").NameTransformer | {
3110
+ case?: import("@hey-api/shared").Casing;
3111
+ enabled?: boolean;
3112
+ name?: import("@hey-api/shared").NameTransformer;
3113
+ };
3114
+ name?: import("@hey-api/shared").NameTransformer;
3115
+ path?: boolean | import("@hey-api/shared").NameTransformer | {
3116
+ case?: import("@hey-api/shared").Casing;
3117
+ enabled?: boolean;
3118
+ name?: import("@hey-api/shared").NameTransformer;
3119
+ };
3120
+ query?: boolean | import("@hey-api/shared").NameTransformer | {
3121
+ case?: import("@hey-api/shared").Casing;
3122
+ enabled?: boolean;
3123
+ name?: import("@hey-api/shared").NameTransformer;
3124
+ };
3125
+ };
3126
+ responses?: boolean | import("@hey-api/shared").NameTransformer | {
3127
+ case?: import("@hey-api/shared").Casing;
3128
+ enabled?: boolean;
3129
+ name?: import("@hey-api/shared").NameTransformer;
3130
+ };
3131
+ strict?: boolean;
3132
+ webhooks?: boolean | import("@hey-api/shared").NameTransformer | {
3133
+ case?: import("@hey-api/shared").Casing;
3134
+ enabled?: boolean;
3135
+ name?: import("@hey-api/shared").NameTransformer;
3136
+ };
3137
+ } & {
3138
+ name: "pydantic";
3139
+ };
3140
+ //#endregion
3141
+ export { ctx as C, HeyApiClientHttpxPlugin as D, HeyApiClientRequestsPlugin as E, HeyApiClientAiohttpPlugin as O, PyDslContext as S, HeyApiClientUrllib3Plugin as T, EnumMember as _, plugins_d_exports as a, PyDsl as b, PydanticPlugin as c, $$1 as d, DollarPyDsl as f, keywords as g, regexp as h, clientUrllib3 as i, PydanticResolvers as l, PythonRenderer as m, clientHttpx as n, pydantic as o, reserved as p, clientRequests as r, sdk as s, clientAiohttp as t, HeyApiSdkPlugin as u, KwargPyDsl as v, CallArgs as w, ExampleOptions as x, MaybePyDsl as y };
3142
+ //# sourceMappingURL=plugins-wIMadPeQ.d.mts.map