UNPKG

gs-events

Version:

事件分发器(同步)

1,322 lines 126 kB
[ { "__docId__": 1, "kind": "external", "name": "Infinity", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Infinity", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 2, "kind": "external", "name": "NaN", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~NaN", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 3, "kind": "external", "name": "undefined", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~undefined", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 4, "kind": "external", "name": "null", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~null", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 5, "kind": "external", "name": "Object", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Object", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 6, "kind": "external", "name": "object", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~object", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 7, "kind": "external", "name": "Function", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Function", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 8, "kind": "external", "name": "function", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~function", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 9, "kind": "external", "name": "Boolean", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Boolean", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 10, "kind": "external", "name": "boolean", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~boolean", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 11, "kind": "external", "name": "Symbol", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Symbol", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 12, "kind": "external", "name": "Error", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Error", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 13, "kind": "external", "name": "EvalError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~EvalError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 14, "kind": "external", "name": "InternalError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~InternalError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 15, "kind": "external", "name": "RangeError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~RangeError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 16, "kind": "external", "name": "ReferenceError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~ReferenceError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 17, "kind": "external", "name": "SyntaxError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~SyntaxError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 18, "kind": "external", "name": "TypeError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~TypeError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 19, "kind": "external", "name": "URIError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~URIError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 20, "kind": "external", "name": "Number", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Number", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 21, "kind": "external", "name": "number", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~number", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 22, "kind": "external", "name": "Date", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Date", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 23, "kind": "external", "name": "String", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~String", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 24, "kind": "external", "name": "string", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~string", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 25, "kind": "external", "name": "RegExp", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~RegExp", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 26, "kind": "external", "name": "Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 27, "kind": "external", "name": "Int8Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Int8Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 28, "kind": "external", "name": "Uint8Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Uint8Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 29, "kind": "external", "name": "Uint8ClampedArray", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Uint8ClampedArray", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 30, "kind": "external", "name": "Int16Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Int16Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 31, "kind": "external", "name": "Uint16Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Uint16Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 32, "kind": "external", "name": "Int32Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Int32Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 33, "kind": "external", "name": "Uint32Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Uint32Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 34, "kind": "external", "name": "Float32Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Float32Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 35, "kind": "external", "name": "Float64Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Float64Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 36, "kind": "external", "name": "Map", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Map", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 37, "kind": "external", "name": "Set", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Set", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 38, "kind": "external", "name": "WeakMap", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~WeakMap", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 39, "kind": "external", "name": "WeakSet", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~WeakSet", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 40, "kind": "external", "name": "ArrayBuffer", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~ArrayBuffer", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 41, "kind": "external", "name": "DataView", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~DataView", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 42, "kind": "external", "name": "JSON", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~JSON", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 43, "kind": "external", "name": "Promise", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Promise", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 44, "kind": "external", "name": "Generator", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Generator", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 45, "kind": "external", "name": "GeneratorFunction", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~GeneratorFunction", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 46, "kind": "external", "name": "Reflect", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Reflect", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 47, "kind": "external", "name": "Proxy", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Proxy", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 48, "kind": "file", "name": "src/CustomEvent.js", "content": "/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/// @Copyright ~2018 ☜Samlv9☞ and other contributors\n/// @MIT-LICENSE | 1.0.0 | https://api.guless.com/\n/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/// }|\n/// }|\n/// }|   へ    /| \n/// _______ _______ ______ }| / │   / /\n/// / ___ | |_ __ \\ .' ____ '. }| │ Z _,< /   /`ヽ\n/// | (__ \\_| | |__) | | (____) | }| │     ヽ   /  〉\n/// '.___`-. | __ / '_.____. | }| Y     `  /  /\n/// |`\\____) | _| | \\ \\_ | \\____| | }| イ● 、 ●  ⊂⊃〈  /\n/// |_______.' |____| |___| \\______,' }| ()  v    | \〈\n/// |=========================================\\|  >ー 、_  ィ  │ //\n/// |> LESS IS MORE || / へ   / ノ<|\\\n/// `=========================================/| ヽ_ノ  (_/  │//\n/// }| 7       |/\n/// }| >―r ̄ ̄`ー―_`\n/// }|\n/// }|\n/// Permission is hereby granted, free of charge, to any person obtaining a copy\n/// of this software and associated documentation files (the \"Software\"), to deal\n/// in the Software without restriction, including without limitation the rights\n/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n/// copies of the Software, and to permit persons to whom the Software is\n/// furnished to do so, subject to the following conditions:\n///\n/// The above copyright notice and this permission notice shall be included in all\n/// copies or substantial portions of the Software.\n///\n/// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n/// THE SOFTWARE.\nimport Event from \"./Event\";\n\n/**\n * 定义携带自定义数据的事件对象。\n * @see {@link Event}\n * @since 1.0.9\n */\nexport default class CustomEvent extends Event {\n /**\n * 创建一个支持自定义数据的事件对象。\n * \n * @param {String|Symbol} type - 事件类型。\n * @param {any} [data=null] - 指定附加到事件对象的数据。\n * @param {Boolean} [bubbles=false] - 指示该事件是否参与冒泡行为。\n * @param {Boolean} [cancelable=true] - 指示该事件是否可以取消默认行为。\n * @since 1.0.9\n */\n constructor( type, data = null, bubbles = false, cancelable = true ) {\n super(type, bubbles, cancelable);\n this._data = data;\n }\n \n /**\n * 重置事件状态(允许外部复用事件对象)。\n * \n * @param {String|Symbol} type - 事件类型。\n * @param {any} [data=null] - 指定附加到事件对象的数据。\n * @param {Boolean} [bubbles=false] - 指示该事件是否参与冒泡行为。\n * @param {Boolean} [cancelable=true] - 指示该事件是否可以取消默认行为。\n * @returns {this}\n * @since 1.0.11\n */\n reset( type, data = null, bubbles = false, cancelable = false ) {\n super.reset(type, bubbles, cancelable);\n this._data = data;\n return this;\n }\n \n /**\n * 获取事件对象的自定义数据。\n * @type {any}\n * @since 1.0.9\n */\n get data() {\n return this._data;\n }\n}", "static": true, "longname": "/Users/samlv9/Developer/GULESS/events/src/CustomEvent.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 49, "kind": "class", "name": "CustomEvent", "memberof": "src/CustomEvent.js", "static": true, "longname": "src/CustomEvent.js~CustomEvent", "access": "public", "export": true, "importPath": "gs-events/src/CustomEvent.js", "importStyle": "CustomEvent", "description": "定义携带自定义数据的事件对象。", "see": [ "{@link Event}" ], "lineNumber": 45, "since": "1.0.9", "interface": false, "extends": [ "src/Event.js~Event" ] }, { "__docId__": 50, "kind": "constructor", "name": "constructor", "memberof": "src/CustomEvent.js~CustomEvent", "generator": false, "async": false, "static": false, "longname": "src/CustomEvent.js~CustomEvent#constructor", "access": "public", "description": "创建一个支持自定义数据的事件对象。", "lineNumber": 55, "since": "1.0.9", "params": [ { "nullable": null, "types": [ "String", "Symbol" ], "spread": false, "optional": false, "name": "type", "description": "事件类型。" }, { "nullable": null, "types": [ "any" ], "spread": false, "optional": true, "defaultValue": "null", "defaultRaw": null, "name": "data", "description": "指定附加到事件对象的数据。" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "bubbles", "description": "指示该事件是否参与冒泡行为。" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "true", "defaultRaw": true, "name": "cancelable", "description": "指示该事件是否可以取消默认行为。" } ] }, { "__docId__": 51, "kind": "member", "name": "_data", "memberof": "src/CustomEvent.js~CustomEvent", "static": false, "longname": "src/CustomEvent.js~CustomEvent#_data", "access": "private", "description": null, "lineNumber": 57, "undocument": true, "ignore": true, "type": { "types": [ "*" ] } }, { "__docId__": 52, "kind": "method", "name": "reset", "memberof": "src/CustomEvent.js~CustomEvent", "generator": false, "async": false, "static": false, "longname": "src/CustomEvent.js~CustomEvent#reset", "access": "public", "description": "重置事件状态(允许外部复用事件对象)。", "lineNumber": 70, "since": "1.0.11", "unknown": [ { "tagName": "@returns", "tagValue": "{this}" } ], "params": [ { "nullable": null, "types": [ "String", "Symbol" ], "spread": false, "optional": false, "name": "type", "description": "事件类型。" }, { "nullable": null, "types": [ "any" ], "spread": false, "optional": true, "defaultValue": "null", "defaultRaw": null, "name": "data", "description": "指定附加到事件对象的数据。" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "bubbles", "description": "指示该事件是否参与冒泡行为。" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "true", "defaultRaw": true, "name": "cancelable", "description": "指示该事件是否可以取消默认行为。" } ], "return": { "nullable": null, "types": [ "this" ], "spread": false, "description": "" } }, { "__docId__": 54, "kind": "get", "name": "data", "memberof": "src/CustomEvent.js~CustomEvent", "generator": false, "async": false, "static": false, "longname": "src/CustomEvent.js~CustomEvent#data", "access": "public", "description": "获取事件对象的自定义数据。", "lineNumber": 81, "since": "1.0.9", "type": { "nullable": null, "types": [ "any" ], "spread": false, "description": null } }, { "__docId__": 55, "kind": "file", "name": "src/Event.js", "content": "/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/// @Copyright ~2018 ☜Samlv9☞ and other contributors\n/// @MIT-LICENSE | 1.0.0 | https://api.guless.com/\n/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/// }|\n/// }|\n/// }|   へ    /| \n/// _______ _______ ______ }| / │   / /\n/// / ___ | |_ __ \\ .' ____ '. }| │ Z _,< /   /`ヽ\n/// | (__ \\_| | |__) | | (____) | }| │     ヽ   /  〉\n/// '.___`-. | __ / '_.____. | }| Y     `  /  /\n/// |`\\____) | _| | \\ \\_ | \\____| | }| イ● 、 ●  ⊂⊃〈  /\n/// |_______.' |____| |___| \\______,' }| ()  v    | \〈\n/// |=========================================\\|  >ー 、_  ィ  │ //\n/// |> LESS IS MORE || / へ   / ノ<|\\\n/// `=========================================/| ヽ_ノ  (_/  │//\n/// }| 7       |/\n/// }| >―r ̄ ̄`ー―_`\n/// }|\n/// }|\n/// Permission is hereby granted, free of charge, to any person obtaining a copy\n/// of this software and associated documentation files (the \"Software\"), to deal\n/// in the Software without restriction, including without limitation the rights\n/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n/// copies of the Software, and to permit persons to whom the Software is\n/// furnished to do so, subject to the following conditions:\n///\n/// The above copyright notice and this permission notice shall be included in all\n/// copies or substantial portions of the Software.\n///\n/// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n/// THE SOFTWARE.\nimport IEventDispatcher from \"./IEventDispatcher\";\nimport EventPhase from \"./EventPhase\";\n\n/**\n * 定义 {@link EventDispatcher} 派发的事件对象。\n * @see {@link EventDispatcher}\n * @since 1.0.0\n */\nexport default class Event {\n /**\n * 创建一个事件对象。\n * \n * @param {String|Symbol} type - 事件类型。\n * @param {Boolean} [bubbles=false] - 指示该事件是否参与冒泡行为。\n * @param {Boolean} [cancelable=true] - 指示该事件是否可以取消默认行为。\n * @since 1.0.0\n */\n constructor( type, bubbles = false, cancelable = true ) {\n /**\n * @type {String|Symbol}\n */\n this._type = type;\n \n /**\n * @type {Boolean}\n */\n this._bubbles = bubbles;\n \n /**\n * @type {Boolean}\n */\n this._cancelable = cancelable;\n \n /**\n * @type {IEventDispatcher}\n */\n this._target = null;\n \n /**\n * @type {IEventDispatcher}\n */\n this._currentTarget = null;\n \n /**\n * @type {EventPhase}\n */\n this._eventPhase = EventPhase.NONE;\n \n /**\n * @type {Boolean}\n */\n this._defaultPrevented = false;\n \n /**\n * @type {Boolean}\n */\n this._stopPropagation = false;\n \n /**\n * @type {Boolean}\n */\n this._stopImmediatePropagation = false;\n }\n \n /**\n * 获取事件类型。\n * @type {String|Symbol}\n * @since 1.0.0\n */\n get type() {\n return this._type\n }\n \n /**\n * 指示该事件是否参与冒泡行为。\n * @type {Boolean}\n * @since 1.0.0\n */\n get bubbles() {\n return this._bubbles;\n }\n \n /**\n * 指示该事件是否可以取消默认行为。\n * @type {Boolean}\n * @since 1.0.0\n */\n get cancelable() {\n return this._cancelable;\n }\n \n /**\n * 获取事件的目标对象。\n * @type {IEventDispatcher}\n * @since 1.0.0\n */\n get target() {\n return this._target;\n }\n \n /**\n * 获取事件的当前对象。\n * @type {IEventDispatcher}\n * @since 1.0.0\n */\n get currentTarget() {\n return this._currentTarget;\n }\n \n /**\n * 获取事件的当前阶段。\n * @type {EventPhase}\n * @since 1.0.0\n */\n get eventPhase() {\n return this._eventPhase;\n }\n \n /**\n * 指示该事件是否已经取消了默认行为。\n * @type {Boolean}\n * @since 1.0.0\n */\n get defaultPrevented() {\n return this._defaultPrevented;\n }\n \n /**\n * 重置事件状态(允许外部复用事件对象)。\n * \n * @param {String|Symbol} type - 事件类型。\n * @param {Boolean} [bubbles=false] - 指示该事件是否参与冒泡行为。\n * @param {Boolean} [cancelable=true] - 指示该事件是否可以取消默认行为。\n * @returns {this}\n * @since 1.0.11\n */\n reset( type, bubbles = false, cancelable = false ) {\n this._type = type;\n this._bubbles = bubbles;\n this._cancelable = cancelable;\n this._target = null;\n this._currentTarget = null;\n this._eventPhase = EventPhase.NONE;\n this._defaultPrevented = false;\n this._stopPropagation = false;\n this._stopImmediatePropagation = false;\n return this;\n }\n \n /**\n * 如果事件可以取消(`cancelable == true`)默认行为,则取消该事件的默认行为。\n * @see {@link Event#cancelable}\n * @since 1.0.0\n */\n preventDefault() {\n this._cancelable && (this._defaultPrevented = true);\n }\n \n /**\n * 停止事件冒泡,后续所有节点的侦听器都将不会收到该事件通知。\n * @see {@link EventDispatcher#dispatchEvent}\n * @since 1.0.0\n */\n stopPropagation() {\n this._stopPropagation = true;\n }\n \n /**\n * 立即停止事件冒泡,当前节点以及后续所有节点的侦听器都将不会收到该事件通知。\n * @see {@link EventDispatcher#dispatchEvent}\n * @since 1.0.0\n */\n stopImmediatePropagation() {\n this._stopPropagation = true;\n this._stopImmediatePropagation = true;\n }\n}", "static": true, "longname": "/Users/samlv9/Developer/GULESS/events/src/Event.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 56, "kind": "class", "name": "Event", "memberof": "src/Event.js", "static": true, "longname": "src/Event.js~Event", "access": "public", "export": true, "importPath": "gs-events/src/Event.js", "importStyle": "Event", "description": "定义 {@link EventDispatcher} 派发的事件对象。", "see": [ "{@link EventDispatcher}" ], "lineNumber": 46, "since": "1.0.0", "interface": false }, { "__docId__": 57, "kind": "constructor", "name": "constructor", "memberof": "src/Event.js~Event", "generator": false, "async": false, "static": false, "longname": "src/Event.js~Event#constructor", "access": "public", "description": "创建一个事件对象。", "lineNumber": 55, "since": "1.0.0", "params": [ { "nullable": null, "types": [ "String", "Symbol" ], "spread": false, "optional": false, "name": "type", "description": "事件类型。" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "bubbles", "description": "指示该事件是否参与冒泡行为。" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "true", "defaultRaw": true, "name": "cancelable", "description": "指示该事件是否可以取消默认行为。" } ] }, { "__docId__": 58, "kind": "member", "name": "_type", "memberof": "src/Event.js~Event", "static": false, "longname": "src/Event.js~Event#_type", "access": "private", "description": "", "lineNumber": 59, "type": { "nullable": null, "types": [ "String", "Symbol" ], "spread": false, "description": null }, "ignore": true }, { "__docId__": 59, "kind": "member", "name": "_bubbles", "memberof": "src/Event.js~Event", "static": false, "longname": "src/Event.js~Event#_bubbles", "access": "private", "description": "", "lineNumber": 64, "type": { "nullable": null, "types": [ "Boolean" ], "spread": false, "description": null }, "ignore": true }, { "__docId__": 60, "kind": "member", "name": "_cancelable", "memberof": "src/Event.js~Event", "static": false, "longname": "src/Event.js~Event#_cancelable", "access": "private", "description": "", "lineNumber": 69, "type": { "nullable": null, "types": [ "Boolean" ], "spread": false, "description": null }, "ignore": true }, { "__docId__": 61, "kind": "member", "name": "_target", "memberof": "src/Event.js~Event", "static": false, "longname": "src/Event.js~Event#_target", "access": "private", "description": "", "lineNumber": 74, "type": { "nullable": null, "types": [ "IEventDispatcher" ], "spread": false, "description": null }, "ignore": true }, { "__docId__": 62, "kind": "member", "name": "_currentTarget", "memberof": "src/Event.js~Event", "static": false, "longname": "src/Event.js~Event#_currentTarget", "access": "private", "description": "", "lineNumber": 79, "type": { "nullable": null, "types": [ "IEventDispatcher" ], "spread": false, "description": null }, "ignore": true }, { "__docId__": 63, "kind": "member", "name": "_eventPhase", "memberof": "src/Event.js~Event", "static": false, "longname": "src/Event.js~Event#_eventPhase", "access": "private", "description": "", "lineNumber": 84, "type": { "nullable": null, "types": [ "EventPhase" ], "spread": false, "description": null }, "ignore": true }, { "__docId__": 64, "kind": "member", "name": "_defaultPrevented", "memberof": "src/Event.js~Event", "static": false, "longname": "src/Event.js~Event#_defaultPrevented", "access": "private", "description": "", "lineNumber": 89, "type": { "nullable": null, "types": [ "Boolean" ], "spread": false, "description": null }, "ignore": true }, { "__docId__": 65, "kind": "member", "name": "_stopPropagation", "memberof": "src/Event.js~Event", "static": false, "longname": "src/Event.js~Event#_stopPropagation", "access": "private", "description": "", "lineNumber": 94, "type": { "nullable": null, "types": [ "Boolean" ], "spread": false, "description": null }, "ignore": true }, { "__docId__": 66, "kind": "member", "name": "_stopImmediatePropagation", "memberof": "src/Event.js~Event", "static": false, "longname": "src/Event.js~Event#_stopImmediatePropagation", "access": "private", "description": "", "lineNumber": 99, "type": { "nullable": null, "types": [ "Boolean" ], "spread": false, "description": null }, "ignore": true }, { "__docId__": 67, "kind": "get", "name": "type", "memberof": "src/Event.js~Event", "generator": false, "async": false, "static": false, "longname": "src/Event.js~Event#type", "access": "public", "description": "获取事件类型。", "lineNumber": 107, "since": "1.0.0", "type": { "nullable": null, "types": [ "String", "Symbol" ], "spread": false, "description": null } }, { "__docId__": 68, "kind": "get", "name": "bubbles", "memberof": "src/Event.js~Event", "generator": false, "async": false, "static": false, "longname": "src/Event.js~Event#bubbles", "access": "public", "description": "指示该事件是否参与冒泡行为。", "lineNumber": 116, "since": "1.0.0", "type": { "nullable": null, "types": [ "Boolean" ], "spread": false, "description": null } }, { "__docId__": 69, "kind": "get", "name": "cancelable", "memberof": "src/Event.js~Event", "generator": false, "async": false, "static": false, "longname": "src/Event.js~Event#cancelable", "access": "public", "description": "指示该事件是否可以取消默认行为。", "lineNumber": 125, "since": "1.0.0", "type": { "nullable": null, "types": [ "Boolean" ], "spread": false, "description": null } }, { "__docId__": 70, "kind": "get", "name": "target", "memberof": "src/Event.js~Event", "generator": false, "async": false, "static": false, "longname": "src/Event.js~Event#target", "access": "public", "description": "获取事件的目标对象。", "lineNumber": 134, "since": "1.0.0", "type": { "nullable": null, "types": [ "IEventDispatcher" ], "spread": false, "description": null } }, { "__docId__": 71, "kind": "get", "name": "currentTarget", "memberof": "src/Event.js~Event", "generator": false, "async": false, "static": false, "longname": "src/Event.js~Event#currentTarget", "access": "public", "description": "获取事件的当前对象。", "lineNumber": 143, "since": "1.0.0", "type": { "nullable": null, "types": [ "IEventDispatcher" ], "spread": false, "description": null } }, { "__docId__": 72, "kind": "get", "name": "eventPhase", "memberof": "src/Event.js~Event", "generator": false, "async": false, "static": false, "longname": "src/Event.js~Event#eventPhase", "access": "public", "description": "获取事件的当前阶段。", "lineNumber": 152, "since": "1.0.0", "type": { "nullable": null, "types": [ "EventPhase" ], "spread": false, "description": null } }, { "__docId__": 73, "kind": "get", "name": "defaultPrevented", "memberof": "src/Event.js~Event", "generator": false, "async": false, "static": false, "longname": "src/Event.js~Event#defaultPrevented", "access": "public", "description": "指示该事件是否已经取消了默认行为。", "lineNumber": 161, "since": "1.0.0", "type": { "nullable": null, "types": [ "Boolean" ], "spread": false, "description": null } }, { "__docId__": 74, "kind": "method", "name": "reset", "memberof": "src/Event.js~Event", "generator": false, "async": false, "static": false, "longname": "src/Event.js~Event#reset", "access": "public", "description": "重置事件状态(允许外部复用事件对象)。", "lineNumber": 174, "since": "1.0.11", "unknown": [ { "tagName": "@returns", "tagValue": "{this}" } ], "params": [ { "nullable": null, "types": [ "String", "Symbol" ], "spread": false, "optional": false, "name": "type", "description": "事件类型。" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "bubbles", "description": "指示该事件是否参与冒泡行为。" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": true, "defaultValue": "true", "defaultRaw": true, "name": "cancelable", "description": "指示该事件是否可以取消默认行为。" } ], "return": { "nullable": null, "types": [ "this" ], "spread": false, "description": "" } }, { "__docId__": 84, "kind": "method", "name": "preventDefault", "memberof": "src/Event.js~Event", "generator": false, "async": false, "static": false, "longname": "src/Event.js~Event#preventDefault", "access": "public", "description": "如果事件可以取消(`cancelable == true`)默认行为,则取消该事件的默认行为。", "see": [ "{@link Event#cancelable}" ], "lineNumber": 192, "since": "1.0.0", "params": [], "return": null }, { "__docId__": 86, "kind": "method", "name": "stopPropagation", "memberof": "src/Event.js~Event", "generator": false, "async": false, "static": false, "longname": "src/Event.js~Event#stopPropagation", "access": "public", "description": "停止事件冒泡,后续所有节点的侦听器都将不会收到该事件通知。", "see": [ "{@link EventDispatcher#dispatchEvent}" ], "lineNumber": 201, "since": "1.0.0", "params": [], "return": null }, { "__docId__": 88, "kind": "method", "name": "stopImmediatePropagation", "memberof": "src/Event.js~Event", "generator": false, "async": false, "static": false, "longname": "src/Event.js~Event#stopImmediatePropagation", "access": "public", "description": "立即停止事件冒泡,当前节点以及后续所有节点的侦听器都将不会收到该事件通知。", "see": [ "{@link EventDispatcher#dispatchEvent}" ], "lineNumber": 210, "since": "1.0.0", "params": [], "return": null }, { "__docId__": 91, "kind": "file", "name": "src/EventDispatcher.js", "content": "/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/// @Copyright ~2018 ☜Samlv9☞ and other contributors\n/// @MIT-LICENSE | 1.0.0 | https://api.guless.com/\n/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n/// }|\n/// }|\n/// }|   へ    /| \n/// _______ _______ ______ }| / │   / /\n/// / ___ | |_ __ \\ .' ____ '. }| │ Z _,< /   /`ヽ\n/// | (__ \\_| | |__) | | (____) | }| │     ヽ   /  〉\n/// '.___`-. | __ / '_.____. | }| Y     `  /  /\n/// |`\\____) | _| | \\ \\_ | \\____| | }| イ● 、 ●  ⊂⊃〈  /\n/// |_______.' |____| |___| \\______,' }| ()  v    | \〈\n/// |=========================================\\|  >ー 、_  ィ  │ //\n/// |> LESS IS MORE || / へ   / ノ<|\\\n/// `=========================================/| ヽ_ノ  (_/  │//\n/// }| 7       |/\n/// }| >―r ̄ ̄`ー―_`\n/// }|\n/// }|\n/// Permission is hereby granted, free of charge, to any person obtaining a copy\n/// of this software and associated documentation files (the \"Software\"), to deal\n/// in the Software without restriction, including without limitation the rights\n/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n/// copies of the Software, and to permit persons to whom the Software is\n/// furnished to do so, subject to the following conditions:\n///\n/// The above copyright notice and this permission notice shall be included in all\n/// copies or substantial portions of the Software.\n///\n/// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n/// THE SOFTWARE.\nimport IEventDispatcher from \"./IEventDispatcher\";\nimport IEventListener from \"./IEventListener\";\nimport IEventListenerOptions from \"./IEventListenerOptions\";\nimport Event from \"./Event\";\nimport EventPhase from \"./EventPhase\";\nimport EventListener from \"./EventListener\";\n\n/**\n * 定义所有具备事件派发功能对象的基类。\n * @implements {IEventDispatcher}\n * @since 1.0.0\n */\nexport default class EventDispatcher /*< implements IEventDispatcher >*/ {\n /**\n * 创建一个事件派发器。\n * @param {IEventDispatcher} [target=null] - 指定派发器的代理目标对象。\n * @since 1.0.0\n */\n constructor( target = null ) {\n /**\n * @type {IEventDispatcher}\n */\n this._targetDispatcher = (target || this);\n \n /**\n * @type { {[type:String|Symbol]:Array<EventListener>} }\n */\n this._listenerRegister = {};\n \n /**\n * @type { {type:String|Symbol}: Boolean }\n */\n this._listenerLockers = {};\n \n /** 事件代理 */\n if ( this !== this._targetDispatcher ) {\n if ( this._targetDispatcher.hasEventListener || this._targetDispatcher.addEventListener || this._targetDispatcher.removeEventListener || this._targetDispatcher.dispatchEvent ) {\n throw new TypeError(\"无法为目标对象创建代理,因为其自身已经实现了一套事件系统。\");\n }\n \n this._targetDispatcher.addEventListener = this.addEventListener .bind(this);\n this._targetDispatcher.removeEventListener = this.removeEventListener .bind(this);\n this._targetDispatcher.hasEventListener = this.hasEventListener .bind(this);\n this._targetDispatcher.dispatchEvent = this.dispatchEvent .bind(this);\n this._targetDispatcher._dispatchToListeners = this._dispatchToListeners.bind(this);\n }\n }\n \n /**\n * 注册一个事件侦听器。\n * \n * 如果浏览器支持 {@link Symbol} 类型,则事件类型可以使用 {@link Symbol} 对象,这样可以防止\n * 你的事件被其他人意外的移除。\n * \n * 事件侦听器可以注册到派发事件的任何一个阶段,**捕获阶段**和**冒泡阶段**的侦听器是相互独立的。\n * 因此使用不同的 `useCapture` 值将注册不同的侦听器。同样移除的时候,也需要指定不同的 `useCapture` 值。 \n * \n * 事件处理函数默认的作用域为派发器(`EventDispatcher`)对象或者其代理的对象,通过设置 `options.scope` \n * 可以为事件处理函数指定作用域。但是如果注册的是一个实现了 {@link IEventListener} 接口的对象,则直接\n * 调用其 `handleEvent()` 方法处理事件,并且作用域始终指向该 `IEventListener` 对象。\n * \n * 通过指定 `options.once` 选项,可以指定侦听器在执行后,是否自动从列表中移除。\n * \n * 优先级高(`options.priority`)的侦听器会在派发事件时优先调用。相同优先级的情况会按照注册的先后\n * 顺序调用侦听器。分别使用不同的优先级注册相同的侦听器时,以最后一次注册的侦听器为准。\n * \n * @param {String|Symbol} type - 事件类型。\n * @param {Function|IEventListener} handler -