import * as ts from 'typescript'; import type { TargetLanguage } from './target-language'; import { ObjectLiteralStruct } from '../jsii/jsii-types'; import { OTree } from '../o-tree'; import { AstRenderer, AstHandler, CommentSyntax } from '../renderer'; import { SubmoduleReference } from '../submodule-reference'; import { ImportStatement } from '../typescript/imports'; /** * A basic visitor that applies for most curly-braces-based languages */ export declare abstract class DefaultVisitor implements AstHandler { abstract readonly defaultContext: C; abstract readonly language: TargetLanguage; protected statementTerminator: string; abstract mergeContext(old: C, update: C): C; commentRange(comment: CommentSyntax, _context: AstRenderer): OTree; sourceFile(node: ts.SourceFile, context: AstRenderer): OTree; jsDoc(_node: ts.JSDoc, _context: AstRenderer): OTree; importStatement(node: ImportStatement, context: AstRenderer): OTree; functionDeclaration(node: ts.FunctionDeclaration, children: AstRenderer): OTree; stringLiteral(node: ts.StringLiteral | ts.NoSubstitutionTemplateLiteral, _renderer: AstRenderer): OTree; numericLiteral(node: ts.NumericLiteral, _children: AstRenderer): OTree; identifier(node: ts.Identifier, _children: AstRenderer): OTree; block(node: ts.Block, children: AstRenderer): OTree; parameterDeclaration(node: ts.ParameterDeclaration, children: AstRenderer): OTree; returnStatement(node: ts.ReturnStatement, children: AstRenderer): OTree; binaryExpression(node: ts.BinaryExpression, context: AstRenderer): OTree; prefixUnaryExpression(node: ts.PrefixUnaryExpression, context: AstRenderer): OTree; translateUnaryOperator(operator: ts.PrefixUnaryOperator): string; translateBinaryOperator(operator: string): string; ifStatement(node: ts.IfStatement, context: AstRenderer): OTree; propertyAccessExpression(node: ts.PropertyAccessExpression, context: AstRenderer, _submoduleReference: SubmoduleReference | undefined): OTree; /** * Do some work on property accesses to translate common JavaScript-isms to language-specific idioms */ callExpression(node: ts.CallExpression, context: AstRenderer): OTree; awaitExpression(node: ts.AwaitExpression, context: AstRenderer): OTree; regularCallExpression(node: ts.CallExpression, context: AstRenderer): OTree; superCallExpression(node: ts.CallExpression, context: AstRenderer): OTree; printStatement(args: ts.NodeArray, context: AstRenderer): OTree; expressionStatement(node: ts.ExpressionStatement, context: AstRenderer): OTree; token(node: ts.Token, context: AstRenderer): OTree; /** * An object literal can render as one of three things: * * - Don't know the type (render as an unknown struct) * - Know the type: * - It's a struct (render as known struct) * - It's not a struct (render as key-value map) */ objectLiteralExpression(node: ts.ObjectLiteralExpression, context: AstRenderer): OTree; unknownTypeObjectLiteralExpression(node: ts.ObjectLiteralExpression, context: AstRenderer): OTree; knownStructObjectLiteralExpression(node: ts.ObjectLiteralExpression, _structType: ObjectLiteralStruct, context: AstRenderer): OTree; keyValueObjectLiteralExpression(node: ts.ObjectLiteralExpression, context: AstRenderer): OTree; newExpression(node: ts.NewExpression, context: AstRenderer): OTree; propertyAssignment(node: ts.PropertyAssignment, context: AstRenderer): OTree; variableStatement(node: ts.VariableStatement, context: AstRenderer): OTree; variableDeclarationList(node: ts.VariableDeclarationList, context: AstRenderer): OTree; variableDeclaration(node: ts.VariableDeclaration, context: AstRenderer): OTree; arrayLiteralExpression(node: ts.ArrayLiteralExpression, context: AstRenderer): OTree; shorthandPropertyAssignment(node: ts.ShorthandPropertyAssignment, context: AstRenderer): OTree; forOfStatement(node: ts.ForOfStatement, context: AstRenderer): OTree; classDeclaration(node: ts.ClassDeclaration, context: AstRenderer): OTree; constructorDeclaration(node: ts.ConstructorDeclaration, context: AstRenderer): OTree; propertyDeclaration(node: ts.PropertyDeclaration, context: AstRenderer): OTree; computedPropertyName(node: ts.Expression, context: AstRenderer): OTree; methodDeclaration(node: ts.MethodDeclaration, context: AstRenderer): OTree; interfaceDeclaration(node: ts.InterfaceDeclaration, context: AstRenderer): OTree; structInterfaceDeclaration(node: ts.InterfaceDeclaration, context: AstRenderer): OTree; regularInterfaceDeclaration(node: ts.InterfaceDeclaration, context: AstRenderer): OTree; propertySignature(node: ts.PropertySignature, context: AstRenderer): OTree; methodSignature(node: ts.MethodSignature, context: AstRenderer): OTree; asExpression(node: ts.AsExpression, context: AstRenderer): OTree; spreadElement(node: ts.SpreadElement, context: AstRenderer): OTree; spreadAssignment(node: ts.SpreadAssignment, context: AstRenderer): OTree; ellipsis(_node: ts.SpreadElement | ts.SpreadAssignment, _context: AstRenderer): OTree; templateExpression(node: ts.TemplateExpression, context: AstRenderer): OTree; elementAccessExpression(node: ts.ElementAccessExpression, context: AstRenderer): OTree; nonNullExpression(node: ts.NonNullExpression, context: AstRenderer): OTree; parenthesizedExpression(node: ts.ParenthesizedExpression, context: AstRenderer): OTree; maskingVoidExpression(node: ts.VoidExpression, context: AstRenderer): OTree; protected argumentList(args: readonly ts.Node[] | undefined, context: AstRenderer): OTree; private notImplemented; } //# sourceMappingURL=default.d.ts.map