export declare const NSEventCode = "var nsModuleExport = function(root,name,prototype)\r\n\t{\r\n\t\troot[name] = prototype;\r\n\t};\"use strict\";\r\nvar NSEvent = (function()\r\n{\r\n\tfunction NSEvent() \r\n\t{\r\n\t\tvar self = this;\r\n\t\tvar objEvents = {};\r\n\t\t\r\n\t\tvar addListener  = function(event, callback)\r\n\t\t{\r\n\t\t\tif (typeof callback !== 'function') \r\n\t\t\t{\r\n\t\t        console.error(\"The listener callback must be a function\");\r\n\t\t        return false;\r\n\t\t    }\r\n\t\t\tif (typeof event !== 'string') \r\n\t\t\t{\r\n\t\t        console.error(\"The event name must be a string\");\r\n\t\t        return false;\r\n\t\t    }\r\n\t\t\tif (!objEvents[event]) \r\n\t\t\t{\r\n\t\t\t\tobjEvents[event] = {listeners: []};\r\n\t\t    }\r\n\t\t\tobjEvents[event].listeners.push(callback);\r\n\t\t\treturn true;\r\n\t\t};\r\n\t\t\r\n\t\tvar removeListener = function(event, callback)\r\n\t\t{\r\n\t\t\tif (!objEvents[event]) \r\n\t\t\t{\r\n\t\t        console.error(\"The event: \" + event + \" does not exist\");\r\n\t\t        return false;\r\n\t\t    }\r\n\t\t\tvar filter = function(listener)\r\n\t\t\t{\r\n\t\t\t\treturn listener.toString() !== callback.toString(); \r\n\t\t\t};\r\n\t\t\tobjEvents[event].listeners = objEvents[event].listeners.filter(filter);\r\n\t\t\treturn true;\r\n\t\t};\r\n\t\t\r\n\t\tvar hasListener = function(event, callback)\r\n\t\t{\r\n\t\t\tif (!objEvents[event]) \r\n\t\t\t{\r\n\t\t        return false;\r\n\t\t    }\r\n\t\t\tvar filter = function(listener)\r\n\t\t\t{\r\n\t\t\t\treturn listener.toString() == callback.toString(); \r\n\t\t\t};\r\n\t\t\tvar tempListener = objEvents[event].listeners.filter(filter);\r\n\t\t\treturn !(!tempListener); \r\n\t\t};\r\n\t\t\r\n\t\tvar dispatch = function(event, details)\r\n\t\t{\r\n\t\t\tvar retValue = true;\r\n\t\t\tif (objEvents[event]) \r\n\t\t\t{\r\n\t\t\t\tfor(var index = 0;index < objEvents[event].listeners.length;index++)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar listener = objEvents[event].listeners[index];\r\n\t\t\t\t\tretValue = listener({type: event,details: details},details);\r\n\t\t\t\t\tif(retValue !== undefined && retValue !== null && retValue == false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t    }\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tconsole.log(\"The event: \" + event + \" does not exist\");\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t};\r\n\t\t\r\n\t\tself.addListener = addListener;\r\n\t\tself.removeListener = removeListener;\r\n\t\tself.hasListener = hasListener;\r\n\t\tself.dispatch = dispatch;\r\n\t};\r\n\t\r\n\treturn NSEvent;\r\n})();\r\nnsModuleExport(this,\"NSEvent\",NSEvent);";
