# Class: NarrationManagerStatic (/jsdoc/pixi-vn/index/classes/NarrationManagerStatic)



Defined in: [src/narration/NarrationManagerStatic.ts:27](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L27)

## Properties [#properties]

### \_stepCounter [#_stepcounter]

\> `static&#x60; **\_stepCounter**: `number` = `0`

Defined in: [src/narration/NarrationManagerStatic.ts:202](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L202)

***

### choiceMadeTemp [#choicemadetemp]

\> `static` **choiceMadeTemp**: `number` | `undefined` = `undefined`

Defined in: [src/narration/NarrationManagerStatic.ts:29](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L29)

***

### lastHistoryStep [#lasthistorystep]

\> `static` **lastHistoryStep**: `Omit`\<[`HistoryStep`](/jsdoc/pixi-vn/index/interfaces/HistoryStep), `"diff"`> | `null` = `null`

Defined in: [src/narration/NarrationManagerStatic.ts:30](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L30)

***

### onLabelStarting? [#onlabelstarting]

\> `static` `optional` &#x2A;*onLabelStarting?**: (`labelId`, `props`, `options`, `defaultStart`) => [`StepLabelResultType`](/jsdoc/pixi-vn/index/type-aliases/StepLabelResultType) | `Promise`\<[`StepLabelResultType`](/jsdoc/pixi-vn/index/type-aliases/StepLabelResultType)>

Defined in: [src/narration/NarrationManagerStatic.ts:369](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L369)

Is a function that will be executed every time a label is about to be started, either via
`call` or `jump` (this includes labels started through a choice of type `"call"` or `"jump"`).

By default (when this is not set), the label is started immediately, exactly like before this
hook existed. If you set it, you take control: call `defaultStart()` yourself whenever you want
the label to actually run (right away, or later, e.g. from a subsequent `next()`-like action in
your template). Until `defaultStart()` is called, nothing about the label happens: it is not
added to the history and no step of it runs.

#### Parameters [#parameters]

##### labelId [#labelid]

`string`

##### props [#props]

`StepLabelProps`

##### options [#options]

###### choiceMade? [#choicemade]

`number`

###### closeCurrentLabel? [#closecurrentlabel]

`boolean`

###### type [#type]

`string`

##### defaultStart [#defaultstart]

() => `Promise`\<[`StepLabelResultType`](/jsdoc/pixi-vn/index/type-aliases/StepLabelResultType)>

#### Returns [#returns]

[`StepLabelResultType`](/jsdoc/pixi-vn/index/type-aliases/StepLabelResultType) | `Promise`\<[`StepLabelResultType`](/jsdoc/pixi-vn/index/type-aliases/StepLabelResultType)>

***

### onLoadingLabel? [#onloadinglabel]

\> `static` `optional` &#x2A;*onLoadingLabel?**: (`stepId`, `label`) => `void` | `Promise`\<`void`>

Defined in: [src/narration/NarrationManagerStatic.ts:357](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L357)

#### Parameters [#parameters-1]

##### stepId [#stepid]

`number`

##### label [#label]

[`LabelAbstract`](/jsdoc/pixi-vn/index/classes/LabelAbstract)\<`any`>

#### Returns [#returns-1]

`void` | `Promise`\<`void`>

***

### onStepEnd? [#onstepend]

\> `static` `optional` &#x2A;*onStepEnd?**: (`stepId`, `label`) => `void` | `Promise`\<`void`>

Defined in: [src/narration/NarrationManagerStatic.ts:358](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L358)

#### Parameters [#parameters-2]

##### stepId [#stepid-1]

`number`

##### label [#label-1]

[`LabelAbstract`](/jsdoc/pixi-vn/index/classes/LabelAbstract)\<`any`>

#### Returns [#returns-2]

`void` | `Promise`\<`void`>

## Accessors [#accessors]

### \_currentLabel [#_currentlabel]

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

\> **get** `static&#x60; **\_currentLabel**(): [`Label`](/jsdoc/pixi-vn/index/classes/Label)\<\{ }> | `undefined`

Defined in: [src/narration/NarrationManagerStatic.ts:223](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L223)

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

