@drincs/pixi-vn-json
Version:
Pixi'VN can be integrated with JSON files to create a visual novel.
44 lines (41 loc) • 1.95 kB
text/typescript
import { LabelAbstract, LabelProps, StepLabelPropsType, StepLabelType } from '@drincs/pixi-vn';
import PixiVNJsonLabelStep from '../interface/PixiVNJsonLabelStep.cjs';
import { PixiVNJsonOperation } from '../interface/PixiVNJsonOperations.cjs';
import '../PixiVNJsonConditionalStatements-CdkmXvpt.cjs';
import '../interface/PixiVNJsonCanvas.cjs';
import '../interface/PixiVNJsonCanvasEffect.cjs';
import '../interface/PixiVNJsonCanvasTicker.cjs';
import '../interface/PixiVNJsonMediaTransiotions.cjs';
import '../interface/PixiVNJsonInput.cjs';
import '../interface/PixiVNJsonSound.cjs';
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 steps(): StepLabelType<T>[];
get stepCount(): number;
getStepById(stepId: number): StepLabelType<T> | undefined;
private operationStringConvert?;
private skipEmptyDialogs;
getStepSha(index: number): string | undefined;
private getDialogueText;
private getDialogue;
private getChoices;
private stepConverter;
}
export { type LabelJsonOptions, LabelJson as default };