declare type EventHandler = (this: void, param: T) => void; declare interface NPC { /** * The ID of NPC, equivalent to offset in NPC list of current scene. */ id: number; /** * The type ID of NPC. */ npcType: number; /** * Position of NPC in X axis (as floating point, not internal fixed point representation). */ x: number; /** * Position of NPC in Y axis (as floating point, not internal fixed point representation). */ y: number; /** * Velocity of NPC in X axis (as floating point, not internal fixed point representation). */ velX: number; /** * Velocity of NPC in Y axis (as floating point, not internal fixed point representation). */ velY: number; /** * Alternate velocity of NPC in X axis (as floating point, not internal fixed point representation). */ velX2: number; /** * Alternate velocity of NPC in Y axis (as floating point, not internal fixed point representation). */ velY2: number; /** * Current action id (the one that can be set with void | null): void; /** * Registers an event handler called after all scripts are loaded. * @param event event name * @param handler event handler procedure */ function on(event: "init", handler: EventHandler): EventHandler; /** * Registers an event handler called on each tick. * @param event event name * @param handler event handler procedure */ function on(event: "tick", handler: EventHandler): EventHandler; function on(event: string, handler: EventHandler): EventHandler; }