PrintHandlers

sealed external interface PrintHandlers(source)

Properties

Link copied to clipboard
abstract val hasGlobalName: (name: String) -> Boolean?

A hook used by the Printer when generating unique names to avoid collisions with globally defined names that exist outside of the current source file.

Link copied to clipboard
abstract val isEmitNotificationEnabled: (node: Node) -> Boolean?

A hook used to check if an emit notification is required for a node.

Link copied to clipboard
abstract val onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) -> Unit) -> Unit?

A hook used by the Printer to provide notifications prior to emitting a node. A compatible implementation must invoke emitCallback with the provided hint and node values.

Link copied to clipboard
abstract val substituteNode: (hint: EmitHint, node: Node) -> Node?

A hook used by the Printer to perform just-in-time substitution of a node. This is primarily used by node transformations that need to substitute one node for another, such as replacing myExportedVar with exports.myExportedVar.