UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

59 lines (58 loc) 1.62 kB
"use strict"; import { BaseConnectionPoint } from "./_Base"; import { ParamType } from "../../../../poly/ParamType"; export var EventConnectionPointType = /* @__PURE__ */ ((EventConnectionPointType2) => { EventConnectionPointType2["BASE"] = "base"; EventConnectionPointType2["DRAG"] = "drag"; EventConnectionPointType2["KEYBOARD"] = "keyboard"; EventConnectionPointType2["MOUSE"] = "mouse"; EventConnectionPointType2["POINTER"] = "pointer"; return EventConnectionPointType2; })(EventConnectionPointType || {}); export const EVENT_CONNECTION_POINT_TYPES = [ "base" /* BASE */, "drag" /* DRAG */, "keyboard" /* KEYBOARD */, "mouse" /* MOUSE */, "pointer" /* POINTER */ ]; export class EventConnectionPoint extends BaseConnectionPoint { constructor(_name, _type, _event_listener) { super(_name, _type); this._name = _name; this._type = _type; this._event_listener = _event_listener; } type() { return this._type; } get param_type() { return ParamType.FLOAT; } are_types_matched(src_type, dest_type) { if (dest_type == "base" /* BASE */) { return true; } else { return src_type == dest_type; } } get event_listener() { return this._event_listener; } // get param_type(): IConnectionPointTypeToParamTypeMap[T] { // return ConnectionPointTypeToParamTypeMap[this._type]; // } // get init_value() { // return this._init_value; // } toJSON() { return this._json = this._json || this._createJSON(); } _createJSON() { return { name: this._name, type: this._type, isArray: false }; } }