# Class TagRenderer

TagRenderer

A simple renderer for template from ES6 template literals

- Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:9

#####
Index

### Constructors

constructor

### Properties

_handlerContext
_handlersMap
_options
_processor
_template
_tokenHandlers
_tokenIdLookupMap
_tokens

### Methods

_initializeTokenHandlers
addTokenIds
initializeRenderer
lookupTokenHandler
registerTokenIds
render

## Constructors

### constructor

- new TagRenderer(options): TagRenderer

- #### Parameters

  - options: {
    insertTokenIds?: boolean;
    routeOptions?: any;
    templateTags: any[];
    tokenHandlers?: Function | Function[];
    }

    - ##### `Optional` insertTokenIds?: boolean

    - ##### `Optional` routeOptions?: any

    - ##### templateTags: any[]

    - ##### `Optional` tokenHandlers?: Function | Function[]

  #### Returns TagRenderer

  - Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:18

## Properties

### _handlerContext

_handlerContext: any

- Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:12

### _handlersMap

_handlersMap: {}

#### Type declaration

- Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:13

### _options

_options: any

- Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:10

### _processor

_processor: RenderProcessor

- Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:15

### _template

_template: TagTemplate

- Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:17

### _tokenHandlers

_tokenHandlers: any[]

- Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:11

### _tokenIdLookupMap

_tokenIdLookupMap: {}

#### Type declaration

- Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:14

### _tokens

_tokens: any[]

- Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:16

## Methods

### _initializeTokenHandlers

- _initializeTokenHandlers(handlers): void

- #### Parameters

  - handlers: any

  #### Returns void

  - Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:58

### addTokenIds

- addTokenIds(name, handler, priority?): void

- Add a handler to provide token IDs for the template but will not invoke it yet

  #### Parameters

  - name: string

    name of token ids

  - handler: Function

    handler function

  - `Optional` priority: number

    higher value === higher priority

  #### Returns void

  - Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:48

### initializeRenderer

- initializeRenderer(reset?): void

- Initialize to get ready to do rendering

  #### Parameters

  - `Optional` reset: boolean

    if true, will run even if already initialized

  #### Returns void

  - Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:28

### lookupTokenHandler

- lookupTokenHandler(tk): any

- Lookup the handler of a tag

  #### Parameters

  - tk: any

    tag

  #### Returns any

  - Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:33

### registerTokenIds

- registerTokenIds(name, uniqSym, handler, priority?): void

- Register a handler to provide token IDs for the template

  #### Parameters

  - name: string

    name of token ids

  - uniqSym: symbol

    unique symbol identifier

  - handler: Function

    handler function

  - `Optional` priority: number

    higher value === higher priority

  #### Returns void

  - Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:57

### render

- render(options): Promise<any>

- Render the template

  #### Parameters

  - options: any

    render context options

  #### Returns Promise<any>

  render context

  - Defined in packages/xarc-tag-renderer/dist/tag-renderer.d.ts:40