Something went wrong. Try again.
fork of hey-api/openapi-ts because I need some additional things
Something went wrong. Try again.
881 B · 30 lines
TypeScript
12345678910111213141516171819202122232425262728293031import type { PyNodeBase } from '../base';import type { PyExpression } from '../expression';import { PyNodeKind } from '../kinds';import type { PyStatement } from '../statement';import { createBlock, type PyBlock } from './block';import type { PyWithItem } from './withItem';
export interface PyWithStatement extends PyNodeBase { body: PyBlock; items: ReadonlyArray<PyWithItem>; kind: PyNodeKind.WithStatement; modifiers?: ReadonlyArray<PyExpression>;}
export function createWithStatement( items: ReadonlyArray<PyWithItem>, body: ReadonlyArray<PyStatement>, modifiers?: ReadonlyArray<PyExpression>, leadingComments?: ReadonlyArray<string>, trailingComments?: ReadonlyArray<string>,): PyWithStatement { return { body: createBlock(body), items, kind: PyNodeKind.WithStatement, leadingComments, modifiers, trailingComments, };}