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



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

Defined in: [src/handlers/interfaces/ReplaceHandler.ts:11](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/handlers/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.
