UNPKG

@drincs/pixi-vn

Version:

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

79 lines (76 loc) 3.03 kB
import { ChoiceMenuOptionsType } from '../types/ChoiceMenuOptionsType.mjs'; import CharacterBaseModel from '../classes/CharacterBaseModel.mjs'; import DialogueHistory from '../interface/DialogueHistory.mjs'; import DialogueBaseModel from '../classes/DialogueBaseModel.mjs'; import '../classes/ChoiceMenuOption.mjs'; import '../types/LabelIdType.mjs'; import '../types/StorageElementType.mjs'; import '../classes/Label.mjs'; import '../types/StepLabelType.mjs'; import '@drincs/pixi-vn/dist/override'; import '../classes/LabelAbstract.mjs'; import '../types/StepHistoryDataType.mjs'; import '../interface/LabelProps.mjs'; import '../types/CloseType.mjs'; import '../types/LabelRunModeType.mjs'; import '../interface/CharacterBaseModelProps.mjs'; import '../classes/StoredClassModel.mjs'; import '../types/HistoryChoiceMenuOption.mjs'; /** * Set the dialogue to be shown in the game * @param text Text of the dialogue * @example * ```typescript * setDialogue("Hello World") * setDialogue({ * character: "character", * text: "Hello World" * }) * setDialogue(new DialogueBaseModel("Hello World", character)) * ``` */ declare function setDialogue<TCharacter extends CharacterBaseModel = CharacterBaseModel, TDialogue extends DialogueBaseModel = DialogueBaseModel>(props: { character: string | TCharacter; text: string | string[]; } | string | string[] | TDialogue): void; /** * Get the dialogue to be shown in the game * @returns Dialogue to be shown in the game */ declare function getDialogue<T extends DialogueBaseModel = DialogueBaseModel>(): T | undefined; /** * Clear the dialogue to be shown in the game */ declare function clearDialogue(): void; /** * Set the options to be shown in the game * @param options Options to be shown in the game * @example * ```typescript * setChoiceMenuOptions([ * new ChoiceMenuOption("Events Test", EventsTestLabel, {}), * new ChoiceMenuOption("Show Image Test", ShowImageTest, { image: "imageId" }, "call"), * new ChoiceMenuOption("Ticker Test", TickerTestLabel, {}), * new ChoiceMenuOption("Tinting Test", TintingTestLabel, {}, "jump"), * new ChoiceMenuOption("Base Canvas Element Test", BaseCanvasElementTestLabel, {}) * ]) * ``` */ declare function setChoiceMenuOptions(options: ChoiceMenuOptionsType<any>): void; /** * Get the options to be shown in the game * @returns Options to be shown in the game */ declare function getChoiceMenuOptions<TChoice extends ChoiceMenuOptionsType = ChoiceMenuOptionsType<{ [key: string | number | symbol]: any; }>>(): TChoice | undefined; /** * Clear the options to be shown in the game */ declare function clearChoiceMenuOptions(): void; /** * Get the history of the dialogues * @returns the history of the dialogues */ declare function getDialogueHistory<T extends DialogueBaseModel = DialogueBaseModel>(): DialogueHistory<T>[]; export { clearChoiceMenuOptions, clearDialogue, getChoiceMenuOptions, getDialogue, getDialogueHistory, setChoiceMenuOptions, setDialogue };