import { DynamicContext } from '@snowplow/tracker-core'; /** A list of CSS classes that will have their clicks tracked */ export type AllowList = { allowlist: string[] }; /** A list of CSS classes that will _not_ have their clicks tracked */ export type DenyList = { denylist: string[] }; /** A function which determines whether a button click should be tracked */ export type FilterFunction = (element: HTMLElement) => boolean; /** A filter for button click tracking */ export type Filter = AllowList | DenyList | FilterFunction; /** The configuration for automatic button click tracking */ export interface ButtonClickTrackingConfiguration { /** The filter options for the button click tracking */ filter?: Filter; /** The dynamic context which will be evaluated for each button click event */ context?: DynamicContext; /** A default label to use if one can not be determined by the content or data attributes */ defaultLabel?: string | ((element: HTMLElement) => string); } /** * A Button Click event * * Used when a user clicks on a ` * * will result in `{ label: 'show-modal' }` */ label: string; /** The ID of the button clicked, if present */ id?: string; /** An array of class names from the button clicked */ classes?: Array; /** The name of the button, if present */ name?: string; }