@drincs/pixi-vn
Version:
Pixi'VN is a npm package that provides various features for creating visual novels.
58 lines (55 loc) • 1.67 kB
text/typescript
import { StorageElementType } from '../types/StorageElementType.cjs';
import CharacterInterface from '../interface/CharacterInterface.cjs';
type DialogueProps = {
/**
* 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
* narration.dialogue = new Dialogue("Hello World", character)
* ```
*/
declare class Dialogue<TCharacter extends CharacterInterface = CharacterInterface> {
/**
* @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 | DialogueProps, 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(): DialogueProps;
}
export { Dialogue as default };