Writable fragment of code.

By default, represents a multi-line code, where each written code snippet is placed on a new line. When inline, the written code snippets placed without new lines between them.

Hierarchy

  • EsCode

Implements

Constructors

Accessors

Methods

Constructors

Accessors

Methods

  • Emits the written code.

    It is possible to write more code until emitted code is not printed. It is an error to write the once the code printing started.

    It is possible to issue multiple code emissions at the same time.

    Parameters

    • scope: EsScope

      Code emission scope.

    Returns EsPrinter

    Emitted code printer.

  • Writes indented code to this fragment.

    Always places each code snippet on a new line and prepends it with indentation symbols. Even when inside an inline code fragment.

    Indentations may be nested. Nested indentations adjust enclosing ones.

    Parameters

    • Rest ...snippets: EsSnippet[]

      Indented code snippets.

    Returns EsCode

    this instance.

  • Writes multiple lines of code to this fragment.

    Always places each code snippet on a new line. Even when inside an inline code fragment. Unlike indent, does not adjust indentation.

    Parameters

    • Rest ...snippets: EsSnippet[]

      Multi-line code snippets.

    Returns EsCode

    this instance.

  • Writes code to this fragment.

    Writes a new line without snippets specified, unless this is an inline code fragment.

    Places each code snippet on a new line, unless this is an inline code fragment.

    Parameters

    • Rest ...snippets: EsSnippet[]

      Written code snippets.

    Returns EsCode

    this instance.

Generated using TypeDoc