/* istanbul ignore next */
export const VegaEventManagerRuntimeMetricsPayloadDefinition = [
  {
    payloadKey: 'IS_SETSEMANTICS_METHOD_CALLED',
    payloadDescription: 'Indicate if the method setSemantics of public API VegaEventManager is called',
    /**
     * Indicate whether the method is collected when the method been called .
     *
     * @param {string} scope - The class name of public api
     * @param {string} methodName - The method name called by the public api
     * @returns {boolean} A boolean value
     */
    canAccept: (scope, methodName) => scope === 'VegaEventManager' && methodName === 'setSemantics',
    /**
     * The function checks if the method is been called.
     *
     * @returns {boolean} A boolean value
     */
    payloadValue: () => {
      return true;
    },
  },
  {
    payloadKey: 'IS_GETSEMANTICS_METHOD_CALLED',
    payloadDescription: 'Indicate if the method getSemantics of public API VegaEventManager is called',
    /**
     * Indicate whether the method is collected when the method been called .
     *
     * @param {string} scope - The class name of public api
     * @param {string} methodName - The method name called by the public api
     * @returns {boolean} A boolean value
     */
    canAccept: (scope, methodName) => scope === 'VegaEventManager' && methodName === 'getSemantics',
    /**
     * The function checks if the method is been called.
     *
     * @returns {boolean} A boolean value
     */
    payloadValue: () => {
      return true;
    },
  },
  {
    payloadKey: 'IS_GETENABLEDEVENTIDSBYCOMPONENT_METHOD_CALLED',
    payloadDescription: 'Indicate if the method getEnabledEventIdsByComponent of public API VegaEventManager is called',
    /**
     * Indicate whether the method is collected when the method been called .
     *
     * @param {string} scope - The class name of public api
     * @param {string} methodName - The method name called by the public api
     * @returns {boolean} A boolean value
     */
    canAccept: (scope, methodName) => scope === 'VegaEventManager' && methodName === 'getEnabledEventIdsByComponent',
    /**
     * The function checks if the method is been called.
     *
     * @returns {boolean} A boolean value
     */
    payloadValue: () => {
      return true;
    },
  },
  {
    payloadKey: 'globalEventIsNative',
    payloadDescription: 'Indicate if the vega components will emit events without the vega prefix',
    /**
     * Indicate whether the method is collected when the method been called .
     *
     * @param {string} scope - The class name of public api
     * @param {string} methodName - The method name called by the public api
     * @returns {boolean} A boolean value
     */
    canAccept: (scope, methodName) => scope === 'VegaEventManager' && methodName === 'setSemantics',
    /**
     * The function checks if the method is been called.
     *
     * @param {unknown[]} args - The args parameter is an object
     * @returns {boolean} A boolean value
     */
    payloadValue: (args) => {
      const config = args;
      return !!(config.global && config.global.namespace === 'native');
    },
  },
  {
    payloadKey: 'eventOfSpecificComponentsIsNative',
    payloadDescription: 'Indicate if the vega components will emit events with the vega prefix, but special components will emit events without vega prefix',
    /**
     * Indicate whether the method is collected when the method been called .
     *
     * @param {string} scope - The class name of public api
     * @param {string} methodName - The method name called by the public api
     * @returns {boolean} A boolean value
     */
    canAccept: (scope, methodName) => scope === 'VegaEventManager' && methodName === 'setSemantics',
    /**
     * The function checks if the method is been called.
     *
     * @param {unknown[]} args - The args parameter is an object
     * @returns {boolean} A boolean value
     */
    payloadValue: (args) => {
      const config = args;
      if (config.components) {
        const specialComponents = Object.keys(config.components);
        return !!(specialComponents.length > 0 &&
          config.components[specialComponents[0]].namespace === 'native');
      }
      return false;
    },
  },
  {
    payloadKey: 'eventOfSpecificComponentsIsVega',
    payloadDescription: 'Indicate if the vega components will emit events without the vega prefix, but special components will emit events with vega prefix',
    /**
     * Indicate whether the method is collected when the method been called .
     *
     * @param {string} scope - The class name of public api
     * @param {string} methodName - The method name called by the public api
     * @returns {boolean} A boolean value
     */
    canAccept: (scope, methodName) => scope === 'VegaEventManager' && methodName === 'setSemantics',
    /**
     * The function checks if the method is been called.
     *
     * @param {unknown[]} args - The args parameter is an object
     * @returns {boolean} A boolean value
     */
    payloadValue: (args) => {
      const config = args;
      if (config.global && config.components) {
        const specialComponents = Object.keys(config.components);
        return !!(config.global.namespace === 'native' &&
          specialComponents.length > 0 &&
          config.components[specialComponents[0]].namespace === 'vega');
      }
      return false;
    },
  },
  {
    payloadKey: 'globalJqueryDelegatedEventIsTrue',
    payloadDescription: 'Indicate if the use jQuery with event delegation',
    /**
     * Indicate whether the method is collected when the method been called .
     *
     * @param {string} scope - The class name of public api
     * @param {string} methodName - The method name called by the public api
     * @returns {boolean} A boolean value
     */
    canAccept: (scope, methodName) => scope === 'VegaEventManager' && methodName === 'setSemantics',
    /**
     * The function checks if the method is been called.
     *
     * @param {unknown[]} args - The args parameter is an object
     * @returns {boolean} A boolean value
     */
    payloadValue: (args) => {
      const config = args;
      return !!(config.global && config.global.jqueryDelegatedEvent === true);
    },
  },
  {
    payloadKey: 'jqueryDelegatedEventIsCustomStrategy',
    payloadDescription: 'Indicate if the use jQuery with event delegation',
    /**
     * Indicate whether the method is collected when the method been called .
     *
     * @param {string} scope - The class name of public api
     * @param {string} methodName - The method name called by the public api
     * @returns {boolean} A boolean value
     */
    canAccept: (scope, methodName) => scope === 'VegaEventManager' && methodName === 'setSemantics',
    /**
     * The function checks if the method is been called.
     *
     * @param {unknown[]} args - The args parameter is an object
     * @returns {boolean} A boolean value
     */
    payloadValue: (args) => {
      const config = args;
      return !!(config.global &&
        Array.isArray(config.global.jqueryDelegatedEvent) &&
        config.global.jqueryDelegatedEvent.length > 0);
    },
  },
  {
    payloadKey: 'jqueryDelegatedEventOfSpecialComponentsIsTrue',
    payloadDescription: 'Indicate if the use jQuery with event delegation',
    /**
     * Indicate whether the method is collected when the method been called .
     *
     * @param {string} scope - The class name of public api
     * @param {string} methodName - The method name called by the public api
     * @returns {boolean} A boolean value
     */
    canAccept: (scope, methodName) => scope === 'VegaEventManager' && methodName === 'setSemantics',
    /**
     * The function checks if the method is been called.
     *
     * @param {unknown[]} args - The args parameter is an object
     * @returns {boolean} A boolean value
     */
    payloadValue: (args) => {
      const config = args;
      if (config.components) {
        const specialComponents = Object.keys(config.components);
        return !!(specialComponents.length > 0 &&
          config.components[specialComponents[0]].jqueryDelegatedEvent === true);
      }
      return false;
    },
  },
];
