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



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

Defined in: node_modules/@drincs/pixi-vn-json/dist/translator.d.ts:16

A handler function invoked for each `[key]` token found in the text that passes the
[ReplaceHandlerOptions.validation](/pixi-vn-ink/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.
