UNPKG

@drincs/pixi-vn

Version:

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

36 lines (33 loc) 1.4 kB
import CanvasEvent from '../classes/CanvasEvent.mjs'; import CanvasBase from '../classes/canvas/CanvasBase.mjs'; import { EventIdType } from '../types/EventIdType.mjs'; import '../types/CanvasEventNamesType.mjs'; import 'pixi.js'; import '../interface/canvas/ICanvasBaseMemory.mjs'; /** * Canvas Event Register */ declare const registeredEvents: { [name: EventIdType]: typeof CanvasEvent<CanvasEventNamesType>; }; /** * Is a decorator that register a event in the game. * Is a required decorator for use the event in the game. * Thanks to this decoration the game has the possibility of updating the events to the latest modification and saving the game. * @param name is th identifier of the event, by default is the name of the class * @returns */ declare function eventDecorator(name?: EventIdType): (target: typeof CanvasEvent<any>) => void; /** * Get an event by the id. * @param eventId The id of the event. * @returns The event type. */ declare function getEventTypeById<T = typeof CanvasEvent<CanvasBase<any>>>(eventId: EventIdType): T | undefined; /** * Get an event instance by the id. * @param eventId The id of the event. * @returns The event instance. */ declare function getEventInstanceById<T = CanvasEvent<CanvasBase<any>>>(eventId: EventIdType): T | undefined; export { eventDecorator as default, getEventInstanceById, getEventTypeById, registeredEvents };