# Class: JsonUnifier (/jsdoc/pixi-vn-json/core/classes/JsonUnifier)



Defined in: [src/core/JsonUnifier.ts:38](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L38)

Constructors [#constructors]

Constructor [#constructor]

\> **new JsonUnifier**(): `JsonUnifier`

Returns [#returns]

`JsonUnifier`

Accessors [#accessors]

animateOperation [#animateoperation]

Get Signature [#get-signature]

\> **get** `static` **animateOperation**(): (`operation`) => `void`

Defined in: [src/core/JsonUnifier.ts:303](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L303)

Registered handler for keyframe animation operations.

Returns [#returns-1]

(`operation`) => `void`

***

canvasElementOperation [#canvaselementoperation]

Get Signature [#get-signature-1]

\> **get** `static` **canvasElementOperation**(): (`operation`) => `Promise`\<`void`>

Defined in: [src/core/JsonUnifier.ts:232](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L232)

Registered handler for generic canvas-element edit/remove operations.

Returns [#returns-2]

(`operation`) => `Promise`\<`void`>

***

effectOperation [#effectoperation]

Get Signature [#get-signature-2]

\> **get** `static` **effectOperation**(): (`operation`) => `Promise`\<`void`>

Defined in: [src/core/JsonUnifier.ts:290](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L290)

Registered handler for canvas visual effects (e.g. shake).

Returns [#returns-3]

(`operation`) => `Promise`\<`void`>

***

getConditionalStep [#getconditionalstep]

Get Signature [#get-signature-3]

\> **get** `static` **getConditionalStep**(): (`originalStep`, `props?`) => [`PixiVNJsonLabelStep`](/jsdoc/pixi-vn-json/index/type-aliases/PixiVNJsonLabelStep)

Defined in: [src/core/JsonUnifier.ts:342](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L342)

Registered handler that resolves a label step's `conditionalStep` field.

Returns [#returns-4]

(`originalStep`, `props?`) => [`PixiVNJsonLabelStep`](/jsdoc/pixi-vn-json/index/type-aliases/PixiVNJsonLabelStep)

***

getLogichValue [#getlogichvalue]

Get Signature [#get-signature-4]

\> **get** `static` **getLogichValue**(): \<`T`>(`value`, `props?`) => `T` | `undefined`

Defined in: [src/core/JsonUnifier.ts:326](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L326)

Registered handler that evaluates a JSON logic expression to a plain value.

Returns [#returns-5]

\<`T`>(`value`, `props?`) => `T` | `undefined`

***

imageContainerOperation [#imagecontaineroperation]

Get Signature [#get-signature-5]

\> **get** `static` **imageContainerOperation**(): (`operation`) => `Promise`\<`void`>

Defined in: [src/core/JsonUnifier.ts:198](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L198)

Returns [#returns-6]

(`operation`) => `Promise`\<`void`>

***

imageOperation [#imageoperation]

Get Signature [#get-signature-6]

\> **get** `static` **imageOperation**(): (`operation`) => `Promise`\<`void`>

Defined in: [src/core/JsonUnifier.ts:162](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L162)

Registered handler for ImageSprite show/edit/remove operations.

Returns [#returns-7]

(`operation`) => `Promise`\<`void`>

***

loadAssets [#loadassets]

Get Signature [#get-signature-7]

\> **get** `static` **loadAssets**(): (`origin`) => `void` | `Promise`\<`void`>

Defined in: [src/core/JsonUnifier.ts:134](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L134)

Registered handler for loading/lazy-loading assets.

Returns [#returns-8]

(`origin`) => `void` | `Promise`\<`void`>

***

narrationOperation [#narrationoperation]

Get Signature [#get-signature-8]

\> **get** `static` **narrationOperation**(): (`operation`) => `void`

Defined in: [src/core/JsonUnifier.ts:277](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L277)

Registered handler for narration operations (input requests, dialogue resets).

Returns [#returns-9]

(`operation`) => `void`

***

setInitialStorageValue [#setinitialstoragevalue]

Get Signature [#get-signature-9]

\> **get** `static` **setInitialStorageValue**(): (`value`, `props?`) => `void`

Defined in: [src/core/JsonUnifier.ts:264](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L264)

Registered handler for setting a default (initial) storage value at import time.

Returns [#returns-10]

(`value`, `props?`) => `void`

***

setStorageValue [#setstoragevalue]

Get Signature [#get-signature-10]

\> **get** `static` **setStorageValue**(): (`value`, `props?`) => `void`

Defined in: [src/core/JsonUnifier.ts:248](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L248)

Registered handler for setting a storage value during label execution.

Returns [#returns-11]

(`value`, `props?`) => `void`

***

soundOperation [#soundoperation]

Get Signature [#get-signature-11]

\> **get** `static` **soundOperation**(): (`operation`) => `void`

Defined in: [src/core/JsonUnifier.ts:147](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L147)

Registered handler for sound play/stop/pause/resume/edit operations.

Returns [#returns-12]

(`operation`) => `void`

***

textOperation [#textoperation]

Get Signature [#get-signature-12]

\> **get** `static` **textOperation**(): (`operation`) => `Promise`\<`void`>

Defined in: [src/core/JsonUnifier.ts:213](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L213)

Registered handler for Text show/edit/remove operations.

Returns [#returns-13]

(`operation`) => `Promise`\<`void`>

***

videoOperation [#videooperation]

Get Signature [#get-signature-13]

\> **get** `static` **videoOperation**(): (`operation`) => `Promise`\<`void`>

Defined in: [src/core/JsonUnifier.ts:181](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L181)

Registered handler for VideoSprite show/edit/remove/pause/resume operations.

Returns [#returns-14]

(`operation`) => `Promise`\<`void`>

Methods [#methods]

init() [#init]

\> `static` **init**(`options`): `void`

Defined in: [src/core/JsonUnifier.ts:46](https://github.com/DRincs-Productions/pixi-vn-json/blob/336c45bc1f677c3b088aac058f0a457afc7cf32e/src/core/JsonUnifier.ts#L46)

Registers the operation handlers that pixi-vn-json will delegate to at runtime.
Call this once at application startup (e.g. via [init](#init)) before importing any labels.

All parameters are optional except `setInitialStorageValue`, which is required because
it must be available for initial-operation processing during label import.

Parameters [#parameters]

options [#options]

animateOperation? [#animateoperation-1]

(`operation`) => `void`

canvasElementOperation? [#canvaselementoperation-1]

(`operation`) => `Promise`\<`void`>

effectOperation? [#effectoperation-1]

(`operation`) => `Promise`\<`void`>

getConditionalStep? [#getconditionalstep-1]

(`originalStep`, `props?`) => [`PixiVNJsonLabelStep`](/jsdoc/pixi-vn-json/index/type-aliases/PixiVNJsonLabelStep)

getLogichValue? [#getlogichvalue-1]

\<`T`>(`value`, `props?`) => `T` | `undefined`

imageContainerOperation? [#imagecontaineroperation-1]

(`operation`) => `Promise`\<`void`>

imageOperation? [#imageoperation-1]

(`operation`) => `Promise`\<`void`>

loadAssets? [#loadassets-1]

(`origin`) => `void` | `Promise`\<`void`>

narrationOperation? [#narrationoperation-1]

(`operation`) => `void`

setInitialStorageValue [#setinitialstoragevalue-1]

(`value`, `props?`) => `void`

setStorageValue? [#setstoragevalue-1]

(`value`, `props?`) => `void`

soundOperation? [#soundoperation-1]

(`operation`) => `void`

textOperation? [#textoperation-1]

(`operation`) => `Promise`\<`void`>

videoOperation? [#videooperation-1]

(`operation`) => `Promise`\<`void`>

Returns [#returns-15]

`void`
