BaseOutput

This class defines the interface to receive HTML output from rendering a template

Hierarchy (view full)

Constructors

Properties

_closeCb: ((...args) => any)

Type declaration

    • (...args): any
    • Parameters

      • Rest ...args: any[]

      Returns any

_context: any
_flushQ: any
_items: any[]

Array to hold items in the output

_open: boolean

Boolean to indicate if output is still open for more

_output: any
_pending: number

number of pending spots in the output

A spot is a location in the output that can be independently expanded

_pos: number
_result: any

Accessors

  • get length(): number
  • length

    Get the number of items (data) added to the output

    Returns number

    number of items in the output

Methods

  • Parameters

    • munchy: any

    Returns void

  • add

    Add some data to the output. The data can be another output.

    Parameters

    • data: any

      data to add to the output

    Returns number

    number of data added to the output

  • Generate a stream from the output by sending it to a munchy

    Info about munchy: https://www.npmjs.com/package/munchy

    Parameters

    • munchy: any

      A munchy object

    • done: ((...args) => any)

      callback after output has been consumed by munchy

        • (...args): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    Returns void

  • convert the output into a single string

    Returns string

    the output as a string