Interface TwingOutputBuffer

interface TwingOutputBuffer {
    outputStream: Readable;
    clean(): boolean;
    echo(string): string | void;
    endAndClean(): boolean;
    endAndFlush(): boolean;
    flush(): boolean;
    getAndClean(): string;
    getAndFlush(): string;
    getContents(): string;
    getLevel(): number;
    start(): boolean;
}

Properties

outputStream: Readable

Methods

  • Clean (erase) the output buffer

    In human terms: empties the top-most buffer

    ┌─────────┐ ┌─────────┐ │ oof │ │ │ ├─────────┤ ├─────────┤ │ bar │ => │ bar │ ├─────────┤ ├─────────┤ │ foo │ │ foo │ => true └─────────┘ └─────────┘

    Returns boolean

  • Clean the output buffer, and delete active output buffer

    In human terms: removes the top-most buffer

    ┌─────────┐
    │   oof   │
    ├─────────┤    ┌─────────┐
    │   bar   │ -> │   bar   │
    ├─────────┤    ├─────────┤
    │   foo   │    │   foo   │ => true
    └─────────┘    └─────────┘
    

    Returns boolean

  • Flush (send) the output buffer, and delete current output buffer

    In human terms: appends the top-most buffer to the second-top-most buffer and removes the top-most buffer

    ┌─────────┐
    │   oof   │
    ├─────────┤    ┌─────────┐
    │   bar   │ -> │  baroof │
    ├─────────┤    ├─────────┤
    │   foo   │    │   foo   │ => true
    └─────────┘    └─────────┘
    

    Returns boolean

  • Flush (send) contents of the output buffer. The last buffer content is sent to next buffer

    In human terms: appends the top-most buffer to the second-top-most buffer and empties the top-most buffer

    ┌─────────┐    ┌─────────┐
    │   oof   │    │         │
    ├─────────┤    ├─────────┤
    │   bar   │ => │  baroof │
    ├─────────┤    ├─────────┤
    │   foo   │    │   foo   │ => true
    └─────────┘    └─────────┘
    

    Returns boolean

  • Get active buffer contents and delete active output buffer

    In human terms: removes the top-most buffer and returns its content

    ┌─────────┐
    │   oof   │
    ├─────────┤    ┌─────────┐
    │   bar   │ -> │   bar   │
    ├─────────┤    ├─────────┤
    │   foo   │    │   foo   │ => "oof"
    └─────────┘    └─────────┘
    

    Returns string

  • Get active buffer contents, flush (send) the output buffer, and delete active output buffer

    In human terms: appends the top-most buffer to the second-top-most buffer, removes the top-most buffer and returns its content

    ┌─────────┐
    │   oof   │
    ├─────────┤    ┌─────────┐
    │   bar   │ -> │  baroof │
    ├─────────┤    ├─────────┤
    │   foo   │    │   foo   │ => oof
    └─────────┘    └─────────┘
    

    Returns string

  • Gets the contents of the output buffer without clearing it.

    In human terms: returns the content of the top-most buffer

    ┌─────────┐
    │   oof   │
    ├─────────┤
    │   bar   │
    ├─────────┤
    │   foo   │ => "oof"
    └─────────┘
    

    Returns string

  • Return the nesting level of the output buffering mechanism

    Returns number

  • Turn on Output Buffering (specifying an optional output handler).

    Returns boolean

Generated using TypeDoc