/** * WordPress dependencies */ import { _x } from '@safe-wordpress/i18n'; /** * External dependencies */ import type { ConversionAction, ConversionActionType } from '@nab/types'; /** * Internal dependencies */ import icon from './icon.svg'; import { Edit as edit } from '../click/edit'; import { View as view } from './view'; import { validate } from '../click/validate'; import type { Attributes } from '../click/types'; export const name = 'nab/element-view'; export const settings: ConversionActionType< Attributes > = { name, category: 'view', title: _x( 'Element view', 'text', 'nelio-ab-testing' ), description: _x( 'Triggers a conversion when an element is visible on page.', 'text', 'nelio-ab-testing' ), icon, validate, attributes: { mode: 'css', value: '', }, scope: { type: 'test-scope' }, edit, view, }; // ========== // TYPESCRIPT // ========== declare module '@nab/conversion-actions' { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore function createConversionAction( actionType: typeof name, attributes: Partial< Attributes > ): ConversionAction< Attributes >; }