@servicenow/sdk - v4.4.1
    Preparing search index...
    interface PrintHandlers {
        hasGlobalName?(name: string): boolean;
        isEmitNotificationEnabled?(node: tsc.Node): boolean;
        onEmitNode?(
            hint: tsc.EmitHint,
            node: tsc.Node,
            emitCallback: (hint: tsc.EmitHint, node: tsc.Node) => void,
        ): void;
        substituteNode?(hint: tsc.EmitHint, node: tsc.Node): tsc.Node;
    }
    Index

    Methods

    • 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.

      Parameters

      • name: string

      Returns boolean

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

      Parameters

      Returns boolean

    • 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.

      Parameters

      • hint: tsc.EmitHint

        A hint indicating the intended purpose of the node.

      • node: tsc.Node

        The node to emit.

      • emitCallback: (hint: tsc.EmitHint, node: tsc.Node) => void

        A callback that, when invoked, will emit the node.

      Returns void

      var printer = createPrinter(printerOptions, {
      onEmitNode(hint, node, emitCallback) {
      // set up or track state prior to emitting the node...
      emitCallback(hint, node);
      // restore state after emitting the 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.

      Parameters

      • hint: tsc.EmitHint

        A hint indicating the intended purpose of the node.

      • node: tsc.Node

        The node to emit.

      Returns tsc.Node

      var printer = createPrinter(printerOptions, {
      substituteNode(hint, node) {
      // perform substitution if necessary...
      return node;
      }
      });