interface ITelegramClient {
    appConfig: PublicPart<AppConfigManager>;
    log: Logger;
    stopSignal: AbortSignal;
    storage: PublicPart<TelegramStorageManager>;
    call<T>(message: MustEqual<T, RpcMethod>, params?: RpcCallOptions): Promise<RpcCallReturn[T["_"]]>;
    changePrimaryDc(newDc: number): Promise<void>;
    close(): Promise<void>;
    computeNewPasswordHash(algo: TypePasswordKdfAlgo, password: string): Promise<Uint8Array>;
    computeSrpParams(request: RawPassword, password: string): Promise<RawInputCheckPasswordSRP>;
    connect(): Promise<void>;
    emitError(err: unknown): void;
    exportSession(): Promise<string>;
    getApiCrenetials(): Promise<{
        hash: string;
        id: number;
    }>;
    getMtprotoMessageId(): Promise<Long>;
    getPoolSize(kind: ConnectionKind, dcId?: number): Promise<number>;
    getPrimaryDcId(): Promise<number>;
    getServerUpdateHandler(): ServerUpdateHandler;
    handleClientUpdate(updates: TypeUpdates, noDispatch?: boolean): void;
    importSession(session: string | StringSessionData, force?: boolean): Promise<void>;
    notifyChannelClosed(channelId: number): Promise<boolean>;
    notifyChannelOpened(channelId: number, pts?: number): Promise<boolean>;
    notifyLoggedIn(auth: RawUser | TypeAuthorization): Promise<RawUser>;
    notifyLoggedOut(): Promise<void>;
    onConnectionState(handler: ((state: ConnectionState) => void)): void;
    onError(handler: ((err: unknown) => void)): void;
    onServerUpdate(handler: ServerUpdateHandler): void;
    onUpdate(handler: RawUpdateHandler): void;
    prepare(): Promise<void>;
    startUpdatesLoop(): Promise<void>;
    stopUpdatesLoop(): Promise<void>;
}

Hierarchy (view full)

Implemented by

Properties

appConfig: PublicPart<AppConfigManager>
log: Logger
stopSignal: AbortSignal

Methods