UNPKG

@drincs/pixi-vn

Version:

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

60 lines (57 loc) 1.81 kB
import CharacterBaseModel from './CharacterBaseModel.mjs'; import { StorageElementType } from '../types/StorageElementType.mjs'; import '../interface/CharacterBaseModelProps.mjs'; import './StoredClassModel.mjs'; type DialogueData = { /** * The text of the dialogue. */ text: string; /** * The id of the character that is speaking. */ character?: string; /** * Other parameters that can be stored in the dialogue. */ oltherParams?: Record<string | number | symbol, StorageElementType>; }; /** * Base class for all dialogue models. * You can extend this class, but it is not reccomended. You can use the oltherParams property to store any other data you need. * @example * ```typescript * setDialogue(new DialogueBaseModel("Hello World", character)) * ``` */ declare class DialogueBaseModel<TCharacter extends CharacterBaseModel = CharacterBaseModel> implements DialogueData { /** * @param text The text of the dialogue. * @param character The id of the character that is speaking. * @param oltherParams Other parameters that can be stored in the dialogue. */ constructor(text: string | DialogueData, character?: string | TCharacter, oltherParams?: { [key: string]: StorageElementType; }); /** * The text of the dialogue. */ text: string; /** * The id of the character that is speaking. */ character?: string; /** * Other parameters that can be stored in the dialogue. */ oltherParams: { [key: string]: StorageElementType; }; /** * Export the dialogue to a DialogueBaseData object. * * @returns The data of the dialogue. */ export(): DialogueData; } export { type DialogueData, DialogueBaseModel as default };