[`Label`](/jsdoc/pixi-vn/index/classes/Label)\<\{ }> | `undefined`

***

### allChoicesMade [#allchoicesmade]

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

\> **get** `static` **allChoicesMade**(): `ChoicesMadeType`\[]

Defined in: [src/narration/NarrationManagerStatic.ts:187](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L187)

is a list of all choices made by the player during the progression of the steps.

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

`ChoicesMadeType`\[]

#### Set Signature [#set-signature]

\> **set** `static` **allChoicesMade**(`value`): `void`

Defined in: [src/narration/NarrationManagerStatic.ts:195](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L195)

##### Parameters [#parameters-3]

###### value [#value]

`ChoicesMadeType`\[]

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

`void`

***

### allOpenedLabels [#allopenedlabels]

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

\> **get** `static` **allOpenedLabels**(): `AllOpenedLabelsType`

Defined in: [src/narration/NarrationManagerStatic.ts:35](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L35)

is a list of all labels that have been opened during the progression of the steps.
the key is the label id and the biggest step opened.

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

`AllOpenedLabelsType`

#### Set Signature [#set-signature-1]

\> **set** `static` **allOpenedLabels**(`value`): `void`

Defined in: [src/narration/NarrationManagerStatic.ts:43](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L43)

##### Parameters [#parameters-4]

###### value [#value-1]

`AllOpenedLabelsType`

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

`void`

***

### currentLabelId [#currentlabelid]

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

\> **get** `static` **currentLabelId**(): `string` | `undefined`

Defined in: [src/narration/NarrationManagerStatic.ts:232](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L232)

currentLabelId is the current label id that occurred during the progression of the steps.

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

`string` | `undefined`

***

### currentLabelStepIndex [#currentlabelstepindex]

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

\> **get** `static` **currentLabelStepIndex**(): `number` | `null`

Defined in: [src/narration/NarrationManagerStatic.ts:242](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L242)

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

`number` | `null`

***

### onStepStart [#onstepstart]

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

\> **get** `static` **onStepStart**(): ((`stepId`, `label`) => `Promise`\<`void`\[]>) | `undefined`

Defined in: [src/narration/NarrationManagerStatic.ts:343](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L343)

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

((`stepId`, `label`) => `Promise`\<`void`\[]>) | `undefined`

#### Set Signature [#set-signature-2]

\> **set** `static` **onStepStart**(`value`): `void`

Defined in: [src/narration/NarrationManagerStatic.ts:337](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L337)

##### Parameters [#parameters-5]

###### value [#value-2]

(`stepId`, `label`) => `void` | `Promise`\<`void`>

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

`void`

***

### openedLabels [#openedlabels]

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

\> **get** `static` **openedLabels**(): [`OpenedLabel`](/jsdoc/pixi-vn/index/interfaces/OpenedLabel)\[]

Defined in: [src/narration/NarrationManagerStatic.ts:210](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L210)

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

[`OpenedLabel`](/jsdoc/pixi-vn/index/interfaces/OpenedLabel)\[]

#### Set Signature [#set-signature-3]

\> **set** `static` **openedLabels**(`value`): `void`

Defined in: [src/narration/NarrationManagerStatic.ts:213](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L213)

##### Parameters [#parameters-6]

###### value [#value-3]

[`OpenedLabel`](/jsdoc/pixi-vn/index/interfaces/OpenedLabel)\[]

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

`void`

***

### originalOpenedLabels [#originalopenedlabels]

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

\> **get** `static` **originalOpenedLabels**(): [`OpenedLabel`](/jsdoc/pixi-vn/index/interfaces/OpenedLabel)\[]

Defined in: [src/narration/NarrationManagerStatic.ts:217](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L217)

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

[`OpenedLabel`](/jsdoc/pixi-vn/index/interfaces/OpenedLabel)\[]

#### Set Signature [#set-signature-4]

\> **set** `static` **originalOpenedLabels**(`value`): `void`

Defined in: [src/narration/NarrationManagerStatic.ts:220](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L220)

##### Parameters [#parameters-7]

###### value [#value-4]

