# Class TagTemplate

Holds supporting and execution information and data for a template of tags

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

#####
Index

### Constructors

constructor

### Properties

_processor
_tagOpCodes
_templateDir
_templateTags
_tokenHandlers

### Methods

_findTokenIndex
findTokensById
findTokensByStr
getTag
getTagOpCode
handleSubTemplate
initTagOpCode

## Constructors

### constructor

- new TagTemplate(options): TagTemplate

- #### Parameters

  - options: {
    processor: RenderProcessor;
    templateDir?: string;
    templateTags: any[];
    tokenHandlers?: Function | Function[];
    }

    - ##### processor: RenderProcessor

      template tag processor for generating rendering steps

    - ##### `Optional` templateDir?: string

      directory where the template file resides

    - ##### templateTags: any[]

      template tags

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

      initial token handlers

  #### Returns TagTemplate

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

## Properties

### _processor

_processor: RenderProcessor

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

### _tagOpCodes

_tagOpCodes: any[]

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

### _templateDir

_templateDir: string

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

### _templateTags

_templateTags: any[]

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

### _tokenHandlers

_tokenHandlers: Function[]

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

## Methods

### _findTokenIndex

- _findTokenIndex(id?, str?, index?, instance?, msg?): any

- #### Parameters

  - `Optional` id: string
  - `Optional` str: string | RegExp
  - `Optional` index: number
  - `Optional` instance: number
  - `Optional` msg: string

  #### Returns any

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

### findTokensById

- findTokensById(id, count?): any[]

- #### Parameters

  - id: any
  - `Optional` count: number

  #### Returns any[]

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

### findTokensByStr

- findTokensByStr(matcher, count?): any[]

- Find a literal token in the template by matching its str

  #### Parameters

  - matcher: any

    a string or a RegExp to match token's str

  - `Optional` count: number

  #### Returns any[]

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

### getTag

- getTag(index): any

- Returns a template tag

  #### Parameters

  - index: number

    index of the tag in the template tags array

  #### Returns any

  template tag

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

### getTagOpCode

- getTagOpCode(index): any

- Get a execution step opcode for the template tag at index

  #### Parameters

  - index: number

    index of the tag in the template tags array

  #### Returns any

  template tag exec step opcode

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

### handleSubTemplate

- handleSubTemplate(step, templateTags): any

- Handle a sub template returned by executing a step

  #### Parameters

  - step: any

    the step that was executed

  - templateTags: any[]

    the template tags returned

  #### Returns any

  new step for executing the sub template tags

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

### initTagOpCode

- initTagOpCode(): void

- Pre-initialize execution step opcode for the template tags

  #### Returns void

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