@@ -2,7 +2,7 @@ import * as extensions from "./remote_extensions";
22import { Checksum , Cursor , FileAttributes , ListUtils , Tree } from '../../core' ;
33import { DetailsReceiver , Receiver , ReceiverContext , ReceiverFactory , ValueType } from '@openrewrite/rewrite-remote' ;
44import { JavaScriptVisitor } from '..' ;
5- import { JS , JsLeftPadded , JsRightPadded , JsContainer , JsSpace , CompilationUnit , Alias , ArrowFunction , Await , ConditionalType , DefaultType , Delete , Export , ExpressionStatement , ExpressionWithTypeArguments , FunctionType , InferType , ImportType , JsImport , JsImportSpecifier , JsBinary , LiteralType , ObjectBindingDeclarations , PropertyAssignment , SatisfiesExpression , ScopedVariableDeclarations , StatementExpression , TaggedTemplateExpression , TemplateExpression , Tuple , TypeDeclaration , TypeOf , TypeQuery , TypeOperator , TypePredicate , Unary , Union , Intersection , Void , Yield , TypeInfo , JSVariableDeclarations , JSMethodDeclaration , JSForOfLoop , JSForInLoop , JSForInOfLoopControl , NamespaceDeclaration , FunctionDeclaration , TypeLiteral , IndexSignatureDeclaration , ArrayBindingPattern , BindingElement , ExportDeclaration , ExportAssignment , NamedExports , ExportSpecifier , IndexedAccessType , JsAssignmentOperation } from '../tree' ;
5+ import { JS , JsLeftPadded , JsRightPadded , JsContainer , JsSpace , CompilationUnit , Alias , ArrowFunction , Await , ConditionalType , DefaultType , Delete , Export , ExpressionStatement , ExpressionWithTypeArguments , FunctionType , InferType , ImportType , JsImport , JsImportSpecifier , JsBinary , LiteralType , MappedType , ObjectBindingDeclarations , PropertyAssignment , SatisfiesExpression , ScopedVariableDeclarations , StatementExpression , TaggedTemplateExpression , TemplateExpression , Tuple , TypeDeclaration , TypeOf , TypeQuery , TypeOperator , TypePredicate , Unary , Union , Intersection , Void , Yield , TypeInfo , JSVariableDeclarations , JSMethodDeclaration , JSForOfLoop , JSForInLoop , JSForInOfLoopControl , NamespaceDeclaration , FunctionDeclaration , TypeLiteral , IndexSignatureDeclaration , ArrayBindingPattern , BindingElement , ExportDeclaration , ExportAssignment , NamedExports , ExportSpecifier , IndexedAccessType , JsAssignmentOperation } from '../tree' ;
66import { Expression , J , JContainer , JLeftPadded , JRightPadded , NameTree , Space , Statement , TypeTree , TypedTree } from "../../java" ;
77import * as Java from "../../java/tree" ;
88
@@ -209,6 +209,38 @@ class Visitor extends JavaScriptVisitor<ReceiverContext> {
209209 return literalType ;
210210 }
211211
212+ public visitMappedType ( mappedType : MappedType , ctx : ReceiverContext ) : J {
213+ mappedType = mappedType . withId ( ctx . receiveValue ( mappedType . id , ValueType . UUID ) ! ) ;
214+ mappedType = mappedType . withPrefix ( ctx . receiveNode ( mappedType . prefix , receiveSpace ) ! ) ;
215+ mappedType = mappedType . withMarkers ( ctx . receiveNode ( mappedType . markers , ctx . receiveMarkers ) ! ) ;
216+ mappedType = mappedType . padding . withPrefixToken ( ctx . receiveNode ( mappedType . padding . prefixToken , receiveLeftPaddedTree ) ) ;
217+ mappedType = mappedType . padding . withHasReadonly ( ctx . receiveNode ( mappedType . padding . hasReadonly , leftPaddedValueReceiver ( ValueType . Primitive ) ) ! ) ;
218+ mappedType = mappedType . withKeysRemapping ( ctx . receiveNode ( mappedType . keysRemapping , ctx . receiveTree ) ! ) ;
219+ mappedType = mappedType . padding . withSuffixToken ( ctx . receiveNode ( mappedType . padding . suffixToken , receiveLeftPaddedTree ) ) ;
220+ mappedType = mappedType . padding . withHasQuestionToken ( ctx . receiveNode ( mappedType . padding . hasQuestionToken , leftPaddedValueReceiver ( ValueType . Primitive ) ) ! ) ;
221+ mappedType = mappedType . padding . withValueType ( ctx . receiveNode ( mappedType . padding . valueType , receiveContainer ) ! ) ;
222+ mappedType = mappedType . withType ( ctx . receiveValue ( mappedType . type , ValueType . Object ) ) ;
223+ return mappedType ;
224+ }
225+
226+ public visitMappedTypeKeysRemapping ( keysRemapping : MappedType . KeysRemapping , ctx : ReceiverContext ) : J {
227+ keysRemapping = keysRemapping . withId ( ctx . receiveValue ( keysRemapping . id , ValueType . UUID ) ! ) ;
228+ keysRemapping = keysRemapping . withPrefix ( ctx . receiveNode ( keysRemapping . prefix , receiveSpace ) ! ) ;
229+ keysRemapping = keysRemapping . withMarkers ( ctx . receiveNode ( keysRemapping . markers , ctx . receiveMarkers ) ! ) ;
230+ keysRemapping = keysRemapping . padding . withTypeParameter ( ctx . receiveNode ( keysRemapping . padding . typeParameter , receiveRightPaddedTree ) ! ) ;
231+ keysRemapping = keysRemapping . padding . withNameType ( ctx . receiveNode ( keysRemapping . padding . nameType , receiveRightPaddedTree ) ) ;
232+ return keysRemapping ;
233+ }
234+
235+ public visitMappedTypeMappedTypeParameter ( mappedTypeParameter : MappedType . MappedTypeParameter , ctx : ReceiverContext ) : J {
236+ mappedTypeParameter = mappedTypeParameter . withId ( ctx . receiveValue ( mappedTypeParameter . id , ValueType . UUID ) ! ) ;
237+ mappedTypeParameter = mappedTypeParameter . withPrefix ( ctx . receiveNode ( mappedTypeParameter . prefix , receiveSpace ) ! ) ;
238+ mappedTypeParameter = mappedTypeParameter . withMarkers ( ctx . receiveNode ( mappedTypeParameter . markers , ctx . receiveMarkers ) ! ) ;
239+ mappedTypeParameter = mappedTypeParameter . withName ( ctx . receiveNode ( mappedTypeParameter . name , ctx . receiveTree ) ! ) ;
240+ mappedTypeParameter = mappedTypeParameter . padding . withIterateType ( ctx . receiveNode ( mappedTypeParameter . padding . iterateType , receiveLeftPaddedTree ) ! ) ;
241+ return mappedTypeParameter ;
242+ }
243+
212244 public visitObjectBindingDeclarations ( objectBindingDeclarations : ObjectBindingDeclarations , ctx : ReceiverContext ) : J {
213245 objectBindingDeclarations = objectBindingDeclarations . withId ( ctx . receiveValue ( objectBindingDeclarations . id , ValueType . UUID ) ! ) ;
214246 objectBindingDeclarations = objectBindingDeclarations . withPrefix ( ctx . receiveNode ( objectBindingDeclarations . prefix , receiveSpace ) ! ) ;
@@ -1472,6 +1504,41 @@ class Factory implements ReceiverFactory {
14721504 ) ;
14731505 }
14741506
1507+ if ( type === "org.openrewrite.javascript.tree.JS$MappedType" ) {
1508+ return new MappedType (
1509+ ctx . receiveValue ( null , ValueType . UUID ) ! ,
1510+ ctx . receiveNode ( null , receiveSpace ) ! ,
1511+ ctx . receiveNode ( null , ctx . receiveMarkers ) ! ,
1512+ ctx . receiveNode < JLeftPadded < Java . Literal > > ( null , receiveLeftPaddedTree ) ,
1513+ ctx . receiveNode < JLeftPadded < boolean > > ( null , leftPaddedValueReceiver ( ValueType . Primitive ) ) ! ,
1514+ ctx . receiveNode < MappedType . KeysRemapping > ( null , ctx . receiveTree ) ! ,
1515+ ctx . receiveNode < JLeftPadded < Java . Literal > > ( null , receiveLeftPaddedTree ) ,
1516+ ctx . receiveNode < JLeftPadded < boolean > > ( null , leftPaddedValueReceiver ( ValueType . Primitive ) ) ! ,
1517+ ctx . receiveNode < JContainer < TypeTree > > ( null , receiveContainer ) ! ,
1518+ ctx . receiveValue ( null , ValueType . Object )
1519+ ) ;
1520+ }
1521+
1522+ if ( type === "org.openrewrite.javascript.tree.JS$MappedType$KeysRemapping" ) {
1523+ return new MappedType . KeysRemapping (
1524+ ctx . receiveValue ( null , ValueType . UUID ) ! ,
1525+ ctx . receiveNode ( null , receiveSpace ) ! ,
1526+ ctx . receiveNode ( null , ctx . receiveMarkers ) ! ,
1527+ ctx . receiveNode < JRightPadded < MappedType . MappedTypeParameter > > ( null , receiveRightPaddedTree ) ! ,
1528+ ctx . receiveNode < JRightPadded < Expression > > ( null , receiveRightPaddedTree )
1529+ ) ;
1530+ }
1531+
1532+ if ( type === "org.openrewrite.javascript.tree.JS$MappedType$MappedTypeParameter" ) {
1533+ return new MappedType . MappedTypeParameter (
1534+ ctx . receiveValue ( null , ValueType . UUID ) ! ,
1535+ ctx . receiveNode ( null , receiveSpace ) ! ,
1536+ ctx . receiveNode ( null , ctx . receiveMarkers ) ! ,
1537+ ctx . receiveNode < Expression > ( null , ctx . receiveTree ) ! ,
1538+ ctx . receiveNode < JLeftPadded < TypeTree > > ( null , receiveLeftPaddedTree ) !
1539+ ) ;
1540+ }
1541+
14751542 if ( type === "org.openrewrite.javascript.tree.JS$ObjectBindingDeclarations" ) {
14761543 return new ObjectBindingDeclarations (
14771544 ctx . receiveValue ( null , ValueType . UUID ) ! ,
0 commit comments