@snap/camera-kit
Version:
Camera Kit Web
40 lines • 1.86 kB
TypeScript
import type { Observable } from "rxjs";
import { Subject } from "rxjs";
import type { PageVisibility } from "../common/pageVisibility";
import type { ServerEvent } from "../generated-proto/blizzard/cameraKitEvents";
import { MetricsDefinition } from "../generated-proto/pb_schema/camera_kit/v3/service";
import type { Metric } from "../metrics/operational/Metric";
import type { TsProtoServiceClient } from "./createTsProtoClient";
import type { GrpcHandler } from "./grpcHandler";
export declare class MetricsClient {
private readonly grpcClient;
private readonly businessEventsHandler;
private readonly operationalMetricsHandler;
constructor(grpcClient: TsProtoServiceClient<typeof MetricsDefinition>, pageVisibility: PageVisibility | false);
setBusinessEvents(event: ServerEvent): Promise<void>;
setOperationalMetrics(metric: Metric): Promise<void>;
}
/**
* @internal
* @deprecated Use externalMetricsFactory instead, which provides an array of Observables that can be subscribed to,
* rather than a single Subject that is shared across all consumers.
* This allows for better encapsulation and prevents unintended interactions between
* different consumers of the metrics data.
*/
export declare const externalMetricsSubjectFactory: {
(): Subject<Metric>;
token: "externalMetricsSubject";
dependencies: [];
};
/** @internal */
export declare const externalMetricsFactory: {
(): Observable<Metric>[];
token: "externalMetrics";
dependencies: [];
};
export declare const metricsClientFactory: {
(args_0: Subject<Metric>, args_1: Observable<Metric>[], args_2: GrpcHandler, args_3: PageVisibility): MetricsClient;
token: "metricsClient";
dependencies: readonly ["externalMetricsSubject", "externalMetrics", "grpcHandlerFactory", "pageVisibility"];
};
//# sourceMappingURL=metricsClient.d.ts.map