import { AliasTypeExpr, BinaryOperator, UnaryOperator } from '../base/Expr'; import { GlobalRef } from '../base/Ref'; import { Value } from '../base/Value'; import * as ts from 'ohos-typescript'; import { Local } from '../base/Local'; import { ArkAliasTypeDefineStmt, Stmt } from '../base/Stmt'; import { AliasType } from '../base/Type'; import { ArkMethod } from '../model/ArkMethod'; import { FullPosition } from '../base/Position'; import { ArkValueTransformer } from './ArkValueTransformer'; export type ValueAndStmts = { value: Value; valueOriginalPositions: FullPosition[]; stmts: Stmt[]; }; export declare class DummyStmt extends Stmt { constructor(text: string); toString(): string; } export declare class ArkIRTransformer { static readonly DUMMY_LOOP_INITIALIZER_STMT = "LoopInitializer"; static readonly DUMMY_CONDITIONAL_OPERATOR = "ConditionalOperator"; static readonly DUMMY_CONDITIONAL_OPERATOR_IF_TRUE_STMT: string; static readonly DUMMY_CONDITIONAL_OPERATOR_IF_FALSE_STMT: string; static readonly DUMMY_CONDITIONAL_OPERATOR_END_STMT: string; static readonly DUMMY_IF_OPERATOR_AND_SIGNAL = "If(&&)"; static readonly DUMMY_IF_OPERATOR_OR_SIGNAL = "If(||)"; static readonly DUMMY_IF_OPERATOR_END = "IfEnd"; protected sourceFile: ts.SourceFile; protected declaringMethod: ArkMethod; protected inBuilderMethod: boolean; protected builderMethodContextFlag: boolean; protected arkValueTransformer: ArkValueTransformer; constructor(sourceFile: ts.SourceFile, declaringMethod: ArkMethod); getLocals(): Set; getGlobals(): Map | null; getThisLocal(): Local; getAliasTypeMap(): Map; prebuildStmts(): Stmt[]; tsNodeToStmts(node: ts.Node): Stmt[]; tsNodeToValueAndStmts(node: ts.Node): ValueAndStmts; protected functionDeclarationToStmts(functionDeclarationNode: ts.FunctionDeclaration): Stmt[]; protected classDeclarationToStmts(node: ts.ClassDeclaration): Stmt[]; private parameterPropertyToStmts; private parameterToStmts; handleExpressionValueWithTempVarIfNeeded(value: Value, positions: FullPosition[], stmts: Stmt[]): { value: Value; positions: FullPosition[]; }; private returnStatementToStmts; private blockToStmts; private expressionStatementToStmts; private addInvokeStmts; private shouldGenerateExtraAssignStmt; private typeAliasDeclarationToStmts; protected generateAliasTypeExpr(rightOp: ts.TypeNode, aliasType: AliasType): AliasTypeExpr; private resolveImportTypeNode; switchStatementToValueAndStmts(switchStatement: ts.SwitchStatement): ValueAndStmts[]; private forStatementToStmts; private rangeForStatementToStmts; private whileStatementToStmts; private doStatementToStmts; private variableStatementToStmts; private variableDeclarationListToStmts; private ifStatementToStmts; /** * Recursively parses logical expressions with &&/|| in the TypeScript AST, and decomposes them into an array of * statements ordered as [left expression statements → operator marker → right expression statements → end marker]. */ private processLogicalBinaryExprToStmts; private conditionToStmts; private gotoStatementToStmts; private throwStatementToStmts; private catchClauseToStmts; private expressionInExportToStmts; private newClassInExportToStmts; mapStmtsToTsStmt(stmts: Stmt[], node: ts.Node): void; static tokenToUnaryOperator(token: ts.SyntaxKind): UnaryOperator | null; static tokenToBinaryOperator(token: ts.SyntaxKind): BinaryOperator | null; generateAssignStmtForValue(value: Value, valueOriginalPositions: FullPosition[]): ValueAndStmts; generateIfStmtForValues(leftValue: Value, leftOpOriginalPositions: FullPosition[], rightValue: Value, rightOpOriginalPositions: FullPosition[]): Stmt[]; setBuilderMethodContextFlag(builderMethodContextFlag: boolean): void; } //# sourceMappingURL=ArkIRTransformer.d.ts.map