import ts from "typescript" ; import type { OpenApi } from "../../../types" ; export interface OperationState { requestUri : string ; httpMethod : string ; parameterName ? : string ; requestBodyName ? : string ; } export interface Type { document : OpenApi . Document ; additionalStatements : ts . Statement [ ] ; operations : { [ operationId ] : OperationState ; } ; } export const createDefaultOperationState = ( httpMethod , requestUri , state ) : OperationState => { return { httpMethod : httpMethod , requestUri : requestUri , parameterName : state . parameterName , requestBodyName : state . parameterName , } ; } ; export const createDefaultState = ( rootDocument ) : Type => ( { document : rootDocument , additionalStatements : [ ] , operations : { } , } ) ;