import { RpcCallOptions } from '../../network/network-manager.js'; import { tl } from '../../tl/index.js'; import { ICorePlatform } from '../../types/platform.js'; import { MustEqual } from '../../types/utils.js'; import { ConnectionState, ITelegramClient } from '../client.types.js'; import { RawUpdateInfo } from '../updates/types.js'; import { ClientMessageHandler, SendFn, SomeWorker, WorkerCustomMethods } from './protocol.js'; import { Emitter } from '@fuman/utils'; import { LogManager } from '../../utils/logger.js'; import { AppConfigManagerProxy } from './app-config.js'; import { TelegramStorageProxy } from './storage.js'; import { WorkerTimersManager } from './timers.js'; export interface TelegramWorkerPortOptions { worker: SomeWorker; workerId?: string; platform: ICorePlatform; } export declare abstract class TelegramWorkerPort implements ITelegramClient { readonly options: TelegramWorkerPortOptions; readonly log: LogManager; readonly platform: ICorePlatform; private _connection; private _invoker; readonly storage: TelegramStorageProxy; readonly appConfig: AppConfigManagerProxy; readonly timers: WorkerTimersManager; readonly prepare: ITelegramClient['prepare']; private _connect; readonly disconnect: ITelegramClient['disconnect']; readonly unsafeForceDestroy: () => Promise; readonly notifyLoggedIn: ITelegramClient['notifyLoggedIn']; readonly notifyLoggedOut: ITelegramClient['notifyLoggedOut']; readonly notifyChannelOpened: ITelegramClient['notifyChannelOpened']; readonly notifyChannelClosed: ITelegramClient['notifyChannelClosed']; readonly importSession: ITelegramClient['importSession']; readonly exportSession: ITelegramClient['exportSession']; readonly handleClientUpdate: ITelegramClient['handleClientUpdate']; readonly getApiCredentials: ITelegramClient['getApiCredentials']; readonly getPoolSize: ITelegramClient['getPoolSize']; readonly getPrimaryDcId: ITelegramClient['getPrimaryDcId']; readonly changePrimaryDc: ITelegramClient['changePrimaryDc']; readonly computeSrpParams: ITelegramClient['computeSrpParams']; readonly computeNewPasswordHash: ITelegramClient['computeNewPasswordHash']; readonly startUpdatesLoop: ITelegramClient['startUpdatesLoop']; readonly stopUpdatesLoop: ITelegramClient['stopUpdatesLoop']; readonly getMtprotoMessageId: ITelegramClient['getMtprotoMessageId']; readonly recreateDc: ITelegramClient['recreateDc']; private _abortController; readonly stopSignal: AbortSignal; readonly workerId: string; readonly connectionId: string; private _cancelBeforeExit; private _heartbeatTimer; constructor(options: TelegramWorkerPortOptions); call(message: MustEqual, params?: RpcCallOptions): Promise; abstract connectToWorker(worker: SomeWorker, handler: ClientMessageHandler): [SendFn, () => void]; onServerUpdate: Emitter; onRawUpdate: Emitter; onConnectionState: Emitter; onError: Emitter; private _onMessage; private _closed; private _close; destroy(terminate?: boolean): Promise; invokeCustom(method: T, ...args: Parameters): Promise>; connect(): Promise; }