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

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