/**
 * @category KlevuEvents
 * Global custom document events that @klevu/core sends
 */
var KlevuDomEvents;
(function (KlevuDomEvents) {
    /**
     * When list of last searched terms update
     */
    KlevuDomEvents["LastSearchUpdate"] = "klevu-last-search-update";
    /**
     * When filter manager selection has changed
     */
    KlevuDomEvents["FilterSelectionUpdate"] = "klevu-filter-selection-updates";
    /**
     * When filters have been applied from results
     */
    KlevuDomEvents["FiltersApplied"] = "klevu-filters-applied";
    /**
     * When any click event has been fired on the page
     */
    KlevuDomEvents["ClickEventSent"] = "klevu-click-event-sent";
    /**
     * User consent given changed
     */
    KlevuDomEvents["UserConsentGivenChanged"] = "klevu-user-consent-given-changed";
    /**
     * Use consent value changed
     */
    KlevuDomEvents["UseConsentChanged"] = "klevu-use-consent-changed";
})(KlevuDomEvents || (KlevuDomEvents = {}));
/**
 * Helper function to listen Klevu Dom events
 *
 * @example ```ts
 * import { KlevuDomEvents, KlevuListenDomEvent } from '@klevu/core'
 *
 * // Event to listen
 * const stopListen = KlevuListenDomEvent(KlevuDomEvents.LastSearchUpdate, (event) => {
 *   console.log('last search updated!', event.detail)
 * })
 *
 * // stop listening
 * stopListen();
 * ```
 *
 * @category KlevuEvents
 * @param klevuDomEvent What event to listen
 * @param callback What to do when event is fired
 * @returns Function to stop listening
 */
function KlevuListenDomEvent(klevuDomEvent, callback) {
    document.addEventListener(klevuDomEvent, callback);
    return () => {
        document.removeEventListener(klevuDomEvent, callback);
    };
}

export { KlevuDomEvents as K, KlevuListenDomEvent as a };

//# sourceMappingURL=KlevuDomEvents.js.map