import { WebRtcConfig } from "@luxonis/remote-connection";
import { FoxgloveConnection } from "./foxglove-connection.js";
import { DeserializationErrorCallback } from "../messaging/deserialization.worker";
import { ProtobufKind } from "../messaging/protobuf.js";
import { MessageHandlerVersion } from "../utils/config-store";
export type PublicChannelData = {
    topic: string;
    kind: ProtobufKind;
};
export type ConnectionEventMap = {
    open: () => void;
    close: () => void;
    reconnect: () => void;
    channels: (channels: MessageEvent<PublicChannelData[]>) => void;
    services: (services: MessageEvent<string[]>) => void;
    unsupportedTopicDiscovered: (topic: string) => void;
    disconnect: (error: Error) => void;
};
export type ServiceRequestArgs = {
    name: string;
    timeout?: number;
    body?: Record<string, any> | string | number;
    ignoreResponse?: boolean;
};
export type VisualizerConnectionArgs = ({
    type: "ws";
    data: {
        connectionUrl: string;
    };
} | {
    type: "webrtc";
    data: {
        config: WebRtcConfig;
        automaticTokenRefresh?: (token: string) => void;
    };
}) & {
    errorCallback?: DeserializationErrorCallback;
    debugLogs?: boolean;
    messageHandlerVersion?: MessageHandlerVersion;
};
export declare class VisualizerConnection extends FoxgloveConnection {
    #private;
    constructor({ type, data, errorCallback, debugLogs, messageHandlerVersion }: VisualizerConnectionArgs);
    close(): void;
    on<E extends keyof ConnectionEventMap>(name: E, listener: ConnectionEventMap[E]): void;
    off<E extends keyof ConnectionEventMap>(name: E, listener: ConnectionEventMap[E]): void;
    request(args: ServiceRequestArgs): Promise<DataView | null>;
    subscribe(args: {
        topics: string[];
    }): void;
    unsubscribe(args: {
        topics: string[];
    }): void;
    get connected(): boolean;
}
//# sourceMappingURL=connection.d.ts.map