@drincs/pixi-vn
Version:
Pixi'VN is a npm package that provides various features for creating visual novels.
38 lines (35 loc) • 1.58 kB
TypeScript
import { LabelIdType } from '../types/LabelIdType.js';
import Label from '../classes/Label.js';
import { StepLabelType } from '../types/StepLabelType.js';
import LabelProps from '../interface/LabelProps.js';
import LabelJson from '../classes/LabelJson.js';
import LabelAbstract from '../classes/LabelAbstract.js';
import '@drincs/pixi-vn/dist/override';
import '../types/StepLabelJsonType.js';
import '../types/StorageElementType.js';
import '../types/LabelRunModeType.js';
import '../types/StepHistoryDataType.js';
declare const registeredLabels: {
[key: LabelIdType]: (LabelAbstract<any> | Label<any> | LabelJson<any>);
};
/**
* Creates a new label and registers it in the system.
* **This function must be called at least once at system startup to register the label, otherwise the system cannot be used.**
* @param id The id of the label, it must be unique
* @param steps The steps of the label
* @param props The properties of the label
* @returns The created label
*/
declare function newLabel<T extends {} = {}>(id: LabelIdType, steps: StepLabelType<T>[] | (() => StepLabelType<T>[]), props?: Omit<LabelProps<Label<T>>, "choiseIndex">): Label<T>;
/**
* Gets a label by its id
* @param id The id of the label
* @returns The label or undefined if it does not exist
*/
declare function getLabelById<T = Label<any>>(id: LabelIdType): T | undefined;
/**
* Saves a label in the system
* @param label The label to be saved
*/
declare function saveLabel<T extends LabelAbstract<any>>(label: T): void;
export { getLabelById, newLabel, registeredLabels, saveLabel };