[`OpenedLabel`](/jsdoc/pixi-vn/index/interfaces/OpenedLabel)\[]

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

`void`

## Methods [#methods]

### addChoicesMade() [#addchoicesmade]

\> `static` **addChoicesMade**(`label`, `stepIndex`, `stepSha`, `choiceMade`): `void`

Defined in: [src/narration/NarrationManagerStatic.ts:269](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L269)

#### Parameters [#parameters-8]

##### label [#label-2]

`string`

##### stepIndex [#stepindex]

`number`

##### stepSha [#stepsha]

`string`

##### choiceMade [#choicemade-1]

`number`

#### Returns [#returns-16]

`void`

***

### addLabelHistory() [#addlabelhistory]

\> `static` **addLabelHistory**(`label`, `stepIndex`): `void`

Defined in: [src/narration/NarrationManagerStatic.ts:260](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L260)

Add a label to the history.

#### Parameters [#parameters-9]

##### label [#label-3]

`string`

The label to add to the history.

##### stepIndex [#stepindex-1]

`number`

The step index of the label.

#### Returns [#returns-17]

`void`

***

### getCurrentStepTimesCounter() [#getcurrentsteptimescounter]

\> `static` **getCurrentStepTimesCounter**(`nestedId?`): `number`

Defined in: [src/narration/NarrationManagerStatic.ts:110](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L110)

#### Parameters [#parameters-10]

##### nestedId? [#nestedid]

`string` = `""`

#### Returns [#returns-18]

`number`

***

### getCurrentStepTimesCounterData() [#getcurrentsteptimescounterdata]

\> `static` **getCurrentStepTimesCounterData**(`nestedId?`): `CurrentStepTimesCounterMemotyData` | `null`

Defined in: [src/narration/NarrationManagerStatic.ts:50](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L50)

#### Parameters [#parameters-11]

##### nestedId? [#nestedid-1]

`string` = `""`

#### Returns [#returns-19]

`CurrentStepTimesCounterMemotyData` | `null`

***

### getRandomNumber() [#getrandomnumber]

\> `static` **getRandomNumber**(`min`, `max`, `options?`): `number` | `undefined`

Defined in: [src/narration/NarrationManagerStatic.ts:126](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L126)

#### Parameters [#parameters-12]

##### min [#min]

`number`

##### max [#max]

`number`

##### options? [#options-1]

###### nestedId? [#nestedid-2]

`string`

###### onceOnly? [#onceonly]

`boolean`

#### Returns [#returns-20]

`number` | `undefined`

***

### increaseCurrentStepIndex() [#increasecurrentstepindex]

\> `static` **increaseCurrentStepIndex**(): `void`

Defined in: [src/narration/NarrationManagerStatic.ts:319](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L319)

Increase the current step index of the current label.

#### Returns [#returns-21]

`void`

***

### increaseStepCounter() [#increasestepcounter]

\> `static` **increaseStepCounter**(): `void`

Defined in: [src/narration/NarrationManagerStatic.ts:206](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L206)

Increase the last step index that occurred during the progression of the steps.

#### Returns [#returns-22]

`void`

***

### pushNewLabel() [#pushnewlabel]

\> `static` **pushNewLabel**(`label`): `void`

Defined in: [src/narration/NarrationManagerStatic.ts:301](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L301)

Add a label to the history.

#### Parameters [#parameters-13]

##### label [#label-4]

`string`

The label to add to the history.

#### Returns [#returns-23]

`void`

#### Throws [#throws]

when the label is not found in the registered labels.

***

### resetCurrentStepTimesCounter() [#resetcurrentsteptimescounter]

\> `static` **resetCurrentStepTimesCounter**(`nestedId?`): `void`

Defined in: [src/narration/NarrationManagerStatic.ts:161](https://github.com/DRincs-Productions/pixi-vn/blob/efc9536feda21bc17c50370f5e35fd8d8d88843a/src/narration/NarrationManagerStatic.ts#L161)

#### Parameters [#parameters-14]

##### nestedId? [#nestedid-3]

`string` = `""`

#### Returns [#returns-24]

`void`
