import { ApiErrorType } from '../../api.connection.error'; import { IApiConnectionSpecific } from '../../api.service'; import { ConnectionPoolStateManager, ConnectionPoolItem, IConnectionPoolStateManager } from '../connectionPoolState.manager'; export type HostConnectionPoolState = { hostGetNextConnectedEndpoint: (connectedEndpoints?: string[]) => Promise; hostAddToConnections: (endpoint: string, primary: boolean) => Promise; hostGetFieldFromConnectionPoolItem: >(endpoint: string, field: K) => Promise[K]>; hostSetFieldInConnectionPoolItem: >(endpoint: string, field: K, value: ConnectionPoolItem[K]) => Promise; hostGetSuspendedEndpoints: () => Promise; hostRemoveFromConnections: (endpoint: string) => Promise; hostHandleBatchApiSuccess(successResults: Array<{ endpoint: string; responseTime: number; }>): Promise; hostHandleBatchApiError(errorResults: Array<{ endpoint: string; errorType: ApiErrorType; }>): Promise; hostGetDisconnectedEndpoints: () => Promise; }; export declare const hostConnectionPoolStateKeys: (keyof HostConnectionPoolState)[]; export declare function connectionPoolStateHostFunctions(connectionPoolState: ConnectionPoolStateManager): HostConnectionPoolState; export declare class WorkerConnectionPoolStateManager implements IConnectionPoolStateManager { private host; constructor(host: HostConnectionPoolState); getNextConnectedEndpoint(connectedEndpoints?: string[]): Promise; addToConnections(endpoint: string, primary?: boolean): Promise; getFieldValue>(endpoint: string, field: K): Promise[K]>; setFieldValue>(endpoint: string, field: K, value: ConnectionPoolItem[K]): Promise; getSuspendedEndpoints(): Promise; removeFromConnections(endpoint: string): Promise; handleApiError(endpoint: string, errorType: ApiErrorType): Promise; handleApiSuccess(endpoint: string, responseTime: number): Promise; handleBatchApiSuccess(successResults: Array<{ endpoint: string; responseTime: number; }>): Promise; handleBatchApiError(errorResults: Array<{ endpoint: string; errorType: ApiErrorType; }>): Promise; getDisconnectedEndpoints(): Promise; }