@hey-api/openapi-python 0.0.0-next-20260624072454 → 0.0.0-next-20260625120525

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