UNPKG

@drincs/pixi-vn

Version:

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

41 lines (38 loc) 1.35 kB
import CharacterBaseModel from '../classes/CharacterBaseModel.mjs'; import '../interface/CharacterBaseModelProps.mjs'; import '../classes/StoredClassModel.mjs'; declare const registeredCharacters: { [id: string]: CharacterBaseModel; }; /** * Is a function that saves the character. If the character already exists, it will be overwritten. * @param character is the character to save * @returns * @example * ```typescript * export const liam = new CharacterBaseModel('liam', { name: 'Liam'}); * export const alice = new CharacterBaseModel('alice', { name: 'Alice'}); * saveCharacter([liam, alice]); * ``` */ declare function saveCharacter<T extends CharacterBaseModel = CharacterBaseModel>(character: T | T[]): void; /** * is a function that returns the character by the id * @param id is the id of the character * @returns the character * @example * ```typescript * const liam = getCharacterById('liam'); * ``` */ declare function getCharacterById<T extends CharacterBaseModel>(id: string): T | undefined; /** * is a function that returns all characters * @returns all characters * @example * ```typescript * const allCharacters = getAllCharacters(); * ``` */ declare function getAllCharacters<T extends CharacterBaseModel>(): T[]; export { getAllCharacters, getCharacterById, registeredCharacters, saveCharacter };