@servicenow/sdk - v4.4.1
    Preparing search index...

    Interface TransformationContext

    interface TransformationContext {
        factory: NodeFactory;
        onEmitNode: (
            hint: tsc.EmitHint,
            node: tsc.Node,
            emitCallback: (hint: tsc.EmitHint, node: tsc.Node) => void,
        ) => void;
        onSubstituteNode: (hint: tsc.EmitHint, node: tsc.Node) => tsc.Node;
        enableEmitNotification(kind: tsc.SyntaxKind): void;
        enableSubstitution(kind: tsc.SyntaxKind): void;
        endLexicalEnvironment(): tsc.Statement[] | undefined;
        getCompilerOptions(): tsc.CompilerOptions;
        hoistFunctionDeclaration(node: tsc.FunctionDeclaration): void;
        hoistVariableDeclaration(node: tsc.Identifier): void;
        isEmitNotificationEnabled(node: tsc.Node): boolean;
        isSubstitutionEnabled(node: tsc.Node): boolean;
        readEmitHelpers(): EmitHelper[] | undefined;
        requestEmitHelper(helper: EmitHelper): void;
        resumeLexicalEnvironment(): void;
        startLexicalEnvironment(): void;
        suspendLexicalEnvironment(): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    factory: NodeFactory
    onEmitNode: (
        hint: tsc.EmitHint,
        node: tsc.Node,
        emitCallback: (hint: tsc.EmitHint, node: tsc.Node) => void,
    ) => void

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

    NOTE: Transformation hooks should only be modified during Transformer initialization, before returning the NodeTransformer callback.

    onSubstituteNode: (hint: tsc.EmitHint, node: tsc.Node) => tsc.Node

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

    NOTE: Transformation hooks should only be modified during Transformer initialization, before returning the NodeTransformer callback.

    Methods

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

      Parameters

      Returns void

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

      Parameters

      Returns void

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

      Parameters

      Returns boolean

    • Determines whether expression substitutions are enabled for the provided node.

      Parameters

      Returns boolean

    • Gets and resets the requested non-scoped emit helpers.

      Returns EmitHelper[] | undefined

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

      Parameters

      Returns void

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

      Returns void

    • Starts a new lexical environment.

      Returns void

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

      Returns void