import { type Time } from "@foxglove/rostime";
import { type MessageEvent, PlayerPresence, type PlayerProblem, type PlayerState } from "@foxglove/studio-base/players/types";
import type { FoxgloveMessage } from "./communicator.js";
import { DepthToPointcloudWorkerPool } from "../messaging/deserialization/pointcloud/poitcloudPoolManager.js";
import type { PointCloudWithDimensions } from "../messaging/deserialization/video/depth.js";
import { DeserializationErrorCallback } from "../messaging/deserialization.worker";
import { type MessageHandler } from "../messaging/message-handler.js";
import { MessagePacketKind } from "../messaging/protobuf";
import { RateLimiter } from "../messaging/rate-limiter";
import { type DecodingError, type DecodingErrorCode } from "../utils/error";
import { PoitCloudSyncFramework } from "../utils/poitcloud-sync.js";
export type Metrics = {
    resolutions: Map<string, string | undefined>;
    incomingMessagesFps: number | undefined;
    decodedMessagesFps: number | undefined;
    messageThroughput: number | undefined;
};
type DecodingErrorData = {
    message?: string;
};
declare class ProblemManager {
    protected problems: PlayerProblem[];
    addProblem(problem: PlayerProblem): void;
    clearProblems(): void;
    getProblems(): PlayerProblem[];
}
export declare abstract class FoxgloveConnection {
    protected listener?: (playerState: PlayerState) => Promise<void>;
    protected id: string;
    protected playerPresence: PlayerPresence;
    protected playerCapabilities: string[];
    protected messageEvents: MessageEvent[];
    protected lastEncodedFrame?: MessageEvent;
    protected receivedBytes: number;
    protected startTime?: Time;
    protected endTime?: Time;
    protected parameters: Map<any, any>;
    protected publishedTopics: Map<any, any>;
    protected subscribedTopics: Map<any, any>;
    protected unsupportedTopics: Set<string>;
    protected topicDecodingErrors: Map<string, DecodingError>;
    protected advertisedServices: Map<any, any>;
    protected problems: ProblemManager;
    protected resolutions: Map<any, any>;
    protected inputMetrics: import("../utils/metrics-manager.js").EventMetricsManager;
    protected decodeMetrics: import("../utils/metrics-manager.js").EventMetricsManager;
    protected throughputMetrics: import("../utils/metrics-manager.js").ThroughputMetricsManager;
    protected PoitCloudSyncFramework: PoitCloudSyncFramework;
    protected depthToPointcloudWorkerPool: DepthToPointcloudWorkerPool;
    protected IMUEventEmitter: import("../utils/imu-manager.js").IMUEvent;
    protected messageHandler: MessageHandler;
    protected rateLimitModCoefficient: number;
    protected rateLimitCounter: Record<MessagePacketKind, number>;
    protected rateLimiter: RateLimiter;
    protected topics: {
        [key: string]: {
            name: string;
            schemaName: string;
        };
    };
    constructor(id: string);
    setListener(listener: (playerState: PlayerState) => Promise<void>): void;
    getTopicMetrics(topic: string): Metrics;
    protected getCurrentTime(): Time;
    protected onMessagePacket(event: globalThis.MessageEvent<FoxgloveMessage>, errorCallback?: DeserializationErrorCallback): void;
    protected submitPointcloudFrameCallback(coloredEvent: MessageEvent, poitcloudFrame: PointCloudWithDimensions, message: unknown): void;
    protected handleParsePointcloudMessage(coloredEvent: MessageEvent): Promise<void>;
    protected parseResolutionFromMessage(message: unknown, topic: string): {
        width: number | undefined;
        height: number | undefined;
    };
    protected handleParsedMessage(event: MessageEvent): void;
    protected emitState: (() => void) & {
        currentPromise?: Promise<void>;
    };
    protected handleDeserializationError(errorCode: DecodingErrorCode, topic: string, errorData?: DecodingErrorData): boolean;
    protected isMessageTypeDominant(packetType: MessagePacketKind, topic: string): boolean;
}
export {};
//# sourceMappingURL=foxglove-connection.d.ts.map