# Type Alias: ReplaceHandler (/jsdoc/pixi-vn-json/index/type-aliases/ReplaceHandler)



\> **ReplaceHandler** = (`key`) => `string` | `undefined`

Defined in: [src/translator/interfaces/ReplaceHandler.ts:11](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/translator/interfaces/ReplaceHandler.ts#L11)

A handler function invoked for each `[key]` token found in the text that passes the
[ReplaceHandlerOptions.validation](/jsdoc/pixi-vn-json/index/type-aliases/ReplaceHandlerOptions#validation) check.

## Parameters [#parameters]

### key [#key]

`string`

The content found inside the square brackets (without the brackets themselves).
For example, for the token `[john]` the key is `"john"`.

## Returns [#returns]

`string` | `undefined`

The string to substitute in place of `[key]`, or `undefined` to leave the token unchanged.
