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



Defined in: [src/core/JsonUnifier.ts:39](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L39)

## 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:306](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L306)

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:235](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L235)

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

##### Returns [#returns-2]

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

***

### canvasOperation [#canvasoperation]

#### Get Signature [#get-signature-2]

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

Defined in: [src/core/JsonUnifier.ts:319](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L319)

Registered handler for generic canvas-wide operations (e.g. clear).

##### Returns [#returns-3]

(`operation`) => `void`

***

### effectOperation [#effectoperation]

#### Get Signature [#get-signature-3]

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

Defined in: [src/core/JsonUnifier.ts:293](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L293)

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

##### Returns [#returns-4]

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

***

### getConditionalStep [#getconditionalstep]

#### Get Signature [#get-signature-4]

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

Defined in: [src/core/JsonUnifier.ts:358](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L358)

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

##### Returns [#returns-5]

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

***

### getLogichValue [#getlogichvalue]

#### Get Signature [#get-signature-5]

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

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

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

##### Returns [#returns-6]

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

***

### imageContainerOperation [#imagecontaineroperation]

#### Get Signature [#get-signature-6]

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

Defined in: [src/core/JsonUnifier.ts:201](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L201)

##### Returns [#returns-7]

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

***

### imageOperation [#imageoperation]

#### Get Signature [#get-signature-7]

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

Defined in: [src/core/JsonUnifier.ts:165](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L165)

Registered handler for ImageSprite show/edit/remove operations.

##### Returns [#returns-8]

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

***

### loadAssets [#loadassets]

#### Get Signature [#get-signature-8]

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

Defined in: [src/core/JsonUnifier.ts:137](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L137)

Registered handler for loading/lazy-loading assets.

##### Returns [#returns-9]

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

***

### narrationOperation [#narrationoperation]

#### Get Signature [#get-signature-9]

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

Defined in: [src/core/JsonUnifier.ts:280](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L280)

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

##### Returns [#returns-10]

(`operation`) => `void`

***

### setInitialStorageValue [#setinitialstoragevalue]

#### Get Signature [#get-signature-10]

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

Defined in: [src/core/JsonUnifier.ts:267](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L267)

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

##### Returns [#returns-11]

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

***

### setStorageValue [#setstoragevalue]

#### Get Signature [#get-signature-11]

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

Defined in: [src/core/JsonUnifier.ts:251](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L251)

Registered handler for setting a storage value during label execution.

##### Returns [#returns-12]

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

***

### soundOperation [#soundoperation]

#### Get Signature [#get-signature-12]

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

Defined in: [src/core/JsonUnifier.ts:150](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L150)

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

##### Returns [#returns-13]

(`operation`) => `void`

***

### textOperation [#textoperation]

#### Get Signature [#get-signature-13]

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

Defined in: [src/core/JsonUnifier.ts:216](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L216)

Registered handler for Text show/edit/remove operations.

##### Returns [#returns-14]

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

***

### videoOperation [#videooperation]

#### Get Signature [#get-signature-14]

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

Defined in: [src/core/JsonUnifier.ts:184](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L184)

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

##### Returns [#returns-15]

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

## Methods [#methods]

### init() [#init]

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

Defined in: [src/core/JsonUnifier.ts:47](https://github.com/DRincs-Productions/pixi-vn-json/blob/c3fc7ababe09c261f3130ab586feb49b5a221ace/src/core/JsonUnifier.ts#L47)

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`>

###### canvasOperation? [#canvasoperation-1]

(`operation`) => `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-16]

`void`
