import { EventTypes } from './EventTypes.js';
import { ApiStoreContextVoidEvent } from './BaseEvents.js';
export const TelemetryEvents = {
    /**
     * Sends application screen view event
     * @param target A node on which to dispatch the event
     * @param screenName The screen name
     * @param detail Analytics base configuration
     */
    view: (target, screenName, detail = {}) => {
        const init = { ...detail, screenName };
        const e = new ApiStoreContextVoidEvent(EventTypes.Telemetry.view, init);
        target.dispatchEvent(e);
    },
    /**
     * Sends a Google Analytics event information
     * @param target A node on which to dispatch the event
     * @param detail The event configuration
     */
    event: (target, detail) => {
        const e = new ApiStoreContextVoidEvent(EventTypes.Telemetry.event, detail);
        target.dispatchEvent(e);
    },
    /**
     * Sends a Google Analytics exception information
     * @param target A node on which to dispatch the event
     * @param description The exception description
     * @param fatal Whether the exception was fatal to the application
     * @param detail Analytics base configuration
     */
    exception: (target, description, fatal = false, detail = {}) => {
        const init = { ...detail, description, fatal };
        const e = new ApiStoreContextVoidEvent(EventTypes.Telemetry.exception, init);
        target.dispatchEvent(e);
    },
    /**
     * Sends a Google Analytics social share information
     * @param target A node on which to dispatch the event
     * @param network The network where the shared content is shared
     * @param action The share action, eg. 'Share'
     * @param url The share url
     * @param detail Analytics base configuration
     */
    social: (target, network, action, url, detail = {}) => {
        const init = { ...detail, network, action, target: url };
        const e = new ApiStoreContextVoidEvent(EventTypes.Telemetry.social, init);
        target.dispatchEvent(e);
    },
    /**
     * Sends a Google Analytics application timing information
     * @param target A node on which to dispatch the event
     * @param category The timing category
     * @param variable The timing variable
     * @param value The timing value
     * @param label The timing label
     * @param detail Analytics base configuration
     */
    timing: (target, category, variable, value, label, detail = {}) => {
        const init = { ...detail, category, variable, value, label };
        const e = new ApiStoreContextVoidEvent(EventTypes.Telemetry.timing, init);
        target.dispatchEvent(e);
    },
};
Object.freeze(TelemetryEvents);
//# sourceMappingURL=TelemetryEvents.js.map