import { ReflectUtils } from "@dooboostore/core/reflect/ReflectUtils";
const ADD_EVENT_LISTENER_METADATA_KEY = Symbol("simple-web-component:add-event-listener");
function addEventListener(arg1, arg2) {
  return (target, propertyKey, descriptor) => {
    const constructor = target.constructor;
    const options = typeof arg1 === "string" ? { type: arg1, query: arg2 } : arg1;
    let listeners = ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);
    if (!listeners) {
      listeners = [];
      ReflectUtils.defineMetadata(ADD_EVENT_LISTENER_METADATA_KEY, listeners, constructor);
    }
    listeners.push({ options, propertyKey });
  };
}
const getAddEventListenerMetadata = (target) => {
  const constructor = target instanceof Function ? target : target.constructor;
  return ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);
};
export {
  ADD_EVENT_LISTENER_METADATA_KEY,
  addEventListener,
  getAddEventListenerMetadata
};
//# sourceMappingURL=addEventListener.js.map
