@drincs/pixi-vn
Version:
Pixi'VN is a npm package that provides various features for creating visual novels.
69 lines (66 loc) • 2.37 kB
TypeScript
import { StorageElementType } from '../types/StorageElementType.js';
import ExportedStorage from '../interface/export/ExportedStorage.js';
declare class GameStorageManager {
private static storage;
private constructor();
static get keysSystem(): {
/**
* The key of the current dialogue memory
*/
CURRENT_DIALOGUE_MEMORY_KEY: string;
/**
* The key of the last dialogue added in the step memory
*/
LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY: string;
/**
* The key of the current menu options memory
*/
CURRENT_MENU_OPTIONS_MEMORY_KEY: string;
/**
* The key of the last menu options added in the step memory
*/
LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY: string;
/**
* The key of the characters memory
*/
CHARACTER_CATEGORY_KEY: string;
/**
* The key of the flags memory
*/
FLAGS_CATEGORY_KEY: string;
/**
* This variable is used to add the next dialog text into the current dialog memory.
* This value was added to introduce Ink Glue functionality https://github.com/inkle/ink/blob/master/Documentation/WritingWithInk.md#glue
*/
ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY: string;
};
/**
* Set a variable in the storage
* @param key The key of the variable
* @param value The value of the variable. If undefined, the variable will be removed
* @returns
*/
static setVariable(key: string, value: StorageElementType): void;
/**
* Get a variable from the storage
* @param key The key of the variable
* @returns The value of the variable. If the variable does not exist, it will return undefined
*/
static getVariable<T extends StorageElementType>(key: string): T | undefined;
/**
* Remove a variable from the storage
* @param key The key of the variable
* @returns
*/
static removeVariable(key: string): void;
/**
* Clear the storage and the oidsUsed
* @returns
*/
static clear(): void;
static exportJson(): string;
static export(): ExportedStorage;
static importJson(dataString: string): void;
static import(data: object): void;
}
export { GameStorageManager as default };