import { IP_VERSION, Enum } from '../constants'; export type Protocol = 'udp' | 'tcp' | 'xtls'; /** * Events emitted by ReachabilityPeerConnection */ export declare const ReachabilityPeerConnectionEvents: { readonly resultReady: "resultReady"; readonly clientMediaIpsUpdated: "clientMediaIpsUpdated"; readonly natTypeUpdated: "natTypeUpdated"; readonly reachedSubnets: "reachedSubnets"; }; export type ReachabilityPeerConnectionEvents = Enum; export type TransportResult = { result: 'reachable' | 'unreachable' | 'untested'; latencyInMilliseconds?: number; clientMediaIPs?: string[]; }; export declare enum NatType { Unknown = "unknown", SymmetricNat = "symmetric-nat" } export type ClusterReachabilityResult = { udp: TransportResult; tcp: TransportResult; xtls: TransportResult; }; export type ReachabilityMetrics = { reachability_public_udp_success: number; reachability_public_udp_failed: number; reachability_public_tcp_success: number; reachability_public_tcp_failed: number; reachability_public_xtls_success: number; reachability_public_xtls_failed: number; reachability_vmn_udp_success: number; reachability_vmn_udp_failed: number; reachability_vmn_tcp_success: number; reachability_vmn_tcp_failed: number; reachability_vmn_xtls_success: number; reachability_vmn_xtls_failed: number; natType: NatType; }; /** * This is the type that matches what backend expects us to send to them. It is a bit weird, because * it uses strings instead of booleans and numbers, but that's what they require. */ export type TransportResultForBackend = { reachable?: 'true' | 'false'; latencyInMilliseconds?: string; clientMediaIPs?: string[]; untested?: 'true'; }; export type ReachabilityResultForBackend = { udp: TransportResultForBackend; tcp: TransportResultForBackend; xtls: TransportResultForBackend; }; export type ReachabilityResultsForBackend = Record; export type ReachabilityResults = Record; export type ReachabilityReportV0 = ReachabilityResultsForBackend; export type ReachabilityReportV1 = { version: 1; result: { usedDiscoveryOptions: { 'early-call-min-clusters': number; }; metrics: { 'total-duration-ms': number; }; tests: Record; }; }; export interface ClientMediaPreferences { ipver: IP_VERSION; joinCookie: any; preferTranscoding: boolean; reachability?: ReachabilityReportV1; } export type GetClustersTrigger = 'startup' | 'early-call/no-min-reached';