UNPKG

@drincs/pixi-vn

Version:

Pixi'VN is a npm package that provides various features for creating visual novels.

121 lines (118 loc) 3.7 kB
import deepDiff from 'deep-diff'; import { Difference } from 'microdiff'; import { IStoratedChoiceMenuOption } from '../classes/ChoiceMenuOption.cjs'; import { StorageElementType } from '../types/StorageElementType.cjs'; import ExportedCanvas from './export/ExportedCanvas.cjs'; import ExportedSounds from './export/ExportedSounds.cjs'; import OpenedLabel from './OpenedLabel.cjs'; import ExportedStorage from './export/ExportedStorage.cjs'; import { LabelIdType } from '../types/LabelIdType.cjs'; import Dialogue from '../classes/Dialogue.cjs'; import '../classes/Label.cjs'; import '../classes/LabelAbstract.cjs'; import '../types/StepLabelType.cjs'; import '@drincs/pixi-vn'; import './LabelProps.cjs'; import '../types/CloseType.cjs'; import '../types/LabelRunModeType.cjs'; import '../types/PauseTickerType.cjs'; import './canvas/memory/CanvasBaseItemMemory.cjs'; import './canvas/memory/ContainerMemory.cjs'; import 'pixi.js'; import '../types/ContainerChild.cjs'; import '../classes/canvas/CanvasBaseItem.cjs'; import './TickerHistory.cjs'; import '../types/TickerIdType.cjs'; import './TickerArgs.cjs'; import './TickersSequence.cjs'; import '../types/PauseType.cjs'; import '../types/RepeatType.cjs'; import './SoundOptions.cjs'; import '@pixi/sound'; import '../types/SoundFilterMemory.cjs'; import './CharacterInterface.cjs'; /** * AdditionalShaSpetsEnum is a enum that contains the additional sha1 values that can be inserted in the step sha1. */ declare enum AdditionalShaSpetsEnum { /** * If the creation of a step function sha was not successful, this value will be inserted. */ ERROR = "error", /** * If this story node was not added in the narrative but by the developer, this value will be inserted. */ DEVELOPER = "dev" } /** * IHistoryStep is a interface that contains the information of a step in the history. */ interface HistoryStepData { /** * The browser path that occurred during the progression of the steps. */ path: string; /** * The storage that occurred during the progression of the steps. */ storage: ExportedStorage; /** * The index of the label that occurred during the progression of the steps. */ labelIndex: number; /** * The canvas that occurred during the progression of the steps. */ canvas: ExportedCanvas; /** * The opened labels that occurred during the progression of the steps. */ openedLabels: OpenedLabel[]; /** * The sound data that occurred during the progression of the steps. */ sound: ExportedSounds; } interface HistoryStep<T extends Dialogue = Dialogue> { /** * The difference between the previous step and the current step. */ diff?: deepDiff.Diff<HistoryStepData, HistoryStepData>[] | Difference[]; /** * The label id of the current step. */ currentLabel?: LabelIdType; /** * The sha1 of the step function. */ stepSha1: string; /** * The index of the step in the history. */ index: number; /** * The data of the step of the label. */ labelStepIndex: number | null; /** * Dialogue to be shown in the game */ dialoge?: T; /** * List of choices asked of the player */ choices?: IStoratedChoiceMenuOption[]; /** * List of choices already made by the player */ alreadyMadeChoices?: number[]; /** * The input value of the player */ inputValue?: StorageElementType; /** * The choice made by the player */ choiceIndexMade?: number; } export { AdditionalShaSpetsEnum, type HistoryStepData, type HistoryStep as default };