UNPKG

@drincs/pixi-vn-json

Version:

Pixi'VN can be integrated with JSON files to create a visual novel.

45 lines (42 loc) 1.9 kB
import { LabelAbstract, LabelProps, StepLabelPropsType, StepLabelType } from '@drincs/pixi-vn'; import PixiVNJsonLabelStep from '../interface/PixiVNJsonLabelStep.js'; import { PixiVNJsonOperation } from '../interface/PixiVNJsonOperations.js'; import '../PixiVNJsonConditionalStatements-CdkmXvpt.js'; import '../interface/PixiVNJsonCanvas.js'; import '../interface/PixiVNJsonCanvasEffect.js'; import '../interface/PixiVNJsonCanvasTicker.js'; import '../interface/PixiVNJsonMediaTransiotions.js'; import '../interface/PixiVNJsonInput.js'; import '../interface/PixiVNJsonSound.js'; type LabelJsonOptions = { /** * Function that converts a string to a {@link PixiVNJsonOperation}. * If is a special operation you can return undefined and can run the operation. */ operationStringConvert?: (value: string, step: PixiVNJsonLabelStep, props: StepLabelPropsType | {}) => Promise<PixiVNJsonOperation | undefined>; /** * If true and a dialog is empty or has only spaces, {@link PixiVNJsonLabelStep.goNextStep} will be set to true. */ skipEmptyDialogs?: boolean; }; declare class LabelJson<T extends {} = {}> extends LabelAbstract<LabelJson<T>, T> { /** * @param id is the id of the label * @param steps is the list of steps that the label will perform * @param props is the properties of the label */ constructor(id: string, steps: (PixiVNJsonLabelStep | (() => PixiVNJsonLabelStep))[], props?: LabelProps<LabelJson<T>>, options?: LabelJsonOptions); private _steps; /** * Get the steps of the label. */ get steps(): StepLabelType<T>[]; private operationStringConvert?; private skipEmptyDialogs; getStepSha1(index: number): string | undefined; private getDialogueText; private getDialogue; private getChoices; private stepConverter; } export { type LabelJsonOptions, LabelJson as default };