fork of hey-api/openapi-ts because I need some additional things
1import type { PyNode as _PyNode, PyNodeBase as _PyNodeBase } from './nodes/base';
2import type {
3 PyComprehension as _PyComprehension,
4 PyComprehensionNode as _PyComprehensionNode,
5} from './nodes/comprehension';
6import type { PyClassDeclaration as _PyClassDeclaration } from './nodes/declarations/class';
7import type { PyFunctionDeclaration as _PyFunctionDeclaration } from './nodes/declarations/function';
8import type { PyFunctionParameter as _PyFunctionParameter } from './nodes/declarations/functionParameter';
9import type { PyExpression as _PyExpression } from './nodes/expression';
10import type { PyAsyncExpression as _PyAsyncExpression } from './nodes/expressions/async';
11import type { PyAwaitExpression as _PyAwaitExpression } from './nodes/expressions/await';
12import type {
13 PyBinaryExpression as _PyBinaryExpression,
14 PyBinaryOperator as _PyBinaryOperator,
15} from './nodes/expressions/binary';
16import type { PyCallExpression as _PyCallExpression } from './nodes/expressions/call';
17import type { PyDictComprehension as _PyDictComprehension } from './nodes/expressions/comprehensions/dict';
18import type { PyListComprehension as _PyListComprehension } from './nodes/expressions/comprehensions/list';
19import type { PySetComprehension as _PySetComprehension } from './nodes/expressions/comprehensions/set';
20import type { PyDictExpression as _PyDictExpression } from './nodes/expressions/dict';
21import type { PyFStringExpression as _PyFStringExpression } from './nodes/expressions/fString';
22import type { PyGeneratorExpression as _PyGeneratorExpression } from './nodes/expressions/generator';
23import type { PyIdentifier as _PyIdentifier } from './nodes/expressions/identifier';
24import type { PyLambdaExpression as _PyLambdaExpression } from './nodes/expressions/lambda';
25import type { PyListExpression as _PyListExpression } from './nodes/expressions/list';
26import type { PyLiteral as _PyLiteral } from './nodes/expressions/literal';
27import type { PyMemberExpression as _PyMemberExpression } from './nodes/expressions/member';
28import type { PySetExpression as _PySetExpression } from './nodes/expressions/set';
29import type { PyTupleExpression as _PyTupleExpression } from './nodes/expressions/tuple';
30import type { PyYieldExpression as _PyYieldExpression } from './nodes/expressions/yield';
31import type { PyYieldFromExpression as _PyYieldFromExpression } from './nodes/expressions/yieldFrom';
32import { factory } from './nodes/factory';
33import { PyNodeKind } from './nodes/kinds';
34import type { PyStatement as _PyStatement } from './nodes/statement';
35import type { PyAssignment as _PyAssignment } from './nodes/statements/assignment';
36import type {
37 PyAugmentedAssignment as _PyAugmentedAssignment,
38 PyAugmentedOperator as _PyAugmentedOperator,
39} from './nodes/statements/augmentedAssignment';
40import type { PyBlock as _PyBlock } from './nodes/statements/block';
41import type { PyBreakStatement as _PyBreakStatement } from './nodes/statements/break';
42import type { PyContinueStatement as _PyContinueStatement } from './nodes/statements/continue';
43import type { PyEmptyStatement as _PyEmptyStatement } from './nodes/statements/empty';
44import type { PyExceptClause as _PyExceptClause } from './nodes/statements/except';
45import type { PyExpressionStatement as _PyExpressionStatement } from './nodes/statements/expression';
46import type { PyForStatement as _PyForStatement } from './nodes/statements/for';
47import type { PyIfStatement as _PyIfStatement } from './nodes/statements/if';
48import type { PyImportStatement as _PyImportStatement } from './nodes/statements/import';
49import type { PyRaiseStatement as _PyRaiseStatement } from './nodes/statements/raise';
50import type { PyReturnStatement as _PyReturnStatement } from './nodes/statements/return';
51import type { PyTryStatement as _PyTryStatement } from './nodes/statements/try';
52import type { PyWhileStatement as _PyWhileStatement } from './nodes/statements/while';
53import type { PyWithStatement as _PyWithStatement } from './nodes/statements/with';
54import type { PyWithItem as _PyWithItem } from './nodes/statements/withItem';
55import type { PyComment as _PyComment } from './nodes/structure/comment';
56import type { PySourceFile as _PySourceFile } from './nodes/structure/sourceFile';
57import type { PyPrinterOptions as _PyPrinterOptions } from './printer';
58import { createPrinter, printAst } from './printer';
59
60// eslint-disable-next-line @typescript-eslint/no-namespace
61export namespace py {
62 // Base / Core
63 export type Node = _PyNode;
64 export type NodeBase = _PyNodeBase;
65 export type NodeKind = PyNodeKind;
66 export type Expression = _PyExpression;
67 export type Statement = _PyStatement;
68
69 // Structure
70 export type SourceFile = _PySourceFile;
71 export type Comment = _PyComment;
72
73 // Declarations
74 export type ClassDeclaration = _PyClassDeclaration;
75 export type FunctionDeclaration = _PyFunctionDeclaration;
76 export type FunctionParameter = _PyFunctionParameter;
77
78 // Statements
79 export type Assignment = _PyAssignment;
80 export type AugmentedAssignment = _PyAugmentedAssignment;
81 export type AugmentedOperator = _PyAugmentedOperator;
82 export type Block = _PyBlock;
83 export type BreakStatement = _PyBreakStatement;
84 export type ContinueStatement = _PyContinueStatement;
85 export type EmptyStatement = _PyEmptyStatement;
86 export type ExceptClause = _PyExceptClause;
87 export type ExpressionStatement = _PyExpressionStatement;
88 export type ForStatement = _PyForStatement;
89 export type IfStatement = _PyIfStatement;
90 export type ImportStatement = _PyImportStatement;
91 export type RaiseStatement = _PyRaiseStatement;
92 export type ReturnStatement = _PyReturnStatement;
93 export type TryStatement = _PyTryStatement;
94 export type WhileStatement = _PyWhileStatement;
95 export type WithItem = _PyWithItem;
96 export type WithStatement = _PyWithStatement;
97
98 // Expressions
99 export type AsyncExpression = _PyAsyncExpression;
100 export type AwaitExpression = _PyAwaitExpression;
101 export type BinaryExpression = _PyBinaryExpression;
102 export type BinaryOperator = _PyBinaryOperator;
103 export type CallExpression = _PyCallExpression;
104 export type DictExpression = _PyDictExpression;
105 export type FStringExpression = _PyFStringExpression;
106 export type GeneratorExpression = _PyGeneratorExpression;
107 export type Identifier = _PyIdentifier;
108 export type LambdaExpression = _PyLambdaExpression;
109 export type ListExpression = _PyListExpression;
110 export type Literal = _PyLiteral;
111 export type MemberExpression = _PyMemberExpression;
112 export type SetExpression = _PySetExpression;
113 export type TupleExpression = _PyTupleExpression;
114 export type YieldExpression = _PyYieldExpression;
115 export type YieldFromExpression = _PyYieldFromExpression;
116
117 // Comprehensions
118 export type Comprehension = _PyComprehension;
119 export type ComprehensionNode = _PyComprehensionNode;
120 export type DictComprehension = _PyDictComprehension;
121 export type ListComprehension = _PyListComprehension;
122 export type SetComprehension = _PySetComprehension;
123
124 // Printer
125 export type PrinterOptions = _PyPrinterOptions;
126}
127
128export const py = {
129 PyNodeKind,
130 createPrinter,
131 factory,
132 printAst,
133} as const;