fork of hey-api/openapi-ts because I need some additional things
1import type { PyNodeBase } from '../base';
2import type { PyExpression } from '../expression';
3import { PyNodeKind } from '../kinds';
4
5export interface PyWithItem extends PyNodeBase {
6 alias?: PyExpression;
7 contextExpr: PyExpression;
8 kind: PyNodeKind.WithItem;
9}
10
11export function createWithItem(
12 contextExpr: PyExpression,
13 alias?: PyExpression,
14 leadingComments?: ReadonlyArray<string>,
15 trailingComments?: ReadonlyArray<string>,
16): PyWithItem {
17 return {
18 alias,
19 contextExpr,
20 kind: PyNodeKind.WithItem,
21 leadingComments,
22 trailingComments,
23 };
24}