@drincs/pixi-vn
Version:
Pixi'VN is a npm package that provides various features for creating visual novels.
33 lines (30 loc) • 1.34 kB
text/typescript
import { LabelIdType } from '../types/LabelIdType.cjs';
import Label from '../classes/Label.cjs';
import { StepLabelType } from '../types/StepLabelType.cjs';
import LabelProps from '../interface/LabelProps.cjs';
import LabelAbstract from '../classes/LabelAbstract.cjs';
import '@drincs/pixi-vn';
declare const registeredLabels: {
[key: LabelIdType]: LabelAbstract<any> | Label<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 };