Buckets:
ktongue/docker_container / simsite /frontend /node_modules /three-stdlib /controls /EventDispatcher.cjs
| ; | |
| var __defProp = Object.defineProperty; | |
| var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | |
| var __publicField = (obj, key, value) => { | |
| __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); | |
| return value; | |
| }; | |
| Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); | |
| class EventDispatcher { | |
| constructor() { | |
| // not defined in @types/three | |
| __publicField(this, "_listeners"); | |
| } | |
| /** | |
| * Adds a listener to an event type. | |
| * @param type The type of event to listen to. | |
| * @param listener The function that gets called when the event is fired. | |
| */ | |
| addEventListener(type, listener) { | |
| if (this._listeners === void 0) | |
| this._listeners = {}; | |
| const listeners = this._listeners; | |
| if (listeners[type] === void 0) { | |
| listeners[type] = []; | |
| } | |
| if (listeners[type].indexOf(listener) === -1) { | |
| listeners[type].push(listener); | |
| } | |
| } | |
| /** | |
| * Checks if listener is added to an event type. | |
| * @param type The type of event to listen to. | |
| * @param listener The function that gets called when the event is fired. | |
| */ | |
| hasEventListener(type, listener) { | |
| if (this._listeners === void 0) | |
| return false; | |
| const listeners = this._listeners; | |
| return listeners[type] !== void 0 && listeners[type].indexOf(listener) !== -1; | |
| } | |
| /** | |
| * Removes a listener from an event type. | |
| * @param type The type of the listener that gets removed. | |
| * @param listener The listener function that gets removed. | |
| */ | |
| removeEventListener(type, listener) { | |
| if (this._listeners === void 0) | |
| return; | |
| const listeners = this._listeners; | |
| const listenerArray = listeners[type]; | |
| if (listenerArray !== void 0) { | |
| const index = listenerArray.indexOf(listener); | |
| if (index !== -1) { | |
| listenerArray.splice(index, 1); | |
| } | |
| } | |
| } | |
| /** | |
| * Fire an event type. | |
| * @param event The event that gets fired. | |
| */ | |
| dispatchEvent(event) { | |
| if (this._listeners === void 0) | |
| return; | |
| const listeners = this._listeners; | |
| const listenerArray = listeners[event.type]; | |
| if (listenerArray !== void 0) { | |
| event.target = this; | |
| const array = listenerArray.slice(0); | |
| for (let i = 0, l = array.length; i < l; i++) { | |
| array[i].call(this, event); | |
| } | |
| event.target = null; | |
| } | |
| } | |
| } | |
| exports.EventDispatcher = EventDispatcher; | |
| //# sourceMappingURL=EventDispatcher.cjs.map | |
Xet Storage Details
- Size:
- 2.57 kB
- Xet hash:
- 7a672b80af473ea7a84f538c43bd1c3cd712e9dffcf715d0a6174265d3084ac5
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.