Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

feat: add methods to telemetry service (#4289)

siam861941046801
diff --git a/packages/telemetry/src/services/telemetry-service.ts b/packages/telemetry/src/services/telemetry-service.ts
index f2abbb94c7..550b1e9971 100644
--- a/packages/telemetry/src/services/telemetry-service.ts
+++ b/packages/telemetry/src/services/telemetry-service.ts
@@ -20,15 +20,56 @@ import { createIdentifier } from '@univerjs/core';
* Univer telemetry service interface. You should implement this interface to track telemetry data.
*/
export interface ITelemetryService {
+ /**
+ * Enable the debug mode.
+ */
+ debug: () => void;
+ /**
+ * Initialize the telemetry service.
+ * @param token
+ * @param options
+ */
+ init: (options?: Record<string, any>) => void;
+ /**
+ * Identify the user.
+ * @param id
+ * @param params
+ * @returns
+ */
identify: (id: string, params?: Record<string, any>) => void;
+ /**
+ * Reset the user.
+ */
+ reset(): void;
+ /**
+ * Track the event.
+ * @param eventName
+ * @param params
+ */
capture: (eventName: string, params?: Record<string, any>) => void;
+ /**
+ * Start the timer.
+ * @param functionName
+ */
startTime: (functionName: string) => void;
+ /**
+ * End the timer.
+ * @param functionName
+ */
endTime: (functionName: string) => void;
+ /**
+ * Track the performance event.
+ * @param params
+ */
trackPerformance: (params: {
duration: number;
functionName: string;
[prop: string]: any;
}) => void;
+ /**
+ * Track the page view.
+ * @param url
+ */
onPageView: (url: string) => void;
};