# Class MainOutput

BaseOutput

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

#### Hierarchy (view full)

- BaseOutput
  - MainOutput

- Defined in MainOutput.ts:11

#####
Index

### Constructors

constructor

### Properties

_closeCb
_context
_flushQ
_items
_open
_output
_pending
_pos
_result

### Accessors

length

### Methods

_addSpot
_closeSpot
_hasPending
_munchItems
add
sendToMunchy
stringify

## Constructors

### constructor

- new MainOutput(): MainOutput

- #### Returns MainOutput

  Overrides BaseOutput.constructor

  - Defined in MainOutput.ts:12

## Properties

### _closeCb

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

#### Type declaration

- - (...args): any

  - #### Parameters

    - `Rest` ...args: any[]

    #### Returns any

Inherited from BaseOutput._closeCb

- Defined in BaseOutput.ts:24

### _context

_context: any

Inherited from BaseOutput._context

- Defined in BaseOutput.ts:33

### _flushQ

_flushQ: any

Inherited from BaseOutput._flushQ

- Defined in BaseOutput.ts:32

### _items

_items: any[]

Array to hold items in the output

Inherited from BaseOutput._items

- Defined in BaseOutput.ts:18

### _open

_open: boolean

Boolean to indicate if output is still open for more

Inherited from BaseOutput._open

- Defined in BaseOutput.ts:22

### _output

_output: any

Inherited from BaseOutput._output

- Defined in BaseOutput.ts:31

### _pending

_pending: number

number of pending spots in the output

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

Inherited from BaseOutput._pending

- Defined in BaseOutput.ts:30

### _pos

_pos: number

Inherited from BaseOutput._pos

- Defined in BaseOutput.ts:23

### _result

_result: any

Inherited from BaseOutput._result

- Defined in BaseOutput.ts:34

## Accessors

### length

- get length(): number

- length

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

  #### Returns number

  number of items in the output

  Inherited from BaseOutput.length

  - Defined in BaseOutput.ts:61

## Methods

### _addSpot

- _addSpot(data): number

- #### Parameters

  - data: any

  #### Returns number

  - Defined in MainOutput.ts:17

### _closeSpot

- _closeSpot(x): void

- #### Parameters

  - x: any

  #### Returns void

  - Defined in MainOutput.ts:23

### _hasPending

- _hasPending(): boolean

- #### Returns boolean

  - Defined in MainOutput.ts:28

### _munchItems

- _munchItems(munchy): void

- #### Parameters

  - munchy: any

  #### Returns void

  Inherited from BaseOutput._munchItems

  - Defined in BaseOutput.ts:87

### add

- add(data): number

- 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

  Inherited from BaseOutput.add

  - Defined in BaseOutput.ts:48

### sendToMunchy

- sendToMunchy(munchy, done): void

- 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

  Inherited from BaseOutput.sendToMunchy

  - Defined in BaseOutput.ts:107

### stringify

- stringify(): string

- convert the output into a single string

  #### Returns string

  the output as a string

  Inherited from BaseOutput.stringify

  - Defined in BaseOutput.ts:70