import { StatelessWebexPlugin } from '@webex/webex-core'; import { DeviceContext, TaggedEvent, EventPayload, MetricType } from './metrics.types'; /** * @description top-level abstract class to handle Metrics and common routines. * @export * @class GenericMetrics */ export default abstract class GenericMetrics extends StatelessWebexPlugin { private clientMetricsBatcher; private logger; private device; private version; private deviceId; /** * Constructor * @param {any[]} args */ constructor(...args: any[]); /** * Submit a business metric to our metrics endpoint. * @param {string} kind of metric for logging * @param {string} name of the metric * @param {object} event * @returns {Promise} */ protected submitEvent({ kind, name, event }: { kind: string; name: string; event: object; }): any; /** * Returns the deviceId from our registration with WDM. * @returns {string} deviceId or empty string */ protected getDeviceId(): string; /** * Returns the context object to be submitted with all metrics. * @returns {DeviceContext} */ protected getContext(): DeviceContext; /** * Returns the browser details to be included with all metrics. * @returns {object} */ protected getBrowserDetails(): object; /** * Returns true once we have the deviceId we need to submit behavioral/operational/business events * @returns {boolean} */ isReadyToSubmitEvents(): boolean; /** * Creates the object to send to our metrics endpoint for a tagged event (i.e. behavoral or operational) * @param {[MetricType]} list of event type (i.e. ['behavioral'], ['operational', 'behavioral']) * @param {string} metric name * @param {EventPayload} user payload * @returns {EventPayload} */ protected createTaggedEventObject({ type, name, payload, }: { type: [MetricType]; name: string; payload: EventPayload; }): TaggedEvent; }