/** * Area represents the global regions where the Open API gateway endpoint is located */ export declare enum Area { Unknown = 0, /** US represents the western and eastern regions of the United States */ US = 1, /** EU represents the western and central regions of Europe */ EU = 2, /** AP represents the southeastern and northeastern regions of Asia-Pacific */ AP = 3, /** CN represents the eastern and northern regions of Chinese mainland */ CN = 4 } export declare const ChineseMainlandMajorDomain = "sd-rtn.com"; export declare const OverseaMajorDomain = "agora.io"; export declare const GlobalDomainPrefix = "api"; export declare const USWestRegionDomainPrefix = "api-us-west-1"; export declare const USEastRegionDomainPrefix = "api-us-east-1"; export declare const APSoutheastRegionDomainPrefix = "api-ap-southeast-1"; export declare const APNortheastRegionDomainPrefix = "api-ap-northeast-1"; export declare const EUWestRegionDomainPrefix = "api-eu-west-1"; export declare const EUCentralRegionDomainPrefix = "api-eu-central-1"; export declare const CNEastRegionDomainPrefix = "api-cn-east-1"; export declare const CNNorthRegionDomainPrefix = "api-cn-north-1"; export declare const GlobalAPIPath = "/api/conversational-ai-agent"; export declare const CNAPIPath = "/cn/api/conversational-ai-agent"; /** * Domain contains the regional prefixes and domain suffixes for an area */ export interface Domain { regionDomainPrefixes: string[]; majorDomainSuffixes: string[]; } /** * RegionDomain maps areas to their domain configurations */ export declare const RegionDomain: Record; /** * Resolver is an interface for resolving the best domain */ export interface Resolver { resolve(domains: string[], regionPrefix: string, signal?: AbortSignal): Promise; } /** * Pool manages a pool of regional URLs with automatic cycling and domain selection */ export declare class Pool { private domainArea; private domainSuffixes; private currentDomain; private regionPrefixes; private currentRegionPrefixes; private resolver; private lastUpdate; constructor(domainArea: Area); private domainNeedUpdate; /** * SelectBestDomain uses DNS resolution to select the best available domain */ selectBestDomain(signal?: AbortSignal): Promise; /** * NextRegion cycles to the next region prefix in the pool */ nextRegion(): void; private selectDomain; /** * GetCurrentURL returns the current URL based on the selected region and domain */ getCurrentURL(): string; /** * Get the current area */ getArea(): Area; } /** * Creates a new Pool for the specified area */ export declare function createPool(area: Area): Pool;