fix:fix typo
This commit is contained in:
+4
-4
@@ -116,7 +116,7 @@ module.exports = {
|
||||
*/
|
||||
emplaceListener: function (eventName, callback, priority = this.EventPriority.Normal, pluginName = getPluginName()) {
|
||||
if (typeof callback !== "function") throw new Error("callback must be a function!");
|
||||
const /** @type {number} */ eventId = ll.importss("GMLIB_Event_API", "emplaceListener")(pluginName, eventName, priority);
|
||||
const /** @type {number} */ eventId = ll.imports("GMLIB_Event_API", "emplaceListener")(pluginName, eventName, priority);
|
||||
if (eventId === -1) throw new Error(`Event ${eventName} creation failed!`);
|
||||
ll.exports((...data) => {
|
||||
let /** @type {boolean} */ result = typeof (data.slice(-1)[0]) === "boolean" ? data.pop() : false;
|
||||
@@ -146,7 +146,7 @@ module.exports = {
|
||||
* @param {boolean}
|
||||
*/
|
||||
removeListener: function (eventId) {
|
||||
const result = ll.importss("GMLIB_Event_API", "removeListener")(eventId);
|
||||
const result = ll.imports("GMLIB_Event_API", "removeListener")(eventId);
|
||||
if (result) {
|
||||
for (let [eventName, eventIds] of Object.entries(this.mEventData)) {
|
||||
this.mEventData[eventName] = eventIds.filter(id => id !== eventId);
|
||||
@@ -162,7 +162,7 @@ module.exports = {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
hasListener: function (eventId) {
|
||||
return ll.importss("GMLIB_Event_API", "hasListener")(eventId);
|
||||
return ll.imports("GMLIB_Event_API", "hasListener")(eventId);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -171,7 +171,7 @@ module.exports = {
|
||||
* @returns {number?}
|
||||
*/
|
||||
getListenerPriority: function (eventId) {
|
||||
const priority = ll.importss("GMLIB_Event_API", "getListenerPriority")(eventId);
|
||||
const priority = ll.imports("GMLIB_Event_API", "getListenerPriority")(eventId);
|
||||
return priority === -1 ? undefined : priority;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user