Amplication AST Libraries Documentation
    Preparing search index...

    Interface for code generation writers in the Amplication AST system. Provides methods for writing code with proper indentation and formatting.

    interface IWriter {
        write(text: string): void;
        writeNode(node: IAstNode): void;
        writeLine(text?: string): void;
        newLine(): void;
        writeNewLineIfLastLineNot(): void;
        indent(): void;
        dedent(): void;
        toString(): string;
    }

    Implemented by

    Index

    Methods

    • Writes text to the output buffer with proper indentation

      Parameters

      • text: string

        The text to write

      Returns void

    • Writes an AST node to the output buffer

      Parameters

      Returns void

    • Writes text followed by a newline if the last line wasn't a newline

      Parameters

      • Optionaltext: string

        Optional text to write before the newline

      Returns void

    • Writes a newline to the output buffer

      Returns void

    • Writes a newline if the last line wasn't a newline

      Returns void

    • Increases the indentation level

      Returns void

    • Decreases the indentation level

      Returns void

    • Returns the current contents of the output buffer

      Returns string