fork of hey-api/openapi-ts because I need some additional things
1import type { PyNode, PyNodeBase } from '../base';
2import type { PyExpression } from '../expression';
3import { PyNodeKind } from '../kinds';
4import type { PyStatement } from '../statement';
5import type { PyBlock } from '../statements/block';
6import { createBlock } from '../statements/block';
7
8export interface PyClassDeclaration extends PyNodeBase {
9 baseClasses?: ReadonlyArray<PyNode>;
10 body: PyBlock;
11 decorators?: ReadonlyArray<PyExpression>;
12 docstring?: string;
13 kind: PyNodeKind.ClassDeclaration;
14 name: string;
15}
16
17export function createClassDeclaration(
18 name: string,
19 body: ReadonlyArray<PyStatement>,
20 decorators?: ReadonlyArray<PyExpression>,
21 baseClasses?: ReadonlyArray<PyNode>,
22 docstring?: string,
23 leadingComments?: ReadonlyArray<string>,
24 trailingComments?: ReadonlyArray<string>,
25): PyClassDeclaration {
26 return {
27 baseClasses,
28 body: createBlock(body),
29 decorators,
30 docstring,
31 kind: PyNodeKind.ClassDeclaration,
32 leadingComments,
33 name,
34 trailingComments,
35 };
36}