TransformationContext

Properties

Link copied to clipboard
abstract external val factory: NodeFactory
Link copied to clipboard
abstract external var onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) -> Unit) -> Unit

Hook used to allow transformers to capture state before or after the printer emits a node.

Link copied to clipboard
abstract external var onSubstituteNode: (hint: EmitHint, node: Node) -> Node

Hook used by transformers to substitute expressions just before they are emitted by the pretty printer.

Functions

Link copied to clipboard
abstract external fun enableEmitNotification(kind: SyntaxKind)

Enables before/after emit notifications in the pretty printer for the provided SyntaxKind.

Link copied to clipboard
abstract external fun enableSubstitution(kind: SyntaxKind)

Enables expression substitutions in the pretty printer for the provided SyntaxKind.

Link copied to clipboard
abstract external fun endLexicalEnvironment(): ReadonlyArray<Statement>?

Ends a lexical environment, returning any declarations.

Link copied to clipboard
abstract external fun getCompilerOptions(): CompilerOptions

Gets the compiler options supplied to the transformer.

Link copied to clipboard
abstract external fun hoistFunctionDeclaration(node: FunctionDeclaration)

Hoists a function declaration to the containing scope.

Link copied to clipboard
abstract external fun hoistVariableDeclaration(node: Identifier)

Hoists a variable declaration to the containing scope.

Link copied to clipboard
abstract external fun isEmitNotificationEnabled(node: Node): Boolean

Determines whether before/after emit notifications should be raised in the pretty printer when it emits a node.

Link copied to clipboard
abstract external fun isSubstitutionEnabled(node: Node): Boolean

Determines whether expression substitutions are enabled for the provided node.

Link copied to clipboard
abstract external fun readEmitHelpers(): ReadonlyArray<EmitHelper>?

Gets and resets the requested non-scoped emit helpers.

Link copied to clipboard
abstract external fun requestEmitHelper(helper: EmitHelper)

Records a request for a non-scoped emit helper in the current context.

Link copied to clipboard
abstract external fun resumeLexicalEnvironment()

Resumes a suspended lexical environment, usually before visiting a function body.

Link copied to clipboard
abstract external fun startLexicalEnvironment()

Starts a new lexical environment.

Link copied to clipboard
abstract external fun suspendLexicalEnvironment()

Suspends the current lexical environment, usually after visiting a parameter list.