yoni-mcscripts-lib
Version:
为 Minecraft Script API 中的部分接口创建了 wrapper,并提供简单的事件管理器和任务管理器,另附有一些便于代码编写的一些小工具。
39 lines (38 loc) • 1.31 kB
TypeScript
export function getIdentifierInfo(identifier: any): {
id: string;
name: string;
namespace: string | null;
};
/**
* @deprecated 废弃,等待重写
*/
export const events: {};
/**
* @deprecated 废弃,不再使用,请使用新的 {@link import("./v2/EventRegistry").EventRegistry}。另外,如果你使用了此LegacyEvent中的自定义事件,webpack打包或者类似的操作将无法完成。
*/
export class Types {
static register(identifier: any, eventType: any): void;
static registerNamespace(namespace: any, namespaceEventTypes: any): void;
/**
* @param {String} 事件的identifer
* @returns {Boolean} 事件是否存在且已移除
*/
static unregister(identifier: any): boolean;
static hasNamespace(namespace: any): boolean;
static has(identifier: any): any;
/**
* @param {String} 事件的identifer
* @returns 事件的示例,如不存在返回null
*/
static get(identifier: any): any;
static getEventTypes(): Map<any, any>;
static getAll(): Generator<any, void, any>;
}
/**
* @deprecated 废弃,等待重写
*/
export class EventRegisterListener {
static add(eventTypeIdentifier: any, callback: any): void;
static register(eventType: any): Promise<void>;
}
export { Types as EventTypes };