Returns Visitor<
Node
| null,
| "constantPdaSeedNode"
| "variablePdaSeedNode"
| "amountTypeNode"
| "arrayTypeNode"
| "booleanTypeNode"
| "bytesTypeNode"
| "dateTimeTypeNode"
| "enumTypeNode"
| "fixedSizeTypeNode"
| "hiddenPrefixTypeNode"
| "hiddenSuffixTypeNode"
| "mapTypeNode"
| "numberTypeNode"
| "optionTypeNode"
| "postOffsetTypeNode"
| "preOffsetTypeNode"
| "publicKeyTypeNode"
| "remainderOptionTypeNode"
| "sentinelTypeNode"
| "setTypeNode"
| "sizePrefixTypeNode"
| "solAmountTypeNode"
| "stringTypeNode"
| "structTypeNode"
| "tupleTypeNode"
| "zeroableOptionTypeNode"
| "arrayValueNode"
| "booleanValueNode"
| "bytesValueNode"
| "constantValueNode"
| "enumValueNode"
| "mapValueNode"
| "noneValueNode"
| "numberValueNode"
| "publicKeyValueNode"
| "setValueNode"
| "someValueNode"
| "stringValueNode"
| "structValueNode"
| "tupleValueNode"
| "programLinkNode"
| "constantDiscriminatorNode"
| "fieldDiscriminatorNode"
| "sizeDiscriminatorNode"
| "accountBumpValueNode"
| "accountValueNode"
| "argumentValueNode"
| "conditionalValueNode"
| "identityValueNode"
| "payerValueNode"
| "pdaValueNode"
| "programIdValueNode"
| "resolverValueNode"
| "errorNode"
| "accountNode"
| "constantNode"
| "definedTypeNode"
| "eventNode"
| "instructionAccountNode"
| "instructionArgumentNode"
| "instructionByteDeltaNode"
| "instructionNode"
| "instructionRemainingAccountsNode"
| "instructionStatusNode"
| "pdaNode"
| "programNode"
| "pdaSeedValueNode"
| "fixedCountNode"
| "prefixedCountNode"
| "remainderCountNode"
| "accountLinkNode"
| "definedTypeLinkNode"
| "instructionAccountLinkNode"
| "instructionArgumentLinkNode"
| "instructionLinkNode"
| "pdaLinkNode"
| "enumEmptyVariantTypeNode"
| "enumStructVariantTypeNode"
| "enumTupleVariantTypeNode"
| "structFieldTypeNode"
| "mapEntryValueNode"
| "structFieldValueNode"
| "rootNode",
>
A bottom-up transformer visitor that lifts events into defined types
Converts every EventNode on a program into a DefinedTypeNode so that events are emitted as regular types by the JavaScript renderer.
As of
@codama/nodes-from-anchorv1.5, Anchor events are parsed into dedicatedeventNodes (separate from defined types), and@codama/renderers-jsv2 no longer renders events at all. This visitor restores the previous behavior of generating a struct codec per event by re-homing each event's data into the program's defined types.The event data is wrapped in a
hiddenPrefixTypeNodecarrying the Anchor discriminator; we unwrap it so the rendered type is a plain struct (matching the historical output), then drop the now-emptyeventslist.