@univerjs-pro/telemetry 0.5.1-nightly.202412110405

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ import { Ctor } from '@univerjs/core';
2
+ import { ITelemetryService } from '@univerjs/telemetry';
3
+ export declare const TELEMETRY_PLUGIN_CONFIG_KEY = "telemetry.config";
4
+ export declare const configSymbol: unique symbol;
5
+ export interface IUniverTelemetryConfig {
6
+ service?: Ctor<ITelemetryService>;
7
+ }
8
+ export declare const defaultPluginConfig: IUniverTelemetryConfig;
@@ -0,0 +1,8 @@
1
+ import { Disposable, UserManagerService } from '@univerjs/core';
2
+ import { ITelemetryService } from '@univerjs/telemetry';
3
+ export declare class TelemetryController extends Disposable {
4
+ private readonly _telemetryService;
5
+ private readonly _userManagerService;
6
+ constructor(_telemetryService: ITelemetryService, _userManagerService: UserManagerService);
7
+ _trackService(): void;
8
+ }
@@ -0,0 +1,3 @@
1
+ import { ITelemetryService } from '@univerjs/telemetry';
2
+ export declare function useTrackPageView(service: ITelemetryService): void;
3
+ export declare function useTrackPageViewWithService(): void;
@@ -0,0 +1,4 @@
1
+ export * from './controllers/telemetry.controller';
2
+ export * from './plugin';
3
+ export * from './hooks';
4
+ export { PosthogTelemetryService } from './services/posthog';
@@ -0,0 +1,10 @@
1
+ import { IUniverTelemetryConfig } from './controllers/config.schema';
2
+ import { IConfigService, Injector, Plugin } from '@univerjs/core';
3
+ export declare class UniverTelemetryPlugin extends Plugin {
4
+ private readonly _config;
5
+ protected _injector: Injector;
6
+ private readonly _configService;
7
+ static pluginName: string;
8
+ constructor(_config: IUniverTelemetryConfig | undefined, _injector: Injector, _configService: IConfigService);
9
+ onStarting(): void;
10
+ }
@@ -0,0 +1,18 @@
1
+ import { IDisposable, Disposable } from '@univerjs/core';
2
+ import { ITelemetryService } from '@univerjs/telemetry';
3
+ export declare class PosthogTelemetryService extends Disposable implements ITelemetryService, IDisposable {
4
+ private _performanceRecords;
5
+ constructor();
6
+ private _init;
7
+ startTime(functionName: string): void;
8
+ endTime(functionName: string): void;
9
+ trackPerformance(params: {
10
+ duration: number;
11
+ functionName: string;
12
+ [prop: string]: any;
13
+ }): void;
14
+ identify(id: string, params?: Record<string, any>): void;
15
+ capture(eventName: string, params?: Record<string, any> | undefined): void;
16
+ onPageView(url: string): void;
17
+ dispose(): void;
18
+ }