/** * types and methods related to the generation of methods with multiple statements * * @since 0.0.7-alpha7 */ import { ExplicitUtamArgument, MethodArgumentsTypeMap, MethodArgumentsDescriptionMap, UtamElementType, UtamMatcher, NonLiteralArgumentInternal } from '@utam/types'; import { ReturnType } from '../../utils/return-types'; import { ArgsTraversalContext } from './arguments-processor'; import { ClassAstContext, InvocationType } from './statements-transformer'; export interface StatementsBasedMethodAst { methodName: string; statements: MethodStatementAst[]; orderedArgs: string[]; description: string[]; argsTypeMap: MethodArgumentsTypeMap; argsDescriptionMap: MethodArgumentsDescriptionMap; } export interface ComposeMethodAst extends StatementsBasedMethodAst { isPublic: boolean; methodName: string; orderedArgs: string[]; typeConstructor: string; returnsList: boolean; statements: MethodStatementAst[]; methodArgs?: NonLiteralArgumentInternal[]; } interface ChainStatementAst { isChain: boolean; returnType: ReturnType; invocationType: InvocationType; applyFunction: string; applyFunctionArgs?: ExplicitUtamArgument[]; matcher?: UtamMatcher; } interface SelfStatementAst { elementName: 'self'; isChain: boolean; returnType: ReturnType; invocationType: InvocationType; applyFunction: string; applyFunctionArgs?: ExplicitUtamArgument[]; matcher?: UtamMatcher; } interface ExtensionStatementAst { applyFunction: string; applyFunctionArgs?: ExplicitUtamArgument[]; moduleReference?: string; returnType: ReturnType; invocationType: InvocationType; } interface RegularStatementAst { elementName: string; elementType: UtamElementType; elementNullable: boolean; elementGetMethod: string; elementArgs?: string[]; returnType: ReturnType; invocationType: InvocationType; isChain: boolean; applyFunction: string; applyFunctionArgs?: ExplicitUtamArgument[]; matcher?: UtamMatcher; } export type MethodStatementAst = RegularStatementAst | ExtensionStatementAst | SelfStatementAst | ChainStatementAst; /** * generate code for a method composed of declared statements * * @param classContext context of the current page object with elements and methods information * @param astConfig context of the current page object with elements and methods information * @param methodAst abstract representation of the method declared in JSON */ export declare function generateComposeMethodCode(classContext: ClassAstContext, methodAst: StatementsBasedMethodAst, argsContext: ArgsTraversalContext): string; export {}; //# sourceMappingURL=statements-body-generator.d.ts.map