UNPKG

@drincs/pixi-vn

Version:

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

43 lines (40 loc) 1.7 kB
import { LabelIdType } from '../types/LabelIdType.cjs'; import { StepLabelType } from '../types/StepLabelType.cjs'; import LabelProps from '../interface/LabelProps.cjs'; import '@drincs/pixi-vn'; declare abstract class LabelAbstract<TLabel, TProps extends {} = {}> implements LabelProps<TLabel> { /** * @param id is the id of the label * @param props is the properties of the label */ constructor(id: LabelIdType, props?: LabelProps<TLabel>); private _id; /** * Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById} */ get id(): LabelIdType; /** * Get the steps of the label. */ abstract get steps(): StepLabelType<TProps>[]; /** * Get the sha1 of the step * @param index Index of the step */ abstract getStepSha1(index: number): string | undefined; /** * Get the corresponding steps number * @param externalStepSha1 * @returns Numer of corresponding steps, for example, if externalSteps is [ABC, DEF, GHI] and the steps of the label is [ABC, GHT], the result will be 1 */ protected getCorrespondingStepsNumber(externalStepSha1: string[]): number; private _onStepStart; get onStepStart(): ((stepIndex: number, label: TLabel) => void | Promise<void>) | undefined; private _onLoadingLabel; get onLoadingLabel(): ((stepIndex: number, label: TLabel) => void | Promise<void>) | undefined; private _onStepEnd; get onStepEnd(): ((stepIndex: number, label: TLabel) => void | Promise<void>) | undefined; private _choiseIndex; get choiseIndex(): number | undefined; } export { LabelAbstract as default };